salt.cloud.clouds.digital_ocean

DigitalOcean Cloud Module

The DigitalOcean cloud module is used to control access to the DigitalOcean VPS system.

Use of this module requires a requires a personal_access_token, an ssh_key_file, and at least one SSH key name in ssh_key_names. More ssh_key_names can be added by separating each key with a comma. The personal_access_token can be found in the DigitalOcean web interface in the "Apps & API" section. The SSH key name can be found under the "SSH Keys" section.

# Note: This example is for /etc/salt/cloud.providers or any file in the
# /etc/salt/cloud.providers.d/ directory.

my-digital-ocean-config:
  personal_access_token: xxx
  ssh_key_file: /path/to/ssh/key/file
  ssh_key_names: my-key-name,my-key-name-2
  driver: digital_ocean
depends:requests
salt.cloud.clouds.digital_ocean.assign_floating_ip(kwargs=None, call=None)

Assign a floating IP

New in version 2016.3.0.

CLI Examples:

... code-block:: bash

salt-cloud -f assign_floating_ip my-digitalocean-config droplet_id=1234567 floating_ip='45.55.96.47'
salt.cloud.clouds.digital_ocean.avail_images(call=None)

Return a list of the images that are on the provider

salt.cloud.clouds.digital_ocean.avail_locations(call=None)

Return a dict of all available VM locations on the cloud provider with relevant data

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

Return a list of the image sizes that are on the provider

salt.cloud.clouds.digital_ocean.create(vm_)

Create a single VM from a data dict

salt.cloud.clouds.digital_ocean.create_dns_record(hostname, ip_address)
salt.cloud.clouds.digital_ocean.create_floating_ip(kwargs=None, call=None)

Create a new floating IP

New in version 2016.3.0.

CLI Examples:

... code-block:: bash

salt-cloud -f create_floating_ip my-digitalocean-config region='NYC2'

salt-cloud -f create_floating_ip my-digitalocean-config droplet_id='1234567'

salt.cloud.clouds.digital_ocean.create_key(kwargs=None, call=None)

Upload a public key

salt.cloud.clouds.digital_ocean.create_node(args)

Create a node

salt.cloud.clouds.digital_ocean.delete_dns_record(hostname)
salt.cloud.clouds.digital_ocean.delete_floating_ip(kwargs=None, call=None)

Delete a floating IP

New in version 2016.3.0.

CLI Examples:

... code-block:: bash

salt-cloud -f delete_floating_ip my-digitalocean-config floating_ip='45.55.96.47'
salt.cloud.clouds.digital_ocean.destroy(name, call=None)

Destroy a node. Will check termination protection and warn if enabled.

CLI Example:

salt-cloud --destroy mymachine
salt.cloud.clouds.digital_ocean.destroy_dns_records(fqdn)

Deletes DNS records for the given hostname if the domain is managed with DO.

salt.cloud.clouds.digital_ocean.get_configured_provider()

Return the first configured instance.

salt.cloud.clouds.digital_ocean.get_dependencies()

Warn if dependencies aren't met.

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

Return the image object to use

salt.cloud.clouds.digital_ocean.get_keyid(keyname)

Return the ID of the keyname

salt.cloud.clouds.digital_ocean.get_location(vm_)

Return the VM's location

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

Return the VM's size. Used by create_node().

salt.cloud.clouds.digital_ocean.list_floating_ips(call=None)

Return a list of the floating ips that are on the provider

New in version 2016.3.0.

CLI Examples:

... code-block:: bash

salt-cloud -f list_floating_ips my-digitalocean-config
salt.cloud.clouds.digital_ocean.list_keypairs(call=None)

Return a dict of all available VM locations on the cloud provider with relevant data

salt.cloud.clouds.digital_ocean.list_nodes(call=None)

Return a list of the VMs that are on the provider

salt.cloud.clouds.digital_ocean.list_nodes_full(call=None, for_output=True)

Return a list of the VMs that are on the provider

salt.cloud.clouds.digital_ocean.list_nodes_select(call=None)

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

salt.cloud.clouds.digital_ocean.post_dns_record(dns_domain, name, record_type, record_data)

Creates or updates a DNS record for the given name if the domain is managed with DO.

salt.cloud.clouds.digital_ocean.query(method='droplets', droplet_id=None, command=None, args=None, http_method='get')

Make a web call to DigitalOcean

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

Reboot a droplet in DigitalOcean.

New in version 2015.8.8.

name
The name of the droplet to restart.

CLI Example:

salt-cloud -a reboot droplet_name
salt.cloud.clouds.digital_ocean.remove_key(kwargs=None, call=None)

Delete public key

salt.cloud.clouds.digital_ocean.script(vm_)

Return the script deployment object

salt.cloud.clouds.digital_ocean.show_floating_ip(kwargs=None, call=None)

Show the details of a floating IP

New in version 2016.3.0.

CLI Examples:

... code-block:: bash

salt-cloud -f show_floating_ip my-digitalocean-config floating_ip='45.55.96.47'
salt.cloud.clouds.digital_ocean.show_instance(name, call=None)

Show the details from DigitalOcean concerning a droplet

salt.cloud.clouds.digital_ocean.show_keypair(kwargs=None, call=None)

Show the details of an SSH keypair

salt.cloud.clouds.digital_ocean.show_pricing(kwargs=None, call=None)

Show pricing for a particular profile. This is only an estimate, based on unofficial pricing sources.

New in version 2015.8.0.

CLI Examples:

salt-cloud -f show_pricing my-digitalocean-config profile=my-profile
salt.cloud.clouds.digital_ocean.start(name, call=None)

Start a droplet in DigitalOcean.

New in version 2015.8.8.

name
The name of the droplet to start.

CLI Example:

salt-cloud -a start droplet_name
salt.cloud.clouds.digital_ocean.stop(name, call=None)

Stop a droplet in DigitalOcean.

New in version 2015.8.8.

name
The name of the droplet to stop.

CLI Example:

salt-cloud -a stop droplet_name
salt.cloud.clouds.digital_ocean.unassign_floating_ip(kwargs=None, call=None)

Unassign a floating IP

New in version 2016.3.0.

CLI Examples:

... code-block:: bash

salt-cloud -f unassign_floating_ip my-digitalocean-config floating_ip='45.55.96.47'