Joyent CloudAPI v0.0.2 CloudAPI View Source

This module is responsible for tying all CloudAPI related functionality together into one context.

Link to this section Summary

Functions

Set tags on the given instance. A pre-existing tag with the same name as one given will be overwritten.

Creates a new NIC on an instance belonging to a given account.

This is a separate rule for password changes, so different policies can be used for an user trying to modify other data, or only their own password.

Creates an independent copy of the source image. The login account must be on the source image ACL to be able to make an image clone.

Create a fabric Network on a VLAN.

Creates a new VLAN on the fabric.

Adds a new firewall rule for the specified account. This rule will be added to all the account's instances where it may be necessary.

Creates an image from a virtual machine.

Uploads a new OpenSSH key to Triton for use in HTTP signing and SSH.

Allows you to provision an instance.

Allows you to take a snapshot of an instance. Once you have one or more snapshots, you can boot the instance from a previous snapshot.

Creates an account policy.

Create an account role.

Creates a new user under an account.

Create a SSH Key for a user.

Create a new volume for the account.

Deletes all metadata keys from this instance.

Deletes all tags from an instance asynchronously.

Delete a fabric Network on a VLAN.

Removes the given firewall rule from all the required instances.

Delete image by id.

Deletes a single SSH key, by name or fingerprint.

Deletes a single metadata key from this instance.

Deletes the specified snapshot of an instance.

Deletes a single tag from this instance asynchronously.

Deletes an account policy.

Delete an account role by name or id.

Remove a user. They will no longer be able to use this API.

Delete a user's SSH Key by its name or fingerprint.

Deletes a volume for the account.

Disables the given firewall rule if it is enabled.

Disable Deletion Protection on an instance. An instance can be destroyed after it is disabled.

Disables the machine's firewall.

Enables the given firewall rule if it is disabled.

Enable Deletion Protection on an instance. An instance can no longer be destroyed until the protection is disabled.

Enables the machine's firewall.

Exports an image to a Manta server.

Retrieves your account details.

Gets your configuration. Mostly docker related.

Gets a fabric Network on a VLAN.

Gets a VLAN on the fabric by its id.

Retrieves an individual firewall rule.

Get an image by its id.

Retrieves the record for an individual key.

Gets the details for an individual instance.

Returns a single metadata entry associated with this instance.

Gets the state of the named snapshot.

Returns the value for a single tag on this instance.

Get a migration status.

Retrieves information about an individual network.

Get a network's IP. On a public network you can only get an IP owned by you. On private network you can get an IP owned by any of the network's shared owners, however the belongs_to_uuid field will be omitted if you do not own the instance the IP is assocaited with.

Gets a specific NIC on an instance belonging to a given account.

Gets a package by id or name.

Get an account policy by its id.

Get an account role by id or name.

Get one user for an account.

Get a user's SSH Key by its name or fingerprint.

Retrieves information about a single volume.

This will copy the image with the given id from the source datacenter into this datacenter. The copied image will retain all fields as the original image. All incremental images in the origin chain will also be copied.

Lists all available Datacenters and their endpoints.

Lists all of the networks in a fabric on the VLAN specified by VLAN ID.

CloudAPI provides a way to create and manipulate a fabric. On the fabric you can create VLANs, and then under that create layer three networks.

List all firewall rules for the current account.

Lists all instances a firewall rule is applied to, in the same format as list_machines.

Lists all available images.

Lists all public keys we have on record for the specified account.

This has exactly the same input and output format as list_firewall_rules, but just for the rules affecting the given machine.

Returns the complete set of metadata associated with this instance.

Lists all snapshots taken for a given instance.

Returns the complete set of tags associated with this instance.

Lists all instances we have on record for your account. If you have a large number of instances, you can filter using the input parameters listed below. Note that deleted instances are returned only if the instance history has not been purged from Triton.

Triton supports incremental offline migrations starting with CloudAPI version 9.6.0.

List a network's IPs. On a public network only IPs owned by the user will be returned. On a private network all IPs that are either reserved or allocated will be returned.

List all the networks which can be used by the given account. If a network was created on a fabric, then additional information will be shown

List all the NICs on an instance belonging to a given account.

Provides a list of packages available in this datacenter.

Lists all account policies.

Returns an array of account roles.

Lists all available services like Manta.

Lists all SSH keys for a user.

Returns a list of an account's user objects.

Returns a list of all volumes for the account.

Provides a list of an instance's accomplished actions. Results are sorted from newest to oldest action.

Migrates a Machine to another server.

Removes a NIC on an instance belonging to a given account.

Fully replace all tags on an instance with the given tags.

