cloudmesh_client.cloud package

Subpackages

Submodules

cloudmesh_client.cloud.ListResource module

class cloudmesh_client.cloud.ListResource.ListResource[source]

Bases: object

classmethod clear()[source]

deletes all default values in the database. :return:

classmethod delete(key, category)[source]
classmethod get(key, category='general')[source]

returns the value of the first objects matching the key with the given category.

Parameters:
  • key – The dictionary key
  • category – The category
Returns:

classmethod get_object(key, category='general')[source]

returns the first object that matches the key in the Default database.

Parameters:
  • key – The dictionary key
  • category – The category
Returns:

info(**kwargs)[source]
classmethod list(category=None, order=None, output='table')[source]

lists the default values in the specified format. TODO: This method has a bug as it uses format and output, only one should be used.

Parameters:
  • category – the category of the default value. If general is used it is a special category that is used for global values.
  • order – The order in which the attributes are returned
  • output – The output format. json, table, yaml, dict, csv
Returns:

refresh(**kwargs)[source]
classmethod set(key, value, category=None, user=None)[source]

sets the default value for a given category :param key: the dictionary key of the value to store it at. :param value: the value :param category: the name of the category :param user: the username to store this default value at. :return:

cloudmesh_client.cloud.attributes module

class cloudmesh_client.cloud.attributes.Attributes[source]

Bases: cloudmesh_client.cloud.ListResource.ListResource

classmethod list(cloud, kind)[source]

This method lists all flavors of the cloud :param cloud: the cloud name :param kind: the kind of the attribute

classmethod refresh(cloud)[source]

This method has no effect for attributes :param cloud: The name of the cloud

cloudmesh_client.cloud.counter module

class cloudmesh_client.cloud.counter.Counter[source]

Bases: object

A counter is used to keep track of some value that can be increased and is associated with a user. Typically it is used to increment the vm id or the job id.

cm = <cloudmesh_client.db.CloudmeshDatabase.CloudmeshDatabase object>
classmethod get(name='counter', user=None)[source]

returns the value of the counter

Parameters:
  • name – name of the counter
  • user – username associated with the counter
Returns:

the value of the counter

classmethod incr(name='counter', user=None)[source]

increments the counter by one

Parameters:
  • name – name of the counter
  • user – username associated with the counter
Returns:

classmethod set(name='counter', value=None, user=None)[source]

sets a counter associated with a particular user :param name: name of the counter :param user: username associated with the counter :param value: the value :return:

cloudmesh_client.cloud.experiment module

class cloudmesh_client.cloud.experiment.Experiment[source]

Bases: object

classmethod list(cluster, id=None, format=None)[source]
classmethod output(cluster, id=None, format=None)[source]
classmethod rm(cluster, id=None, format=None)[source]

cloudmesh_client.cloud.flavor module

class cloudmesh_client.cloud.flavor.Flavor[source]

Bases: cloudmesh_client.cloud.ListResource.ListResource

cm = <cloudmesh_client.db.CloudmeshDatabase.CloudmeshDatabase object>
classmethod details(cloud, id, live=False, format='table')[source]
classmethod list(cloud, live=False, format='table')[source]

This method lists all flavors of the cloud :param cloud: the cloud name

classmethod refresh(cloud)[source]

This method would refresh the flavor list by first clearing the database, then inserting new data :param cloud: the cloud name

cloudmesh_client.cloud.group module

class cloudmesh_client.cloud.group.Group[source]

Bases: cloudmesh_client.cloud.ListResource.ListResource

classmethod add(name=None, species='vm', member=None, category=None)[source]
Add an instance to a new group
or add it to an existing one
Parameters:
  • name
  • species
  • member
  • cloud
Returns:

classmethod check(name, cloud)[source]

checks if the group with the given name exists and raises exception

cm = <cloudmesh_client.db.CloudmeshDatabase.CloudmeshDatabase object>
classmethod copy(_fromName, _toName)[source]

Method to make copy of a group :param _fromName: :param _toName: :return:

classmethod delete(name=None)[source]
Method to delete a group from
the cloudmesh database
Parameters:
  • name
  • cloud
Returns:

classmethod exists(name, cloud)[source]

checks if the group with the given name exists

classmethod get(**kwargs)[source]

