CloudlinkApi
CloudlinkApi class
Static Member Summary
Static Public Members | ||
public static get |
supportedClouds: string[]: * A list of supported cloud (Cloud providers) codes |
Constructor Summary
Public Constructor | ||
public |
constructor(config: {}) CloudlinkApi constructor |
Member Summary
Public Members | ||
public |
config: * |
Method Summary
Public Methods | ||
public |
addInstance(names: Array, region: string, image: string, disk: number, size: string, sshKeys: string, subnet: number | string, securityGroups: Array, vpc: number | string, tags: Array, sshUser: string): Promise Adds a new instance (Virtual machine) |
|
public |
Creates a new internet gateway |
|
public |
Registers a new public key on cloud provider |
|
public |
Adds a new route to a routes table and links it to an Internet gateway |
|
public |
addSecurityGroup(vpcId: *, name: *, description: *): Promise Creates a new security group under a vpcId |
|
public |
addSecurityGroupInboundRules(groupId: *, rules: *): Promise Creates a set of inbound security group rules |
|
public |
addSecurityGroupOutboundRules(groupId: *, rules: *): Promise Creates a set of outbound security group rules |
|
public |
Creates a new subnet within a VPC |
|
public |
Creates a new VPC (Virtual private network) |
|
public |
addVpcAttribute(vpcId: *, attributes: *): Promise Sets/adds vpc attribute |
|
public |
attachInternetGateway(vpcId: *, gatewayId: *): Promise Attaches internet gateway to VPC |
|
public |
deleteInstance(instanceIds: *): Promise Deletes an instance/list of instances |
|
public |
Deletes a key from cloud provider |
|
public |
getInstanceStatus(instanceId: string | number): Promise Returns the status of an instance (Virtual machine) |
|
public |
getVpcAttribute(vpcId: *, attribute: *): Promise Returns vpc attribute value |
|
public |
listDistributions(filters: {}): Promise Returns a list of distributions available on cloud provider |
|
public |
listInstances(ids: Array): Promise Returns a list of instances (Virtual machines) |
|
public |
Returns a list of SSH keys registered on cloud provider |
|
public |
Returns a list of regions available on cloud provider |
|
public |
listRouteTables(filters: *): Promise Lists all routes tables, may apply filters |
|
public |
Returns a list of sizes available on cloud provider |
|
public |
listSubNets(ids: *, filters: *): Promise Returns a list of subnets |
|
public |
Returns a list of volumes (Virtual/disks) |
|
public |
Returns a list of VPCs (Virtual private network) |
|
public |
setSubNetAttribute(subNetId: *, assignPublicIp: *): Promise Sets "assignPublicIp" property for a subNet |
Static Public Members
Public Constructors
public constructor(config: {}) source
CloudlinkApi constructor
Params:
Name | Type | Attribute | Description |
config | {} | Configurations object (must include "auth" and "server" properties) |
Throw:
Public Members
public config: * source
Public Methods
public addInstance(names: Array, region: string, image: string, disk: number, size: string, sshKeys: string, subnet: number | string, securityGroups: Array, vpc: number | string, tags: Array, sshUser: string): Promise source
Adds a new instance (Virtual machine)
Params:
Name | Type | Attribute | Description |
names | Array | New instance/s names |
|
region | string | Region to create the instance/s at |
|
image | string | Image/ami to create the instance/s from |
|
disk | number | Disk size in GB |
|
size | string | Diskspace size |
|
sshKeys | string | SSH key to deploy to the new instance/s |
|
subnet | number | string |
|
Subnet id |
securityGroups | Array |
|
List of security groups ids |
vpc | number | string |
|
Vpc id/address to provision to |
tags | Array |
|
Tags list |
sshUser | string |
|
SSH user |
public addKey(name: string, publicKey: string): Promise source
Registers a new public key on cloud provider
public addRoute(routesTableId: *, cidr: *, gatewayId: *): Promise source
Adds a new route to a routes table and links it to an Internet gateway
Params:
Name | Type | Attribute | Description |
routesTableId | * | ||
cidr | * | ||
gatewayId | * |
public addSecurityGroup(vpcId: *, name: *, description: *): Promise source
Creates a new security group under a vpcId
Params:
Name | Type | Attribute | Description |
vpcId | * | ||
name | * | ||
description | * |
public addSecurityGroupInboundRules(groupId: *, rules: *): Promise source
Creates a set of inbound security group rules
Params:
Name | Type | Attribute | Description |
groupId | * | ||
rules | * |
public addSecurityGroupOutboundRules(groupId: *, rules: *): Promise source
Creates a set of outbound security group rules
Params:
Name | Type | Attribute | Description |
groupId | * | ||
rules | * |
public addSubNet(cidr: *, vpcId: *): Promise source
Creates a new subnet within a VPC
Params:
Name | Type | Attribute | Description |
cidr | * | CIDR block, network range |
|
vpcId | * | VPC id |
public addVpc(name: *, cidr: *, tenancy: *): Promise source
Creates a new VPC (Virtual private network)
Params:
Name | Type | Attribute | Description |
name | * | Vpc name |
|
cidr | * | CIDR block, network range |
|
tenancy | * | Tenancy default/dedicated/host |
public addVpcAttribute(vpcId: *, attributes: *): Promise source
Sets/adds vpc attribute
Params:
Name | Type | Attribute | Description |
vpcId | * | ||
attributes | * |
public attachInternetGateway(vpcId: *, gatewayId: *): Promise source
Attaches internet gateway to VPC
Params:
Name | Type | Attribute | Description |
vpcId | * | ||
gatewayId | * |
public deleteInstance(instanceIds: *): Promise source
Deletes an instance/list of instances
Params:
Name | Type | Attribute | Description |
instanceIds | * |
public getInstanceStatus(instanceId: string | number): Promise source
Returns the status of an instance (Virtual machine)
public getVpcAttribute(vpcId: *, attribute: *): Promise source
Returns vpc attribute value
Params:
Name | Type | Attribute | Description |
vpcId | * | ||
attribute | * |
public listDistributions(filters: {}): Promise source
Returns a list of distributions available on cloud provider
Params:
Name | Type | Attribute | Description |
filters | {} | Filters object |
public listInstances(ids: Array): Promise source
Returns a list of instances (Virtual machines)
Params:
Name | Type | Attribute | Description |
ids | Array |
|
public listRouteTables(filters: *): Promise source
Lists all routes tables, may apply filters
Params:
Name | Type | Attribute | Description |
filters | * |
public listSubNets(ids: *, filters: *): Promise source
Returns a list of subnets
Params:
Name | Type | Attribute | Description |
ids | * | ||
filters | * |