Resizing is only supported for containers (instances which are not hardware virtual machines -- they have brand=kvm or brand=bhyve). Hardware virtual machines cannot be resized.

If an instance is in the 'stopped' state, you can choose to start the instance from the referenced snapshot. This is effectively a means to roll back instance state.

Updates your account details.

Updates your account configuration.

Update a fabric Network on a VLAN.

Updates the given rule record and -- depending on rule contents -- adds/removes/updates the rule on all the required instances.

Allows you to update the metadata for a given instance. Note that updating the metadata via CloudAPI will result in the metadata being updated in the running instance.

Updates an account policy.

Updates an account role.

Update a user's modifiable properties.

Update a volume for the account.

Link to this section Functions

Link to this function

add_machine_tags(login \\ "my", id, tags)

View Source
add_machine_tags(String.t(), String.t(), Map.t()) :: Tuple.t()

Set tags on the given instance. A pre-existing tag with the same name as one given will be overwritten.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
  • tags: Map of Key-Value assignment of tags.
Link to this function

add_nic(login \\ "my", machine_id, network_id)

View Source
add_nic(String.t(), String.t(), String.t()) :: Tuple.t()

Creates a new NIC on an instance belonging to a given account.

WARNING: this causes the instance to reboot while adding the NIC.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • machine_id: String that represents the machine id.
  • network_id: String that represents the network id.
Link to this function

change_user_password(login \\ "my", id, password)

View Source
change_user_password(String.t(), String.t(), String.t()) :: Tuple.t()

This is a separate rule for password changes, so different policies can be used for an user trying to modify other data, or only their own password.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: UUID that represents the ID of the User.
  • password: String that represents the new password.
Link to this function

clone_image(login \\ "my", id)

View Source
clone_image(String.t(), String.t()) :: Tuple.t()

Creates an independent copy of the source image. The login account must be on the source image ACL to be able to make an image clone.

The resulting cloned image will have the same properties as the source image, but the cloned image will have a different id, it will be owned by the login account and the image will have an empty ACL.

All incremental images in the image origin chain that are not operator images (i.e. are not owned by admin) will also be cloned, though all cloned incremental images will have state disabled so that they are not visible in the default image listings.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the image id to clone.
Link to this function

create_fabric_network(login \\ "my", vlan_id, network)

View Source
create_fabric_network(String.t(), String.t(), CloudAPI.Network.t()) :: Tuple.t()

Create a fabric Network on a VLAN.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • vlan_id: String that represents the VLAN id.
  • network: %CloudAPI.Network{} with the details you want updated.
Link to this function

create_fabric_vlan(login \\ "my", vlan)

View Source
create_fabric_vlan(String.t(), String.t()) :: Tuple.t()

Creates a new VLAN on the fabric.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the VLAN id.
Link to this function

create_firewall_rule(login \\ "my", fwrule)

View Source
create_firewall_rule(String.t(), CloudAPI.FirewallRule.t()) :: Tuple.t()

Adds a new firewall rule for the specified account. This rule will be added to all the account's instances where it may be necessary.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • fwrule: %CloudAPI.FirewallRule{} with the details you want updated.
Link to this function

create_image_from_machine(login \\ "my", create_image)

View Source
create_image_from_machine(
  String.t(),
  CloudAPI.CloudAPI.CreateImageFromMachine.t()
) :: Tuple.t()

Creates an image from a virtual machine.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • create_image: %CloudAPI.CreateImageFromMachine{} with the details you want updated.
Link to this function

create_key(login \\ "my", key)

View Source
create_key(String.t(), CloudAPI.Key.t()) :: Tuple.t()

Uploads a new OpenSSH key to Triton for use in HTTP signing and SSH.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • account: %CloudAPI.Key{} with the details you want created.
Link to this function

create_machine(login \\ "my", machine)

View Source
create_machine(String.t(), CloudAPI.CreateMachine.t()) :: Tuple.t()

Allows you to provision an instance.

If you do not specify a name, CloudAPI will generate a random one for you. If you have enabled Triton CNS on your account, this name will also be used in DNS to refer to the new instance (and must therefore consist of DNS-safe characters only).

Your instance will initially be not available for login (Triton must provision and boot it); you can poll GetMachine for its status. When the state field is equal to running, you can log in. If the instance is a brand other than kvm or bhyve, you can usually use any of the SSH keys managed under the keys section of CloudAPI to login as any POSIX user on the OS. You can add/remove keys over time, and the instance will automatically work with that set.

If the the instance has a brand kvm or bhyve, and of a UNIX-derived OS (e.g. Linux), you must have keys uploaded before provisioning; that entire set of keys will be written out to /root/.ssh/authorized_keys in the new instance, and you can SSH in using one of those keys. Changing the keys over time under your account will not affect a running hardware virtual machine in any way; those keys are statically written at provisioning-time only, and you will need to manually manage them on the instance itself.

