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
get list of available images
CLI Example:
salt-cloud --list-images
List all available locations
get list of available packages
CLI Example:
salt-cloud --list-sizes
Create a single VM from a data dict
CLI Example:
salt-cloud -p profile_name vm_name
convenience function to make the rest api call for node creation.
List the keys available
CLI Example:
salt-cloud -f delete_key joyent keyname=mykey
destroy a machine by name
Parameters: |
|
---|---|
Returns: | array of booleans , true if successful;ly stopped and true if successfully removed |
CLI Example:
salt-cloud -d vm_name
Return the first configured instance.
Return the image object to use
create url from location variable :param location: joyent datacenter location :return: url
gets the node from the full node list by name :param name: name of the vm :return: node object
Return the VM's size object
Find if the provided object has a specific method
List the keys available
CLI Example:
salt-cloud -f import_key joyent keyname=mykey keyfile=/tmp/mykey.pub
Convert joyent returned state to state common to other datacenter return values for consistency
Parameters: | id -- joyent state value |
---|---|
Returns: | libcloudfuncs state value |
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
List the keys available
list of nodes, keeping only a brief listing
CLI Example:
salt-cloud -Q
list of nodes, maintaining all content provided from joyent listings
CLI Example:
salt-cloud -F
Return a list of the VMs that are on the provider, with select fields
Make a web call to Joyent
Make a web call to Joyent
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
Reformat the returned data from joyent, determine public/private IPs and strip out fields if necessary to provide either full or brief content.
Parameters: |
|
---|---|
Returns: | dict |
List the keys available
Return the ssh_interface type to connect to. Either 'public_ips' (default) or 'private_ips'.
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
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
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: datacenter to execute the command on :return: true if successful
Current Salt release: 2014.1.6
Docs for previous releases on salt.rtfd.org.
salt.cloud.clouds.libcloud_aws