This method queries the database to fetch group(s) with given name filtered by cloud. :param name: :param cloud: :return:

classmethod get_info(category='general', name=None, output='table')[source]

Method to get info about a group :param cloud: :param name: :param output: :return:

classmethod get_vms(name)[source]

returns a list of vms within this group :param name: :return:

classmethod list(name=None, order=None, header=None, output='table')[source]

lists the default values in the specified format. TODO: This method has a bug as it uses format and output, only one should be used.

Parameters:
  • category – the category of the default value. If general is used it is a special category that is used for global values.
  • format – json, table, yaml, dict, csv
  • order – The order in which the attributes are returned
  • output – The output format.
Returns:

classmethod merge(group_a, group_b, merged_group)[source]
Method to merge two groups into
one group
Parameters:
  • group_a
  • group_b
  • merged_group
Returns:

classmethod names()[source]
order = ['name', 'member', 'user', 'category', 'type', 'species']
classmethod remove(name, member)[source]

Method to remove an ID from the group in the cloudmesh database :param name: :param id: :param category: :return:

classmethod to_dict(item)[source]

Method to convert input to a dict :param item: :return:

classmethod vm_groups(vm)[source]
Parameters:vm – name of the vm
Returns:a list of groups the vm is in

cloudmesh_client.cloud.hpc module

This module is used to interface with classical HPC queuing systems.

cloudmesh_client.cloud.image module

class cloudmesh_client.cloud.image.Image[source]

Bases: cloudmesh_client.cloud.ListResource.ListResource

cm = <cloudmesh_client.db.CloudmeshDatabase.CloudmeshDatabase object>
classmethod details(cloud, id, live=False, format='table')[source]
classmethod get(name=None, cloud=None)[source]
classmethod get_username(name, cloud, guess=False)[source]
classmethod guess_username(vm_name, cloud=None, description=None)[source]
classmethod guess_username_from_category(category, image, username=None)[source]
classmethod list(cloud, format='table')[source]

This method lists all images of the cloud :param cloud: the cloud name

classmethod refresh(cloud)[source]

This method would refresh the image list by first clearing the database, then inserting new data :param cloud: the cloud name

classmethod set_username(name=None, cloud=None, username=None)[source]

cloudmesh_client.cloud.inventory module

class cloudmesh_client.cloud.inventory.Inventory[source]

Bases: cloudmesh_client.cloud.ListResource.ListResource

add(**kwargs)[source]
info()[source]
list(format='dict', sort_keys=True, order=None)[source]
read(filename=None, format='yaml')[source]
save(filename=None, format='yaml')[source]
class cloudmesh_client.cloud.inventory.command_system[source]

Bases: object

classmethod status(host)[source]

cloudmesh_client.cloud.ip module

class cloudmesh_client.cloud.ip.Ip[source]

Bases: cloudmesh_client.cloud.ListResource.ListResource

cm = <cloudmesh_client.db.CloudmeshDatabase.CloudmeshDatabase object>
classmethod list(cloud=None, names=None, output='table', live=False)[source]

cloudmesh_client.cloud.key module

class cloudmesh_client.cloud.key.Key[source]

Bases: cloudmesh_client.cloud.ListResource.ListResource

classmethod add_azure_key_to_db(key_name, key_path, certificate_path, pfx_path)[source]
Adds the public key to the existing database model and adds the certificate, key and fingerprint into the azure key database model.
Parameters:
  • key_name – Key name to be added
  • key_path – Public key path
  • certificate_path – Certificate file path(PEM file)
  • pfx_path – PKCS encoded certificate path
Returns:

classmethod add_from_path(path, keyname=None, user=None, source=None, uri=None, store=True)[source]

Adds the key to the database based on the path

Parameters:keyname – name of the key or path to the key
Returns:
classmethod add_key_to_cloud(user, keyname, cloud)[source]
Parameters:
  • user
  • keyname
  • cloud
  • name_on_cloud
classmethod all(output='dict')[source]
classmethod clear(**kwargs)[source]
cm = <cloudmesh_client.db.CloudmeshDatabase.CloudmeshDatabase object>
classmethod delete(name=None, cloud=None)[source]
classmethod delete_from_cloud(name, cloud=None)[source]
classmethod find(name=None, output='dict')[source]
classmethod get(name=None, output='dict')[source]