If the image you create an instance from is set to generate passwords for you, the username/password pairs will be returned in the metadata response as a nested object, like so:

"metadata": { "credentials": {

"root": "s8v9kuht5e",
"admin": "mf4bteqhpy"

} } You cannot overwrite the credentials key in CloudAPI.

More generally, the metadata keys can be set either at the time of instance creation, or after the fact. You must either pass in plain-string values, or a JSON-encoded string. On metadata retrieval, you will get a JSON object back.

Networks can be specified using the networks attribute. It is possible to have an instance attached to an internal network, external network or both. If the networks attribute is absent from the input, the instance will be attached to one externally-accessible network (i.e. assigned a public IP), and any one of internal/private networks. If the account owns or has access to multiple private networks, it will be important to include the desired network(s) in the request payload instead of letting the system assign the network automatically.

Be aware that CreateMachine does not return IP addresses or networks. To obtain the IP addresses and networks of a newly-provisioned instance, poll GetMachine until the instance state is running.

Typically, Triton will allocate the new instance somewhere reasonable within the cloud. See affinity rules below for options on controlling server placement of new instances.

When Triton CNS is enabled, the DNS search domain of the new VM will be automatically set to the suffix of the "instance" record that is created for that VM. For example, if the full CNS name of the new VM would be "foo.inst.35ad1ec4-2eab-11e6-ac02-8f56c66976a1.us-west-1.triton.zone", its automatic DNS search path would include "inst.35ad1ec4-2eab-11e6-ac02-8f56c66976a1.us-west-1.triton.zone". This can be changed later within the instance, if desired.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • machine: %CloudAPI.CreateMachine{} with the details you want updated.
Link to this function

create_machine_snapshot(login \\ "my", id, name)

View Source
create_machine_snapshot(String.t(), String.t(), String.t()) :: Tuple.t()

Allows you to take a snapshot of an instance. Once you have one or more snapshots, you can boot the instance from a previous snapshot.

Snapshots are not usable with other instances; they are a point-in-time snapshot of the current instance. Snapshots can also only be taken of instances that are not of brand 'kvm' or 'bhyve'.

Since instance instances use a copy-on-write filesystem, snapshots take up increasing amounts of space as the filesystem changes over time. There is a limit to how much space snapshots are allowed to take. Plan your snapshots accordingly.

You can poll on get_machine_snapshot until the state is created.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
  • name: String that represents the name of the snapshot.
Link to this function

create_policy(login \\ "my", policy)

View Source
create_policy(String.t(), CloudAPI.Policy.t()) :: Tuple.t()

Creates an account policy.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • policy: %CloudAPI.Policy{} with the details you want updated.
Link to this function

create_role(login \\ "my", role)

View Source
create_role(String.t(), CloudAPI.Role.t()) :: Tuple.t()

Create an account role.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • role: %CloudAPI.Role{} with the details you want updated.
Link to this function

create_user(login \\ "my", user)

View Source
create_user(String.t(), CloudAPI.Account.t()) :: Tuple.t()

Creates a new user under an account.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • user: %CloudAPI.Account{} with the details you want created.
Link to this function

create_user_key(login \\ "my", user, key)

View Source
create_user_key(String.t(), String.t(), CloudAPI.Key.t()) :: Tuple.t()

Create a SSH Key for a user.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • user: String that represents the users id or name.
  • key: %CloudAPI.Key{} with the details you want updated.
Link to this function

create_volume(login \\ "my", volume)

View Source
create_volume(String.t(), CloudAPI.Volume.t()) :: Tuple.t()

Create a new volume for the account.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • volume: %CloudAPI.Volume{} with the details you want updated.
Link to this function

delete_all_machine_metadata(login \\ "my", id)

View Source
delete_all_machine_metadata(String.t(), String.t()) :: Tuple.t()

Deletes all metadata keys from this instance.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
Link to this function

delete_all_machine_tags(login \\ "my", id)

View Source
delete_all_machine_tags(String.t(), String.t()) :: Tuple.t()

Deletes all tags from an instance asynchronously.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
Link to this function

delete_fabric_network(login \\ "my", vlan_id, id)

View Source
delete_fabric_network(String.t(), String.t(), String.t()) :: Tuple.t()

Delete a fabric Network on a VLAN.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • vlan_id: String that represents the VLAN id.
  • id: String that represents the Network id.
Link to this function

delete_fabric_vlan(login \\ "my", id)

View Source
delete_fabric_vlan(String.t(), String.t()) :: Tuple.t()

