cloudmesh-cloud.cloudmesh.compute.vm.Provider

Module Contents

Classes

Provider

class cloudmesh-cloud.cloudmesh.compute.vm.Provider.Provider(name=None)

Bases: cloudmesh.abstract.ComputeNodeABC.ComputeNodeABC

static get_kind()
static get_provider(kind)
cloudname(self)
expand(self, names)
destroy(self, name=None)

Destroys the node :param name: the name of the node :return: the dict of the node

loop_name(self, names, func, **kwargs)
loop(self, func, **kwargs)
keys(self)

Lists the keys on the cloud

Returns

dict

list(self, **kwargs)

list all vms

Returns

an array of dicts representing the nodes

flavor(self, **kwargs)

Gets the flavor with a given name :param name: The name of the flavor :return: The dict of the flavor

flavors(self, **kwargs)

Lists the flavors on the cloud

Returns

dict of flavors

add_collection(self, d, *args)
images(self, *args, **kwargs)

Lists the images on the cloud :return: dict

create(self, **kwargs)

creates a named node

Parameters
  • group – a list of groups the vm belongs to

  • name – the name of the node

  • image – the image used

  • size – the size of the image

  • timeout – a timeout in seconds that is invoked in case the image does not boot. The default is set to 3 minutes.

  • kwargs – additional arguments passed along at time of boot

Returns

compress(self, cm)

Opensatck metadata is limited, we remove the spaces

Parameters

cm

Returns

_create(self, **arguments)
find_attribute(self, name, dicts)
find_clouds(self, name=None)
stop(self, name=None, **kwargs)

stops the node with the given name

Parameters

name

Returns

The dict representing the node including updated status

start(self, name=None, **kwargs)

start a node

Parameters

name – the unique node name

Returns

The dict representing the node

info(self, name=None, **kwargs)

gets the information of a node with a given name

Parameters

name

Returns

The dict representing the node including updated status

resume(self, name=None)

resume the named node

Parameters

name – the name of the node

Returns

the dict of the node

status(self, name=None)
reboot(self, name=None)

Reboot a list of nodes with the given names

Parameters

name – A list of node names

Returns

A list of dict representing the nodes

set_server_metadata(self, name, **metadata)

sets the metadata for the server

Parameters
  • name – name of the vm

  • metadata – the metadata

Returns

get_server_metadata(self, name)

gets the metadata for the server

Parameters

name – name of the vm

Returns

delete_server_metadata(self, name, key)

gets the metadata for the server

Parameters
  • name – name of the vm

  • key – name of the key

Returns

rename(self, source=None, destination=None)

rename a node

Parameters
  • destination

  • name – the current name

Returns

the dict with the new name

key_upload(self, key)

uploads the key specified in the yaml configuration to the cloud :param key: :return:

key_delete(self, key)

deletes the key with the given name :param name: The name of the key :return:

name_parameter(self, name)
login(self)
abstract suspend(self, name=None)

suspends the node with the given name

Parameters

name – the name of the node

Returns

The dict representing the node

Prints(self, data, output='table', kind=None)
Print(self, data, output='table', kind=None)
list_secgroups(self)

List the named security group

Parameters

name – The name of the group, if None all will be returned

Returns

list_secgroup_rules(self, name=None)

List the named security group

Parameters

name – The name of the group, if None all will be returned

Returns

remove_secgroup(self, name=None)
add_secgroup(self, name=None)
upload_secgroup(self, name=None)
delete_public_ip(self, ip)

Deletes the ip address

Parameters

ip – the ip address, if None than all will be deleted

Returns

list_public_ips(self, available=False)

Lists the public ip addresses.

Parameters

available – if True only those that are not allocated will be returned.

Returns

create_public_ip(self)

Creates a new public IP address to use

Returns

The ip address information

find_available_public_ip(self)

Returns a single public available ip address.

Returns

The ip

detach_public_ip(self, name=None, ip=None)

adds a public ip to the named vm

Parameters
  • name – Name of the vm

  • ip – The ip address

Returns

attach_public_ip(self, name=None, ip=None)

adds a public ip to the named vm

Parameters
  • name – Name of the vm

  • ip – The ip address

Returns

get_public_ip(self, name=None)

returns the public ip

Parameters

name – name of the server

Returns

ssh(self, vm=None, command=None)
console(self, vm=None)

gets the output from the console

Parameters

vm – name of the VM

Returns

wait(self, vm=None, interval=None, timeout=None)

wais till the given VM can be logged into

Parameters
  • vm – name of the vm

  • interval – interval for checking

  • timeout – timeout

Returns

log(self, vm=None)
add_secgroup_rule(self, name=None, port=None, protocol=None, ip_range=None)
add_rules_to_secgroup(self, name=None, rules=None)