Finds the key on the database by name

Parameters:name – name of the key to be found
Returns:Query object of the search
classmethod get_default()[source]
classmethod get_from_cloud(cloud, live=False, format='table')[source]

This method lists all keys of the cloud :param cloud: the cloud name :return: a SSHKeyManager (dict of keys)

classmethod get_from_dir(directory=None, store=True)[source]
classmethod get_from_git(username, store=True)[source]
Parameters:username – the github username
Returns:an array of public keys
Return type:list
classmethod get_from_yaml(filename=None, load_order=None, store=True)[source]
Parameters:filename – name of the yaml file
Returns:a SSHKeyManager (dict of keys)
classmethod info(**kwargs)[source]
classmethod list(category=None, live=False, output='table')[source]

this does not work only returns all ceys in the db

classmethod list_on_cloud(cloud, live=False, format='table')[source]

This method lists all keys of the cloud :param cloud: the cloud name

classmethod refresh(**kwargs)[source]
classmethod run_command(cmd)[source]

Runs a command in a shell, returns the result

classmethod select()[source]
classmethod set_default(name)[source]

cloudmesh_client.cloud.launcher module

class cloudmesh_client.cloud.launcher.Launcher[source]

Bases: cloudmesh_client.cloud.ListResource.ListResource

classmethod add(name=None, source=None)[source]
classmethod clear(**kwargs)[source]
cm = <cloudmesh_client.db.CloudmeshDatabase.CloudmeshDatabase object>
classmethod delete(name=None, category=None)[source]
classmethod details(**kwargs)[source]
info(**kwargs)[source]
classmethod kill(**kwargs)[source]
classmethod list(name=None, output='table')[source]
classmethod refresh(**kwargs)[source]
classmethod resume(**kwargs)[source]
classmethod run(**kwargs)[source]
classmethod suspend(**kwargs)[source]

cloudmesh_client.cloud.limits module

class cloudmesh_client.cloud.limits.Limits[source]

Bases: cloudmesh_client.cloud.ListResource.ListResource

classmethod list(cloud, output='table', tenant=None)[source]

cloudmesh_client.cloud.list module

class cloudmesh_client.cloud.list.List[source]

Bases: object

cm = <cloudmesh_client.db.CloudmeshDatabase.CloudmeshDatabase object>
classmethod list(kind, cloud, user=None, tenant=None, order=None, header=None, output='table')[source]

Method lists the data in the db for given cloud and of given kind :param kind: :param cloud: :param tenant: :param user: :param order: :param header: :param output: :return:

classmethod toDict(item)[source]

Method converts the item to a dict :param item: :return:

cloudmesh_client.cloud.network module

class cloudmesh_client.cloud.network.Network[source]

Bases: cloudmesh_client.cloud.ListResource.ListResource

classmethod assign_floating_ip(cloudname, instance_id, floating_ip)[source]
classmethod associate_floating_ip(cloudname, instance_name, floating_ip)[source]

Method to associate floating ip to an instance :param cloudname: :param instance_name: :param floating_ip: :return:

cm = <cloudmesh_client.db.CloudmeshDatabase.CloudmeshDatabase object>
classmethod create_assign_floating_ip(cloudname, instance_name)[source]

Method to create a new floating-ip and associate it with the instance :param cloudname: cloud :param instance_name: name of instance :return: floating_ip

classmethod create_floating_ip(cloudname, floating_pool=None)[source]

Method to create a floating ip address under a pool :param cloudname: :param floating_pool: :return: floating ip addr

classmethod delete_floating_ip(cloudname, floating_ip_or_id)[source]

Method to delete a floating ip address :param cloudname: :param floating_ip_or_id: :return:

classmethod disassociate_floating_ip(cloudname, instance_name, floating_ip)[source]

Disassociates a floating ip from an instance :param cloudname: :param instance_name: :param floating_ip: :return:

classmethod find_assign_floating_ip(cloudname, instance_id)[source]
classmethod find_instance_name(**kwargs)[source]

Method to find instance name :param kwargs: :return: instance_name

classmethod get_fixed_ip(cloudname, fixed_ip_addr, output='table')[source]

Method retrieves fixed ip info :param cloudname: :param fixed_ip_addr: :return: fixed_ip_info

