salt.cloud.clouds.joyent

Joyent Cloud Module

The Joyent Cloud module is used to interact with the Joyent cloud system.

Set up the cloud configuration at /etc/salt/cloud.providers or /etc/salt/cloud.providers.d/joyent.conf:

my-joyent-config:
  # The Joyent login user
  user: fred
  # The Joyent user's password
  password: saltybacon
  # The location of the ssh private key that can log into the new VM
  private_key: /root/joyent.pem
  provider: joyent

When creating your profiles for the joyent cloud, add the location attribute to the profile, this will automatically get picked up when performing tasks associated with that vm. An example profile might look like:

joyent_512:
  provider: my-joyent-config
  size: Extra Small 512 MB
  image: centos-6
  location: us-east-1
depends:requests
salt.cloud.clouds.joyent.avail_images(call=None)

get list of available images

CLI Example:

salt-cloud --list-images
salt.cloud.clouds.joyent.avail_locations(call=None)

List all available locations

salt.cloud.clouds.joyent.avail_sizes(call=None)

get list of available packages

CLI Example:

salt-cloud --list-sizes
salt.cloud.clouds.joyent.create(vm_)

Create a single VM from a data dict

CLI Example:

salt-cloud -p profile_name vm_name
salt.cloud.clouds.joyent.create_node(**kwargs)

convenience function to make the rest api call for node creation.

salt.cloud.clouds.joyent.delete_key(kwargs=None, call=None)

List the keys available

CLI Example:

salt-cloud -f delete_key joyent keyname=mykey
salt.cloud.clouds.joyent.destroy(name, call=None)

destroy a machine by name

Parameters:
  • name -- name given to the machine
  • call -- call value in this case is 'action'
Returns:

array of booleans , true if successfully stopped and true if successfully removed

CLI Example:

salt-cloud -d vm_name
salt.cloud.clouds.joyent.get_configured_provider()

Return the first configured instance.

salt.cloud.clouds.joyent.get_image(vm_)

Return the image object to use

salt.cloud.clouds.joyent.get_location(vm_=None)
Return the joyent data center to use, in this order:
  • CLI parameter
  • VM parameter
  • Cloud profile setting
salt.cloud.clouds.joyent.get_location_path(location='us-east-1')

create url from location variable :param location: joyent data center location :return: url

salt.cloud.clouds.joyent.get_node(name)

gets the node from the full node list by name :param name: name of the vm :return: node object

salt.cloud.clouds.joyent.get_size(vm_)

Return the VM's size object

salt.cloud.clouds.joyent.has_method(obj, method_name)

Find if the provided object has a specific method

salt.cloud.clouds.joyent.import_key(kwargs=None, call=None)

List the keys available

CLI Example:

salt-cloud -f import_key joyent keyname=mykey keyfile=/tmp/mykey.pub
salt.cloud.clouds.joyent.joyent_node_state(id_)

Convert joyent returned state to state common to other data center return values for consistency

Parameters:id -- joyent state value
Returns:libcloudfuncs state value
salt.cloud.clouds.joyent.key_list(key='name', items=None)

convert list to dictionary using the key as the identifier :param key: identifier - must exist in the arrays elements own dictionary :param items: array to iterate over :return: dictionary

salt.cloud.clouds.joyent.list_keys(kwargs=None, call=None)

List the keys available

salt.cloud.clouds.joyent.list_nodes(full=False, call=None)

list of nodes, keeping only a brief listing

CLI Example:

salt-cloud -Q
salt.cloud.clouds.joyent.list_nodes_full(call=None)

list of nodes, maintaining all content provided from joyent listings

CLI Example:

salt-cloud -F
salt.cloud.clouds.joyent.list_nodes_select(call=None)

Return a list of the VMs that are on the provider, with select fields

salt.cloud.clouds.joyent.query(action=None, command=None, args=None, method='GET', location=None, data=None)

Make a web call to Joyent

salt.cloud.clouds.joyent.reboot(name, call=None)

reboot a machine by name :param name: name given to the machine :param call: call value in this case is 'action' :return: true if successful

CLI Example:

salt-cloud -a reboot vm_name
salt.cloud.clouds.joyent.reformat_node(item=None, full=False)

Reformat the returned data from joyent, determine public/private IPs and strip out fields if necessary to provide either full or brief content.

Parameters:
  • item -- node dictionary
  • full -- full or brief output
Returns:

dict

salt.cloud.clouds.joyent.show_key(kwargs=None, call=None)

List the keys available

salt.cloud.clouds.joyent.ssh_interface(vm_)

Return the ssh_interface type to connect to. Either 'public_ips' (default) or 'private_ips'.

salt.cloud.clouds.joyent.start(name, call=None)

start a machine by name :param name: name given to the machine :param call: call value in this case is 'action' :return: true if successful

CLI Example:

salt-cloud -a start vm_name
salt.cloud.clouds.joyent.stop(name, call=None)

stop a machine by name :param name: name given to the machine :param call: call value in this case is 'action' :return: true if successful

CLI Example:

salt-cloud -a stop vm_name
salt.cloud.clouds.joyent.take_action(name=None, call=None, command=None, data=None, method='GET', location='us-east-1')

take action call used by start,stop, reboot :param name: name given to the machine :param call: call value in this case is 'action' :command: api path :data: any data to be passed to the api, must be in json format :method: GET,POST,or DELETE :location: data center to execute the command on :return: true if successful