Delete a fabric VLAN.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the VLAN id.
Link to this function

delete_firewall_rule(login \\ "my", id)

View Source
delete_firewall_rule(String.t(), String.t()) :: Tuple.t()

Removes the given firewall rule from all the required instances.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the Firewall Rule.
Link to this function

delete_image(login \\ "my", id)

View Source
delete_image(String.t(), String.t()) :: Tuple.t()

Delete image by id.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String represents the image id.
Link to this function

delete_key(login \\ "my", name_or_fingerprint)

View Source
delete_key(String.t(), String.t()) :: Tuple.t()

Deletes a single SSH key, by name or fingerprint.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • name_or_fingerprint: String that is either the Fingerprint of the SSH Key or it's name as it appears in the Cloud Portal.
Link to this function

delete_machine(login \\ "my", id)

View Source
delete_machine(String.t(), String.t()) :: Tuple.t()

Delete a machine.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine to be deleted.
Link to this function

delete_machine_metadata(login \\ "my", id, key)

View Source
delete_machine_metadata(String.t(), String.t(), String.t()) :: Tuple.t()

Deletes a single metadata key from this instance.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
  • key: String that represents the metadata key.
Link to this function

delete_machine_snapshot(login \\ "my", id, name)

View Source
delete_machine_snapshot(String.t(), String.t(), String.t()) :: Tuple.t()

Deletes the specified snapshot of an instance.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
  • name: String that represents the name of the snapshot.
Link to this function

delete_machine_tag(login \\ "my", id, tag)

View Source
delete_machine_tag(String.t(), String.t(), String.t()) :: Tuple.t()

Deletes a single tag from this instance asynchronously.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
  • tag: String that represents the tag name.
Link to this function

delete_policy(login \\ "my", id)

View Source
delete_policy(String.t(), String.t()) :: Tuple.t()

Deletes an account policy.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the policy id.
Link to this function

delete_role(login \\ "my", id)

View Source
delete_role(String.t(), String.t()) :: Tuple.t()

Delete an account role by name or id.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • role: %CloudAPI.Role{} with the details you want updated.
Link to this function

delete_user(login \\ "my", id)

View Source
delete_user(String.t(), String.t()) :: Tuple.t()

Remove a user. They will no longer be able to use this API.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: UUID that represents the ID of the User.
Link to this function

delete_user_key(login \\ "my", user, name_or_fingerprint)

View Source
delete_user_key(String.t(), String.t(), String.t()) :: Tuple.t()

Delete a user's SSH Key by its name or fingerprint.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • user: String that represents the users id or name.
  • name_or_fingerprint: String that represents the SSH Key's name or fingerprint.
Link to this function

delete_volume(login \\ "my", id)

View Source
delete_volume(String.t(), String.t()) :: Tuple.t()

Deletes a volume for the account.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String represents the volume id.
Link to this function

disable_firewall_rule(login \\ "my", id)

View Source
disable_firewall_rule(String.t(), String.t()) :: Tuple.t()

Disables the given firewall rule if it is enabled.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the Firewall Rule.
Link to this function

disable_machine_deletion_protection(login \\ "my", id)

View Source
disable_machine_deletion_protection(String.t(), String.t()) :: Tuple.t()

Disable Deletion Protection on an instance. An instance can be destroyed after it is disabled.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
Link to this function

disable_machine_firewall(login \\ "my", id)

View Source
disable_machine_firewall(String.t(), String.t()) :: Tuple.t()

Disables the machine's firewall.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
Link to this function

enable_firewall_rule(login \\ "my", id)

View Source
enable_firewall_rule(String.t(), String.t()) :: Tuple.t()

Enables the given firewall rule if it is disabled.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the Firewall Rule.
Link to this function

enable_machine_deletion_protection(login \\ "my", id)

View Source
enable_machine_deletion_protection(String.t(), String.t()) :: Tuple.t()

Enable Deletion Protection on an instance. An instance can no longer be destroyed until the protection is disabled.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
Link to this function

enable_machine_firewall(login \\ "my", id)

View Source
enable_machine_firewall(String.t(), String.t()) :: Tuple.t()

Enables the machine's firewall.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
Link to this function

export_image(login \\ "my", id, manta_path)

View Source
export_image(String.t(), String.t(), String.t()) :: Tuple.t()

Exports an image to a Manta server.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String represents the image id.
  • manta_path: String represents the Manta's URL.
Link to this function

get_account(login \\ "my")

View Source
get_account(String.t()) :: Tuple.t()

Retrieves your account details.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
Link to this function

get_config(login \\ "my")

View Source
get_config(String.t()) :: Tuple.t()