classmethod get_floating_ip(cloudname, floating_ip_or_id, output='table')[source]

Method to get floating ip info :param cloudname: :param floating_ip_or_id: :return: floating ip info

classmethod get_floating_ip_list(cloudname)[source]

Method to get the floating IP list :param cloudname: :return: floating_ips

classmethod get_instance_dict(**kwargs)[source]

Method to get instance dict :param kwargs: :return: instance dict

classmethod get_unused_floating_ip_list(cloudname)[source]

Method to get the unused floating IP list :param cloudname: :return: floating_ips

classmethod isDictEmpty(dictionary)[source]

Method to test empty Dict :param dictionary: :return:

classmethod isIPAddr(ip_or_id)[source]

Method to check if argument is IP address or notS :param ip_or_id: :return:

classmethod isUuid(argument)[source]

Method to check if arg is an UUID :param argument: :return:

classmethod list_floating_ip(cloudname, output='table')[source]

Method to list floating ips :param cloudname: :return: floating ip list

classmethod list_floating_ip_pool(cloudname)[source]

Method to list floating ip pool :param cloudname: :return:

classmethod list_unused_floating_ip(cloudname, output='table')[source]

Method to list unused floating ips These floating ips are not associated with any instance :param cloudname: :return: floating ip list

classmethod reserve_fixed_ip(cloudname, fixed_ip_addr)[source]

Reserve a fixed ip address :param cloudname: :param fixed_ip_addr: :return:

classmethod unreserve_fixed_ip(cloudname, fixed_ip_addr)[source]

Unreserve a fixed ip address :param cloudname: :param fixed_ip_addr: :return:

cloudmesh_client.cloud.nova module

class cloudmesh_client.cloud.nova.Nova[source]

Bases: object

classmethod remove_subjectAltName_warning(content)[source]

cloudmesh_client.cloud.quota module

class cloudmesh_client.cloud.quota.Quota[source]

Bases: cloudmesh_client.cloud.ListResource.ListResource

classmethod list(cloud, tenant, output='table')[source]

cloudmesh_client.cloud.register module

class cloudmesh_client.cloud.register.CloudRegister[source]

Bases: object

classmethod check_yaml_for_completeness(filename)[source]

outputs how many values has to be fixed in cloudmesh.yaml file

Parameters:filename (string) – the file name
Returns:
classmethod ec2(cloud, zipfile)[source]
classmethod fill_out_form(filename)[source]

edits profile and clouds from cloudmesh.yaml :param filename: :type filename: string :return:

classmethod from_environ(provider)[source]

Reads env OS_* variables and registers a new cloud in yaml, interactively. :return:

classmethod from_file(filename)[source]

Replaces the TBD in cloudmesh.yaml with the contents present in FILEPATH’s FILE :param filename: :return:

classmethod get(cloud)[source]
classmethod list(filename, cloud, info=False, output='table')[source]

lists clouds from cloudmesh.yaml file

Parameters:filename (string) –
Returns:
classmethod list_ssh()[source]

lists hosts from ~/.ssh/config

Returns:
classmethod make_dir(directory)[source]
classmethod read_env_config()[source]

Function that will read OS_* vairables from environment and populate dict env_config_data. :return: env_config_data dict

classmethod read_rc_file(host, openrc, force=False)[source]
Parameters:
  • host (string) – the host name
  • openrc (string) – the file name
Returns:

classmethod remote(host, force=False)[source]

TODO: there is a bug in the instalation of kilo the openrc file on the remote machine is not called openrc.sh but contains username and project number.

Parameters:
  • host – the remote host
  • force
Returns:

classmethod set_username(username)[source]

Method that sets the username in yaml. :param username: :return:

classmethod test(filename)[source]

TODO :param filename: :type filename: string :return:

class cloudmesh_client.cloud.register.Register[source]

Bases: object

classmethod entry(name)[source]

cloudmesh_client.cloud.reservation module

class cloudmesh_client.cloud.reservation.Reservation[source]

Bases: cloudmesh_client.cloud.ListResource.ListResource

classmethod add(name, start, end, user=None, project=None, hosts=None, description=None, category=None)[source]
Parameters:
  • name – Name of reservation
  • start – Start time of reservation
  • end – End time of reservation
  • user – Reserved by this user
  • project – Reservation project
  • hosts – Reserved hosts
  • description – Description
  • cloud – Cloud into which reservation done
