DigOc.Droplet

For each of the actions (power_cycle, reboot, &c.) an action record is returned. When that happens, an async polling loop is created that monitors that record for the status to change from “in-progress.” When it does, a message is posted to the event manager. That message has the payload:

{ :action_finished, droplet_id, action_id, action_record }

Handlers may be attached to the event manager to take appropriate actions upon completion. Note that the EM’s name can be disovered with DigOc.event_manager/0.

Source

Summary

action!(droplet_id, action_id)

Like action/2 but return only the response body

action(droplet_id, action_id)

Request the action object associated with the droplet_id and action_id

actions!(id)

Like actions/1 but returns the response body only

actions(id)

Request a list of actions associated with the droplet

backups!(id)

Like backups/1 but returns the response body only

backups(id)

Request a list of backups associated with the droplet

change_kernel!(id, value)

Like change_kernel/2 but returns the response body only

change_kernel(id, value)

Take the action change_kernel on the droplet

delete!(id)

Like delete/1 but returns only the respose body

delete(id)

Deletes the droplet

disable_backups!(id)

Like disable_backups but returns the response body only

disable_backups(id)

Take the action disable_backups on the droplet

enable_ipv6!(id)

Like enable_ipv6 but returns the response body only

enable_ipv6(id)

Take the action enable_ipv6 on the droplet

enable_private_networking!(id)

Like enable_private_networking but returns the response body only

enable_private_networking(id)

Take the action enable_private_networking on the droplet

feature_from_action(res, key)

Return the value associated with the key

kernels!(id)

Like kernels/1 but returns the response body only

kernels(id)

Request a list of kernels associated with the droplet

migrate_droplet!(id)

Like migrate_droplet but returns the response body only

migrate_droplet(id)

Take the action migrate_droplet on the droplet

new!(props)

Like new/1 but returns only the response body

new(props)

Request a new droplet

password_reset!(id)

Like password_reset but returns the response body only

password_reset(id)

Take the action password_reset on the droplet

power_cycle!(id)

Like power_cycle but returns the response body only

power_cycle(id)

Take the action power_cycle on the droplet

power_off!(id)

Like power_off but returns the response body only

power_off(id)

Take the action power_off on the droplet

power_on!(id)

Like power_on but returns the response body only

power_on(id)

Take the action power_on on the droplet

reboot!(id)

Like reboot but returns the response body only

reboot(id)

Take the action reboot on the droplet

rebuild!(id, value)

Like rebuild/2 but returns the response body only

rebuild(id, value)

Take the action rebuild on the droplet

rename!(id, value)

Like rename/2 but returns the response body only

rename(id, value)

Take the action rename on the droplet

resize!(id, value)

Like resize/2 but returns the response body only

resize(id, value)

Take the action resize on the droplet

restore!(id, value)

Like restore/2 but returns the response body only

restore(id, value)

Take the action restore on the droplet

shutdown!(id)

Like shutdown but returns the response body only

shutdown(id)

Take the action shutdown on the droplet

snapshot!(id, value)

Like snapshot/2 but returns the response body only

snapshot(id, value)

Take the action snapshot on the droplet

snapshots!(id)

Like snapshots/1 but returns the response body only

snapshots(id)

Request a list of snapshots associated with the droplet

upgrades!()

Like upgrades/1 but return only the response body

upgrades()

Request a list of droplet upgrades

wait_for_action(droplet_id, action_id)

Occasionally polls until an action object has a status of something other than “in-progress”. The poll interval is determined by the value returned by DigOc.wait_time/0. When the status changes a notification, described above, is posted to the event manager

wait_for_status(droplet_id, desired_status)

Poll until the status associated with a droplet matches the status provided. When that is achieved, a notification is sent to the event manager with the payload

Functions

action(droplet_id, action_id)

Request the action object associated with the droplet_id and action_id.

Source
action!(droplet_id, action_id)

Like action/2 but return only the response body.

Source
actions(id)

Request a list of actions associated with the droplet.

Source
actions!(id)

Like actions/1 but returns the response body only.

Source
backups(id)

Request a list of backups associated with the droplet.

Source
backups!(id)

Like backups/1 but returns the response body only.

Source
change_kernel(id, value)

Take the action change_kernel on the droplet.

Both the droplet id and the kernel must be provided.

An action object will be returned. When that object no longer has a status of “in-progress” an event will be posted to the event manager.

Source
change_kernel!(id, value)

Like change_kernel/2 but returns the response body only.

Source
delete(id)

Deletes the droplet.

Source
delete!(id)

Like delete/1 but returns only the respose body.

Source
disable_backups(id)

Take the action disable_backups on the droplet.

An action object will be returned. When that object no longer has a status of “in-progress” an event will be posted to the event manager.