Gets your configuration. Mostly docker related.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
Link to this function

get_fabric_network(login \\ "my", vlan_id, id)

View Source
get_fabric_network(String.t(), String.t(), String.t()) :: Tuple.t()

Gets a fabric Network on a VLAN.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • vlan_id: String that represents the VLAN id.
  • id: String that represents the Network id.
Link to this function

get_fabric_vlan(login \\ "my", id)

View Source
get_fabric_vlan(String.t(), String.t()) :: Tuple.t()

Gets a VLAN on the fabric by its id.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the VLAN id.
Link to this function

get_firewall_rule(login \\ "my", id)

View Source
get_firewall_rule(String.t(), String.t()) :: Tuple.t()

Retrieves an individual firewall rule.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the Firewall Rule id.
Link to this function

get_image(login \\ "my", id)

View Source
get_image(String.t(), String.t()) :: Tuple.t()

Get an image by its id.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String represents the image id.
Link to this function

get_key(login \\ "my", name_or_fingerprint)

View Source
get_key(String.t(), String.t()) :: Tuple.t()

Retrieves the record for an individual key.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • name_or_fingerprint: String that is either the Fingerprint of the SSH Key or it's name as it appears in the Cloud Portal.
Link to this function

get_machine(login \\ "my", id)

View Source
get_machine(String.t(), String.t()) :: Tuple.t()

Gets the details for an individual instance.

Deleted instances are returned only if the instance history has not been purged from Triton.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the machine id.
Link to this function

get_machine_metadata(login \\ "my", id, key)

View Source
get_machine_metadata(String.t(), String.t(), String.t()) :: Tuple.t()

Returns a single metadata entry associated with this instance.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
  • key: String that represents the metadata key.
Link to this function

get_machine_snapshot(login \\ "my", id, name)

View Source
get_machine_snapshot(String.t(), String.t(), String.t()) :: Tuple.t()

Gets the state of the named snapshot.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
  • name: String that represents the name of the snapshot.
Link to this function

get_machine_tag(login \\ "my", id, tag)

View Source
get_machine_tag(String.t(), String.t(), String.t()) :: Tuple.t()

Returns the value for a single tag on this instance.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
  • tag: String that represents the tag name.
Link to this function

get_migration(login \\ "my", id)

View Source
get_migration(String.t(), String.t()) :: Tuple.t()

Get a migration status.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the migration.
Link to this function

get_network(login \\ "my", id)

View Source
get_network(String.t(), String.t()) :: Tuple.t()

Retrieves information about an individual network.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the Network id.
Link to this function

get_network_ip(login \\ "my", id, ip)

View Source

Get a network's IP. On a public network you can only get an IP owned by you. On private network you can get an IP owned by any of the network's shared owners, however the belongs_to_uuid field will be omitted if you do not own the instance the IP is assocaited with.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the Network id.
  • ip: String that represents the IP.
Link to this function

get_nic(login \\ "my", machine_id, mac)

View Source
get_nic(String.t(), String.t(), String.t()) :: Tuple.t()

Gets a specific NIC on an instance belonging to a given account.

NB: the :mac element in the path must have all the colons (':') stripped from it in the request.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • machine_id: String that represents the machine id.
  • mac: String that represents the NIC's MAC Address.
Link to this function

get_package(login \\ "my", id)

View Source
get_package(String.t(), String.t()) :: Tuple.t()

Gets a package by id or name.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the package's id or name.
Link to this function

get_policy(login \\ "my", id)

View Source
get_policy(String.t(), String.t()) :: Tuple.t()

Get an account policy by its id.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the policy id.
Link to this function

get_role(login \\ "my", id)

View Source
get_role(String.t(), String.t()) :: Tuple.t()

Get an account role by id or name.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String represents the role id or name.
Link to this function

get_user(login \\ "my", id)

View Source
get_user(String.t(), String.t()) :: Tuple.t()

Get one user for an account.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: UUID that represents the ID of the User.
Link to this function

get_user_key(login \\ "my", user, name_or_fingerprint)

View Source
get_user_key(String.t(), String.t(), String.t()) :: Tuple.t()

Get a user's SSH Key by its name or fingerprint.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • user: String that represents the users id or name.
  • name_or_fingerprint: String that represents the SSH Key's name or fingerprint.
Link to this function

get_volume(login \\ "my", id)

View Source
get_volume(String.t(), String.t()) :: Tuple.t()

Retrieves information about a single volume.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String represents the volume id.
Link to this function

import_image_from_datacenter(login \\ "my", datacenter, id)

View Source
import_image_from_datacenter(String.t(), String.t(), String.t()) :: Tuple.t()