Returns:

add_from_file(filename)[source]
Parameters:filename
Returns:
classmethod clear(names=None)[source]
cm = <cloudmesh_client.db.CloudmeshDatabase.CloudmeshDatabase object>
classmethod delete(name=None, start=None, end=None, user=None, project=None, hosts=None)[source]
Parameters:
  • name – Name of reservation
  • start – Start time of reservation
  • end – End time of reservation
  • user – Reserved by this user
  • project – Reservation project
  • hosts – Hosts reserved
Returns:

classmethod delete_from_file(filename)[source]
Parameters:filename
Returns:
info(user=None, project=None)[source]

prints if the user has access to the reservation an on which host.

Parameters:
  • user
  • project
Returns:

classmethod list(name=None, start=None, end=None, user=None, project=None, hosts=None)[source]
Parameters:
  • name – Name of reservation
  • start – Start time of reservation
  • end – End time of reservation
  • user – Reserved by this user
  • project – Reservation project
  • hosts – Hosts reserved
Returns:

classmethod refresh(names=None)[source]
classmethod resume(names=None)[source]
classmethod suspend(names=None)[source]
classmethod update(name, start, end, user=None, project=None, hosts=None, description=None, cloud=None)[source]

cloudmesh_client.cloud.secgroup module

class cloudmesh_client.cloud.secgroup.SecGroup[source]

Bases: cloudmesh_client.cloud.ListResource.ListResource

classmethod add_group_cloud(cloud, groupname)[source]
classmethod add_rule(cloud, secgroup_uuid, from_port, to_port, protocol, cidr)[source]
classmethod add_rule_cloud(cloud, groupname, rulename)[source]
classmethod add_rule_to_db(group=None, name=None, from_port=None, to_port=None, protocol=None, cidr=None)[source]
cm = <cloudmesh_client.db.CloudmeshDatabase.CloudmeshDatabase object>

NOT USED @classmethod def convert_list_to_dict(cls, os_result):

d = {} for i, obj in enumerate(os_result):

d[i] = {} d[i][“Id”] = obj.id d[i][“Name”] = obj.name d[i][“Description”] = obj.description

return d

classmethod convert_rules_to_dict(os_result)[source]
classmethod create(group=None, category=None)[source]

Method creates a new security group in database & returns the uuid of the created group :param group: :param category: :return:

classmethod delete(category='general', group=None, name=None)[source]
classmethod delete_all_rules(secgroup)[source]
classmethod delete_all_rules_cloud(cloud, groupname)[source]
classmethod delete_group_cloud(cloud, groupname)[source]
classmethod delete_rule(cloud, secgroup, from_port, to_port, protocol, cidr)[source]
classmethod delete_rule_cloud(cloud, groupname, rulename)[source]
classmethod delete_rule_from_db(group=None, name=None)[source]
classmethod delete_secgroup(name=None, cloud=None)[source]
classmethod enable_ssh(secgroup_name='default', cloud='general')[source]
classmethod get(name=None, cloud='general')[source]

This method queries the database to fetch secgroup with given name filtered by cloud. :param name: :param cloud: :return:

classmethod get_group_cloud(cloud, groupname)[source]
classmethod get_rule_cloud(cloud, groupname, rulename)[source]
classmethod list(group=None, name=None, category='general', output='table', scope='all')[source]

This method queries the database to fetch list of secgroups filtered by cloud. :param cloud: :return:

classmethod list_groups_cloud(cloud)[source]
classmethod list_rules(group=None, output='table')[source]

This method gets the security group rules from the cloudmesh database :param uuid: :return:

classmethod list_rules_cloud(cloud, groupname)[source]
classmethod refresh(cloud)[source]

This method would refresh the secgroup list by first clearing the database, then inserting new data :param cloud: the cloud name

classmethod reset_defaults()[source]
classmethod upload(cloud=None, group=None)[source]

cloudmesh_client.cloud.stack module

class cloudmesh_client.cloud.stack.BigDataStack(dest, repo='git://github.com/futuresystems/big-data-stack.git', branch='master', **kwargs)[source]

Bases: object

deploy(ips=None, name=None, user=None, playbooks=None, defines=None)[source]