Source
disable_backups!(id)

Like disable_backups but returns the response body only.

Source
enable_ipv6(id)

Take the action enable_ipv6 on the droplet.

An action object will be returned. When that object no longer has a status of “in-progress” an event will be posted to the event manager.

Source
enable_ipv6!(id)

Like enable_ipv6 but returns the response body only.

Source
enable_private_networking(id)

Take the action enable_private_networking on the droplet.

An action object will be returned. When that object no longer has a status of “in-progress” an event will be posted to the event manager.

Source
enable_private_networking!(id)

Like enable_private_networking but returns the response body only.

Source
feature_from_action(res, key)

Return the value associated with the key.

The arguments are the response from either action/2 or action!/2 and the key of interest.

Source
kernels(id)

Request a list of kernels associated with the droplet.

Source
kernels!(id)

Like kernels/1 but returns the response body only.

Source
migrate_droplet(id)

Take the action migrate_droplet on the droplet.

An action object will be returned. When that object no longer has a status of “in-progress” an event will be posted to the event manager.

Source
migrate_droplet!(id)

Like migrate_droplet but returns the response body only.

Source
new(props)

Request a new droplet.

Source
new!(props)

Like new/1 but returns only the response body.

Source
password_reset(id)

Take the action password_reset on the droplet.

An action object will be returned. When that object no longer has a status of “in-progress” an event will be posted to the event manager.

Source
password_reset!(id)

Like password_reset but returns the response body only.

Source
power_cycle(id)

Take the action power_cycle on the droplet.

An action object will be returned. When that object no longer has a status of “in-progress” an event will be posted to the event manager.

Source
power_cycle!(id)

Like power_cycle but returns the response body only.

Source
power_off(id)

Take the action power_off on the droplet.

An action object will be returned. When that object no longer has a status of “in-progress” an event will be posted to the event manager.

Source
power_off!(id)

Like power_off but returns the response body only.

Source
power_on(id)

Take the action power_on on the droplet.

An action object will be returned. When that object no longer has a status of “in-progress” an event will be posted to the event manager.

Source
power_on!(id)

Like power_on but returns the response body only.

Source
reboot(id)

Take the action reboot on the droplet.

An action object will be returned. When that object no longer has a status of “in-progress” an event will be posted to the event manager.

Source
reboot!(id)

Like reboot but returns the response body only.

Source
rebuild(id, value)

Take the action rebuild on the droplet.

Both the droplet id and the image must be provided.

An action object will be returned. When that object no longer has a status of “in-progress” an event will be posted to the event manager.

Source
rebuild!(id, value)

Like rebuild/2 but returns the response body only.

Source
rename(id, value)

Take the action rename on the droplet.

Both the droplet id and the name must be provided.

An action object will be returned. When that object no longer has a status of “in-progress” an event will be posted to the event manager.

Source
rename!(id, value)

Like rename/2 but returns the response body only.

Source
resize(id, value)

Take the action resize on the droplet.

Both the droplet id and the size must be provided.

An action object will be returned. When that object no longer has a status of “in-progress” an event will be posted to the event manager.

Source
resize!(id, value)

Like resize/2 but returns the response body only.

Source
restore(id, value)

Take the action restore on the droplet.

Both the droplet id and the image must be provided.

An action object will be returned. When that object no longer has a status of “in-progress” an event will be posted to the event manager.

Source
restore!(id, value)

Like restore/2 but returns the response body only.

Source
shutdown(id)

Take the action shutdown on the droplet.

An action object will be returned. When that object no longer has a status of “in-progress” an event will be posted to the event manager.

Source
shutdown!(id)

Like shutdown but returns the response body only.

Source
snapshot(id, value)

Take the action snapshot on the droplet.

Both the droplet id and the name must be provided.

An action object will be returned. When that object no longer has a status of “in-progress” an event will be posted to the event manager.

Source
snapshot!(id, value)

Like snapshot/2 but returns the response body only.

Source
snapshots(id)

Request a list of snapshots associated with the droplet.

Source
snapshots!(id)

Like snapshots/1 but returns the response body only.

Source
upgrades()

Request a list of droplet upgrades

Source
upgrades!()

Like upgrades/1 but return only the response body.

Source
wait_for_action(droplet_id, action_id)

Occasionally polls until an action object has a status of something other than “in-progress”. The poll interval is determined by the value returned by DigOc.wait_time/0. When the status changes a notification, described above, is posted to the event manager.

Source
wait_for_status(droplet_id, desired_status)

Poll until the status associated with a droplet matches the status provided. When that is achieved, a notification is sent to the event manager with the payload

{:achived_status, droplet_id, desired_status}
Source