This will copy the image with the given id from the source datacenter into this datacenter. The copied image will retain all fields as the original image. All incremental images in the origin chain will also be copied.

You can use the list_datacenters Method to get all datacenters and their names.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • datacenter: String that represents the Datacenter.
  • id: String that represents the image id to copy.
Link to this function

list_datacenters()

View Source
list_datacenters() :: Map.t()

Lists all available Datacenters and their endpoints.

Link to this function

list_fabric_networks(login \\ "my", vlan_id)

View Source
list_fabric_networks(String.t(), String.t()) :: Tuple.t()

Lists all of the networks in a fabric on the VLAN specified by VLAN ID.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the VLAN id.
Link to this function

list_fabric_vlans(login \\ "my")

View Source
list_fabric_vlans(String.t()) :: Tuple.t()

CloudAPI provides a way to create and manipulate a fabric. On the fabric you can create VLANs, and then under that create layer three networks.

A fabric is the basis for building your own private networks that cannot be accessed by any other user. It represents the physical infrastructure that makes up a network; however, you don't have to cable or program it. Every account has its own unique fabric in every datacenter.

On a fabric, you can create your own VLANs and layer-three IPv4 networks. You can create any VLAN from 0-4095, and you can create any number of IPv4 networks on top of the VLANs, with all of the traditional IPv4 private addresses spaces -- 10.0.0.0/8, 192.168.0.0/16, and 172.16.0.0/12 -- available for use.

You can create networks on your fabrics to create most network topologies. For example, you could create a single isolated private network that nothing else could reach, or you could create a traditional configuration where you have a database network, a web network, and a load balancer network, each on their own VLAN.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
Link to this function

list_firewall_rules(login \\ "my")

View Source
list_firewall_rules(String.t()) :: Tuple.t()

List all firewall rules for the current account.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
Link to this function

list_firewall_rules_machines(login \\ "my", rule_id)

View Source
list_firewall_rules_machines(String.t(), String.t()) :: Tuple.t()

Lists all instances a firewall rule is applied to, in the same format as list_machines.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • rule_id: String that represents the Firewall Rule id.
Link to this function

list_images(login \\ "my")

View Source
list_images(String.t()) :: Tuple.t()

Lists all available images.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
Link to this function

list_keys(login \\ "my")

View Source
list_keys(String.t()) :: Tuple.t()

Lists all public keys we have on record for the specified account.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
Link to this function

list_machine_firewall_rules(login \\ "my", machine_id)

View Source
list_machine_firewall_rules(String.t(), String.t()) :: Tuple.t()

This has exactly the same input and output format as list_firewall_rules, but just for the rules affecting the given machine.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • machine_id: String that represents the machine id.
Link to this function

list_machine_metadata(login \\ "my", id, credentials \\ false)

View Source
list_machine_metadata(String.t(), String.t(), Boolean.t()) :: Tuple.t()

Returns the complete set of metadata associated with this instance.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
  • credentials: Boolean that represents if the API should return credentials stored in metadata.
Link to this function

list_machine_snapshots(login \\ "my", id)

View Source
list_machine_snapshots(String.t(), String.t()) :: Tuple.t()

Lists all snapshots taken for a given instance.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
Link to this function

list_machine_tags(login \\ "my", id)

View Source
list_machine_tags(String.t(), String.t()) :: Tuple.t()

Returns the complete set of tags associated with this instance.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
Link to this function

list_machines(login \\ "my")

View Source
list_machines(String.t()) :: Tuple.t()

Lists all instances we have on record for your account. If you have a large number of instances, you can filter using the input parameters listed below. Note that deleted instances are returned only if the instance history has not been purged from Triton.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
Link to this function

list_migrations(login \\ "my")

View Source
list_migrations(String.t()) :: Tuple.t()

Triton supports incremental offline migrations starting with CloudAPI version 9.6.0.

It is possible to migrate (move a VM) to another CN using these APIs. See RFD 34 for the background on how and why instance migration works the way it does.

VM migration operates in three distinct phases, the begin phase creates a hidden target placeholder vm for which to migrate into, the sync phase will synchronize the underlying filesystems and the switch phase will shutdown the original source vm, perform a final filesystem synchronization, hide the original source VM and then enable and restart the target VM.

A migration can be set to run all of these phases in one (automatic migration) or these phases can each be run manually (on demand migration).

For any migration action (e.g. begin, sync, switch or abort) you can use the migration watch endpoint to show progress information for the running migration action.

Once the migration switch is complete, if you are happy with the new migrated instance then you should run the finalize action to remove the original source instance. Note that once the finalize action completes successfully, the migration will no longer show up in the migration list.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
Link to this function