Deploy the big-data-stack to a previously stood up cluster located at ips with login user user.

Parameters:
  • ips (list of str IP addresses) – the ip addresses of the cluster to deploy to
  • name (str) – the name of the cluster
  • user (str) – the login username of the cluster
  • playbooks (list of str) – the list of playbooks to deploy. These are paths relative to the root directory of the BDS repository.
  • defines (dict from playbook name to dict of variable name to value) – the overridden variables defined for each playbook
  • ping_max (int) – the maximum number of time to attempt to ping the cluster during the verification step.
  • ping_sleep (int) – the number of seconds to wait between each attempt to ping
init(force=False, update=False)[source]

Initialize by cloning (or updating if requested) a local copy of the Big Data Stack repository.

Parameters:
  • force (bool) – setup previously setup project
  • update (bool) – update the local repository from the origin
classmethod load(path)[source]
sync_metadata()[source]
class cloudmesh_client.cloud.stack.KWArgs(**kwargs)[source]

Bases: object

class cloudmesh_client.cloud.stack.Project(name, stack, deployparams=None)[source]

Bases: object

Captures the parameters and stack for a deployment. Note: this is a lower-level API that should be predominantly be constructed using the ProjectFactory.

deploy(force=False)[source]
filename = '.cloudmesh_project.yml'
init(force=False, update=False)[source]
classmethod load(path)[source]
metadata
sync_metadata(path)[source]
class cloudmesh_client.cloud.stack.ProjectDB(prefix='~/.cloudmesh/projects')[source]

Bases: object

activate(project)[source]

Activate the given project

Parameters:project (Project) – the project to make active
add(project, force=False, update=False)[source]

Add a project to the database

Parameters:
  • project (Project) – the project to add_from_path
  • force (bool) – whether or not to force initialiation
  • update (bool) – whether or not to update a previous initialied project
default_name = 'p-'
filename = '.cloudmesh_projectdb.yml'
getactive()[source]

Returns the currently active project.

Returns:the currently active project
Return type:subclass of Project
Raises:KeyError if no project is currently active
isactive(project)[source]

Predicate indicating activation status of the project

Parameters:project (Project) – the project to check
Return type:bool
lookup(projname)[source]

Lookup the project with the given name.

If projname is None, this returns the currently active project.

Parameters:projname – Project name
Returns:the project
Return type:Project
new_project_name()[source]

Automatically generate a new project name

Returns:a project name
Return type:str
projectdir(name)[source]

Get the project directory.

Parameters:name (str) – the name of a project
Returns:the path to the project
Return type:str
sync_metadata(projects=True)[source]

Synchronize the metadata to the backend store

Parameters:projects (bool) – project metadata should be saved as well.
update(project)[source]

Update the database with the given project

Parameters:project (Project) – the project
class cloudmesh_client.cloud.stack.ProjectFactory(prefix='~/.cloudmesh/projects')[source]

Bases: object

Outer API used to create projects.

This factory should be used rather than directly constructing Project instances.

activate(make_active=True)[source]

Set whether or not the created project should be activated

set_branch(branch='master')[source]

Set the branch of the repository to use

set_force(force=False)[source]

Set the force parameter

set_ips(ips)[source]

Set the cluster IP addresses

set_overrides(overrides=None)[source]

Set the overrides for deployment

set_playbooks(playbooks=None)[source]

Set the playbooks to deploy

set_project_name(name)[source]

Set the project name

set_repo(repo)[source]

Set the repository to get the stack from

set_update(update=False)[source]

Set the update parameter

set_user_name(username)[source]

Set the cluster login user name

use_bds()[source]

Use the BigDataStack backend

exception cloudmesh_client.cloud.stack.SanityCheckError(message, reason)[source]

Bases: exceptions.Exception

class cloudmesh_client.cloud.stack.SanityChecker[source]

Bases: object

check_github()[source]

Ensure that the default ssh key has been uploaded to github.com

Returns:None
Raises:SanityCheckError on failure
check_program(program)[source]

Verify that the named program is available and executable by the user.

Parameters:program – commands that must be present by checking in the PATH
Returns:None
Raises:SanityCheckError on failure
check_sshkey()[source]

Ensure that the default ssh key exists with correct permissions

Returns:None
Raises:SanityCheckError
cloudmesh_client.cloud.stack.get_virtualenv_environment(venvpath)[source]

