libcloud.compute.drivers.gig_g8 module
GiG G8 Driver
- class libcloud.compute.drivers.gig_g8.G8Network(id, name, cidr, publicipaddress, driver, extra=None)[source]
Bases:
UuidMixin
G8 Network object class.
This class maps to a cloudspace
- property cidr
Cidr is not part of the list result we will lazily fetch it with a get request
- class libcloud.compute.drivers.gig_g8.G8NodeDriver(user_id, key, api_url)[source]
Bases:
NodeDriver
GiG G8 node driver
- Parameters:
key (
str
) – Token to use for api (jwt)user_id (
int
) – Id of the account to connect to (accountId)api_url (
str
) – G8 api url
- Return type:
None
- NODE_STATE_MAP: Dict[str, NodeState] = {'ADDING_DISK': NodeState.RECONFIGURING, 'ATTACHING_DISK': NodeState.RECONFIGURING, 'ATTACHING_NIC': NodeState.RECONFIGURING, 'CHANGING_DISK_LIMITS': NodeState.RECONFIGURING, 'CLONING': NodeState.PENDING, 'CREATING_TEMPLATE': NodeState.PENDING, 'DELETED': NodeState.TERMINATED, 'DELETING': NodeState.TERMINATED, 'DELETING_DISK': NodeState.RECONFIGURING, 'DEPLOYING': NodeState.PENDING, 'DESTROYED': NodeState.TERMINATED, 'DESTROYING': NodeState.TERMINATED, 'DETACHING_DISK': NodeState.RECONFIGURING, 'DETTACHING_NIC': NodeState.RECONFIGURING, 'ERROR': NodeState.ERROR, 'HALTED': NodeState.STOPPED, 'MOVING': NodeState.MIGRATING, 'PAUSED': NodeState.PAUSED, 'PAUSING': NodeState.PENDING, 'RESETTING': NodeState.REBOOTING, 'RESIZING': NodeState.RECONFIGURING, 'RESTORING': NodeState.PENDING, 'RESUMING': NodeState.PENDING, 'RUNNING': NodeState.RUNNING, 'STARTING': NodeState.STARTING, 'STOPPING': NodeState.STOPPING, 'VIRTUAL': NodeState.PENDING}
- attach_volume(node, volume)[source]
Attaches volume to node.
- Parameters:
node (
Node
) – Node to attach volume to.volume (
StorageVolume
) – Volume to attach.device (
str
) – Where the device is exposed, e.g. ‘/dev/sdb’
- Rytpe:
bool
- connectionCls
alias of
G8Connection
- create_node(name, image, ex_network, ex_description, size=None, auth=None, ex_create_attr=None, ex_expose_ssh=False)[source]
Create a node.
The ex_create_attr parameter can include the following dictionary key and value pairs:
- memory:
int
Memory in MiB (only used if size is None and vcpus is passed
- memory:
- vcpus:
int
Amount of vcpus (only used if size is None and memory is passed)
- vcpus:
- disk_size:
int
Size of bootdisk defaults to minimumsize of the image
- disk_size:
user_data:
str
for cloud-config dataprivate_ip:
str
Private Ip inside network- data_disks:
list(int)
Extra data disks to assign to vm list of disk sizes in GiB
- data_disks:
- Parameters:
name (
str
) – the name to assign the vmsize (:
str
) – the plan size to create mutual exclusive with memory vcpusimage (
NodeImage
) – which distribution to deploy on the vmnetwork – G8 Network to place vm in
ex_description – Description of vm
auth (
NodeAuthSSHKey
) – an SSH keyex_create_attr (
dict
) – A dictionary of optional attributes for vm creationex_expose_ssh (int) – Create portforward for ssh port
- Returns:
The newly created node.
- Return type:
Node
- create_volume(size, name, ex_description, ex_disk_type='D')[source]
Create volume
- Parameters:
size (
int
) – Size of the volume to create in GiBname (
str
) – Name of the volumedescription (
str
) – Description of the volumedisk_type (
str
) – Type of the disk depending on the G8 D for datadisk is always available
- Return type:
class:StorageVolume
- destroy_volume(volume)[source]
Destroys a storage volume.
- Parameters:
volume (
StorageVolume
) – Volume to be destroyed- Return type:
bool
- detach_volume(node, volume)[source]
Detaches a volume from a node.
- Parameters:
volume (
StorageVolume
) – Volume to be detached- Return type:
bool
- ex_create_network(name, private_network='192.168.103.0/24', type='vgw')[source]
Create network also known as cloudspace
- Parameters:
name (
str
) – the name to assign to the networkprivate_network (
str
) – subnet used as private networktype (
str
) – type of the gateway vgw or routeros
- ex_expose_ssh_node(node)[source]
Create portforward for ssh purposed
- Parameters:
node (
Node
) – Node to expose ssh for- Return type:
int
- ex_list_networks()[source]
Return the list of networks.
- Returns:
A list of network objects.
- Return type:
list
ofG8Network
- list_images()[source]
Returns a list of images as a cloud provider might have
@inherits:
NodeDriver.list_images
- list_nodes(ex_network=None)[source]
List the nodes known to a particular driver; There are two default nodes created at the beginning
- list_volumes()[source]
List storage volumes.
- Return type:
list
ofStorageVolume