list_network_ips(login \\ "my", id)

View Source
list_network_ips(String.t(), String.t()) :: Tuple.t()

List a network's IPs. On a public network only IPs owned by the user will be returned. On a private network all IPs that are either reserved or allocated will be returned.

Note that not every network from ListNetworks will work. Some UUIDs are for pools which are not supported at this time. However, every network UUID from get_machine and get_nic will work, as they are UUIDs for a specific network.

The reserved field determines if the IP can be used automatically when provisioning a new instance. If reserved is set to true, then the IP will not be given out.

The managed field in the IP object tells you if the IP is manged by Triton itself. An example of this is the gateway and broadcast IPs on a network.

If the IP is associated with an instance then owner_uuid will be shown as well, so that on shared private networks it is clear who is using the IP. The belongs_to_uuid field will tell you which instance owns the IP if any, and will only be present if that instance is owned by you.

You can paginate this API by passing in offset and limit. HTTP responses will contain the additional headers x-resource-count and x-query-limit. If x-resource-count is less than x-query-limit, you're done, otherwise call the API again with offset set to offset + limit to fetch additional instances.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the Network id.
Link to this function

list_networks(login \\ "my")

View Source
list_networks(String.t()) :: Tuple.t()

List all the networks which can be used by the given account. If a network was created on a fabric, then additional information will be shown:

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
Link to this function

list_nics(login \\ "my", machine_id)

View Source
list_nics(String.t(), String.t()) :: Tuple.t()

List all the NICs on an instance belonging to a given account.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • machine_id: String that represents the machine id.
Link to this function

list_packages(login \\ "my")

View Source
list_packages(String.t()) :: Tuple.t()

Provides a list of packages available in this datacenter.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
Link to this function

list_policies(login \\ "my")

View Source
list_policies(String.t()) :: Tuple.t()

Lists all account policies.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
Link to this function

list_roles(login \\ "my")

View Source
list_roles(String.t()) :: Tuple.t()

Returns an array of account roles.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
Link to this function

list_services()

View Source
list_services() :: Tuple.t()

Lists all available services like Manta.

Link to this function

list_user_keys(login \\ "my", user)

View Source

Lists all SSH keys for a user.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • user: String that represents the users id or name.
Link to this function

list_users(login \\ "my")

View Source
list_users(String.t()) :: Tuple.t()

Returns a list of an account's user objects.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
Link to this function

list_volumes(login \\ "my")

View Source
list_volumes(String.t()) :: Tuple.t()

Returns a list of all volumes for the account.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
Link to this function

machine_audit(login \\ "my", id)

View Source
machine_audit(String.t(), String.t()) :: Tuple.t()

Provides a list of an instance's accomplished actions. Results are sorted from newest to oldest action.

Note that the complete audit trail is returned only if the instance history and job records have not been purged from Triton.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
Link to this function

migrate(login \\ "my", id, action, affinity \\ [])

View Source
migrate(String.t(), String.t(), String.t(), Array.t()) :: Tuple.t()

Migrates a Machine to another server.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the migration.
  • action: String that represents the action to take, usually begin or watch.
  • affinity: Array that represents the affinity rules. Only applies when actions are begin or automatic.
Link to this function

reboot_machine(login \\ "my", id)

View Source
reboot_machine(String.t(), String.t()) :: Tuple.t()

Reboot a machine.

You can poll with `get_machine' for the current state. ## Parameters - login: String that represents the Cloud Portal Login. Defaults to "my". - id: String that represents the id of the machine.

Link to this function

remove_nic(login \\ "my", machine_id, mac)

View Source
remove_nic(String.t(), String.t(), String.t()) :: Tuple.t()

Removes a NIC on an instance belonging to a given account.

Like AddNic above, the NIC won't be removed from the instance immediately. After the NIC is removed, it will start returning 404 through CloudAPI.

WARNING: this causes the instance to reboot while removing the NIC.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • machine_id: String that represents the machine id.
  • mac: String that represents the NIC's MAC Address.
Link to this function

rename_machine(login \\ "my", id, name)

View Source
rename_machine(String.t(), String.t(), String.t()) :: Tuple.t()

Rename an instance.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
  • name: String that represents the new name of the machine.
Link to this function

replace_machine_tags(login \\ "my", id, tags)

View Source
replace_machine_tags(String.t(), String.t(), Map.t()) :: Tuple.t()

Fully replace all tags on an instance with the given tags.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
  • tags: Map of Key-Value assignment of tags.
Link to this function

resize_machine(login \\ "my", id, package_id)

View Source
resize_machine(String.t(), String.t(), String.t()) :: Tuple.t()

Resizing is only supported for containers (instances which are not hardware virtual machines -- they have brand=kvm or brand=bhyve). Hardware virtual machines cannot be resized.

Resizing is not guaranteed to work, especially when resizing upwards in resources. It is best-effort, and may fail. Resizing downwards will usually succeed.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
  • package_id: String that represents the id of the target package.
Link to this function

start_machine(login \\ "my", id)

View Source
start_machine(String.t(), String.t()) :: Tuple.t()

Start a machine.

You can poll with `get_machine' for the current state. ## Parameters - login: String that represents the Cloud Portal Login. Defaults to "my". - id: String that represents the id of the machine.