Figures out the environment variables that are set when activating a virtualenv

Example: >>> os.system(‘virtualenv /tmp/venv’) >>> get_virtualenv_environment(‘/tmp/venv’)

Parameters:venvpath – path to the virtual environment
Returns:dictionary of environment variables
Return type:dict
cloudmesh_client.cloud.stack.sanity_check()[source]

Verifies that the environment is set up correctly for BDS usage:

Returns:boolean indicating pass or fail of the sanity check
Return type:bool

cloudmesh_client.cloud.sync module

class cloudmesh_client.cloud.sync.Sync[source]

Bases: object

classmethod get_host(cloudname)[source]

Method to get host for cloud from the cloudmesh.yaml file :param cloudname: :return:

classmethod get_hostname(host)[source]

Method to return hostname for a host in ssh config :param host: :return:

classmethod get_hostuser(host)[source]

Method to return user login for a host in ssh config :param host: :return:

classmethod operating_system()[source]
classmethod sync(cloudname, localdir, remotedir, operation=None)[source]

Syncs a local directory with a remote directory. Either from local to remote OR vice-versa :param cloudname: :param localdir: :param remotedir: :param operation: get/put :return:

cloudmesh_client.cloud.usage module

class cloudmesh_client.cloud.usage.Usage[source]

Bases: cloudmesh_client.cloud.ListResource.ListResource

classmethod list(cloud, start=None, end=None, tenant=None, format='table')[source]

cloudmesh_client.cloud.vc module

class cloudmesh_client.cloud.vc.Vc[source]

Bases: cloudmesh_client.cloud.ListResource.ListResource

cm = <cloudmesh_client.db.CloudmeshDatabase.CloudmeshDatabase object>

vc key list NAMES [–usort]

classmethod list(names, usort=False, format='table')[source]

This method lists all vcs of the cloud :param cloud: the cloud name

cloudmesh_client.cloud.vm module

class cloudmesh_client.cloud.vm.Vm[source]

Bases: cloudmesh_client.cloud.ListResource.ListResource

classmethod boot(**kwargs)[source]
classmethod clear(**kwargs)[source]
cm = <cloudmesh_client.db.CloudmeshDatabase.CloudmeshDatabase object>
classmethod construct_ip_dict(ip_addr, name=None)[source]
classmethod delete(**kwargs)[source]
classmethod generate_vm_name(prefix=None, fill=3)[source]
classmethod get(key, category=None)[source]

returns the value of the first objects matching the key with the given category.

Parameters:
  • key – The dictionary key
  • category – The category
Returns:

classmethod get_login_user(name, cloud)[source]
classmethod get_vm(name)[source]
classmethod get_vm_public_ip(vm_name, cloud)[source]
Parameters:
  • vm_name – Name of the VM instance whose Public IP has to be retrieved from the DB
  • cloud – Libcloud supported Cloud provider name
Returns:

Public IP as a list

classmethod get_vms_by_group(name)[source]
classmethod get_vms_by_name(name, cloud)[source]
classmethod info(**kwargs)[source]
classmethod isUuid(name)[source]
classmethod list(**kwargs)[source]

This method lists all VMs of the cloud

classmethod refresh(**kwargs)[source]
classmethod rename(**kwargs)[source]
classmethod set_login_user(name=None, cloud=None, username=None)[source]
classmethod start(**kwargs)[source]
classmethod status_from_cloud(**kwargs)[source]
classmethod stop(**kwargs)[source]
classmethod uuid(name, category=None)[source]

cloudmesh_client.cloud.workflow module

class cloudmesh_client.cloud.workflow.Workflow[source]

Bases: cloudmesh_client.cloud.ListResource.ListResource

cm = <cloudmesh_client.db.CloudmeshDatabase.CloudmeshDatabase object>
classmethod delete(cloud, id)[source]
classmethod details(cloud, id, live=False, format='table')[source]
classmethod list(name, live=False, format='table')[source]

This method lists all workflows of the cloud :param cloud: the cloud name

classmethod refresh(cloud)[source]

This method would refresh the workflow list by first clearing the database, then inserting new data :param cloud: the cloud name

classmethod run(cloud, id)[source]
classmethod save(cloud, name, str)[source]

Module contents