Link to this function

start_machine_from_snapshot(login \\ "my", id, name)

View Source
start_machine_from_snapshot(String.t(), String.t(), String.t()) :: Tuple.t()

If an instance is in the 'stopped' state, you can choose to start the instance from the referenced snapshot. This is effectively a means to roll back instance state.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
  • name: String that represents the name of the snapshot.
Link to this function

stop_machine(login \\ "my", id)

View Source
stop_machine(String.t(), String.t()) :: Tuple.t()

Stop a machine.

You can poll with `get_machine' for the current state. ## Parameters - login: String that represents the Cloud Portal Login. Defaults to "my". - id: String that represents the id of the machine.

Link to this function

update_account(login \\ "my", account)

View Source
update_account(String.t(), CloudAPI.Account.t()) :: Tuple.t()
update_account(String.t(), String.t()) :: Tuple.t()

Updates your account details.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • account: %CloudAPI.Account{} with the details you want updated.
Link to this function

update_config(login \\ "my", config)

View Source
update_config(String.t(), CloudAPI.Config.t()) :: Tuple.t()

Updates your account configuration.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • config: %CloudAPI.Config{} with the details you want updated.
Link to this function

update_fabric_network(login \\ "my", vlan_id, network)

View Source
update_fabric_network(String.t(), String.t(), CloudAPI.Network.t()) :: Tuple.t()

Update a fabric Network on a VLAN.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • vlan_id: String that represents the VLAN id.
  • network: %CloudAPI.Network{} with the details you want updated.
Link to this function

update_fabric_vlan(login \\ "my", vlan)

View Source
update_fabric_vlan(String.t(), CloudAPI.VLAN.t()) :: Tuple.t()

Updates a fabric VLAN.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • vlan: %CloudAPI.VLAN{} with the details you want updated.
Link to this function

update_firewall_rule(login \\ "my", fwrule)

View Source
update_firewall_rule(String.t(), CloudAPI.FirewallRule.t()) :: Tuple.t()

Updates the given rule record and -- depending on rule contents -- adds/removes/updates the rule on all the required instances.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • fwrule: %CloudAPI.FirewallRule{} with the details you want updated.
Link to this function

update_image(login \\ "my", image)

View Source
update_image(String.t(), CloudAPI.Image.t()) :: Tuple.t()

Updates an image.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • image: %CloudAPI.Image{} with the details you want updated.
Link to this function

update_machine_metadata(login \\ "my", id, metadata)

View Source
update_machine_metadata(String.t(), String.t(), Map.t()) :: Tuple.t()

Allows you to update the metadata for a given instance. Note that updating the metadata via CloudAPI will result in the metadata being updated in the running instance.

The semantics of this call are subtly different that the AddMachineTags call -- any metadata keys passed in here are created if they do not exist, and overwritten if they do.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • id: String that represents the id of the machine.
  • metadata: Map of Key-Value to store as metadata.
Link to this function

update_policy(login \\ "my", policy)

View Source
update_policy(String.t(), CloudAPI.Policy.t()) :: Tuple.t()

Updates an account policy.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • policy: %CloudAPI.Policy{} with the details you want updated.
Link to this function

update_role(login \\ "my", role)

View Source
update_role(String.t(), CloudAPI.Role.t()) :: Tuple.t()

Updates an account role.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • role: %CloudAPI.Role{} with the details you want updated.
Link to this function

update_user(login \\ "my", user)

View Source
update_user(String.t(), CloudAPI.Account.t()) :: Tuple.t()

Update a user's modifiable properties.

Note: Password changes are not allowed using this endpoint; there is an additional change_user_password Method for password changes so it can be selectively allowed/disallowed for users using policies.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • user: %CloudAPI.Account{} with the details you want created.
Link to this function

update_volume(login \\ "my", volume)

View Source
update_volume(String.t(), CloudAPI.Volume.t()) :: Tuple.t()

Update a volume for the account.

Parameters

  • login: String that represents the Cloud Portal Login. Defaults to "my".
  • volume: %CloudAPI.Volume{} with the details you want updated.