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
.
Summary↑
action!(droplet_id, action_id) | Like |
action(droplet_id, action_id) | Request the action object associated with the droplet_id and action_id |
actions!(id) | Like |
actions(id) | Request a list of actions associated with the droplet |
backups!(id) | Like |
backups(id) | Request a list of backups associated with the droplet |
change_kernel!(id, value) | Like |
change_kernel(id, value) | Take the action change_kernel on the droplet |
delete!(id) | Like |
delete(id) | Deletes the droplet |
disable_backups!(id) | Like |
disable_backups(id) | Take the action disable_backups on the droplet |
enable_ipv6!(id) | Like |
enable_ipv6(id) | Take the action enable_ipv6 on the droplet |
enable_private_networking!(id) | Like |
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(id) | Request a list of kernels associated with the droplet |
migrate_droplet!(id) | Like |
migrate_droplet(id) | Take the action migrate_droplet on the droplet |
new!(props) | Like |
new(props) | Request a new droplet |
password_reset!(id) | Like |
password_reset(id) | Take the action password_reset on the droplet |
power_cycle!(id) | Like |
power_cycle(id) | Take the action power_cycle on the droplet |
power_off!(id) | Like |
power_off(id) | Take the action power_off on the droplet |
power_on!(id) | Like |
power_on(id) | Take the action power_on on the droplet |
reboot!(id) | Like |
reboot(id) | Take the action reboot on the droplet |
rebuild!(id, value) | Like |
rebuild(id, value) | Take the action rebuild on the droplet |
rename!(id, value) | Like |
rename(id, value) | Take the action rename on the droplet |
resize!(id, value) | Like |
resize(id, value) | Take the action resize on the droplet |
restore!(id, value) | Like |
restore(id, value) | Take the action restore on the droplet |
shutdown!(id) | Like |
shutdown(id) | Take the action shutdown on the droplet |
snapshot!(id, value) | Like |
snapshot(id, value) | Take the action snapshot on the droplet |
snapshots!(id) | Like |
snapshots(id) | Request a list of snapshots associated with the droplet |
upgrades!() | Like |
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 |
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
Request the action object associated with the droplet_id and action_id.
Like action/2
but return only the response body.
Request a list of actions associated with the droplet.
Like actions/1
but returns the response body only.
Request a list of backups associated with the droplet.
Like backups/1
but returns the response body only.
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.
Like change_kernel/2
but returns the response body only.
Deletes the droplet.
Like delete/1
but returns only the respose body.
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.
Like disable_backups
but returns the response body only.
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.
Like enable_ipv6
but returns the response body only.
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.
Like enable_private_networking
but returns the response body only.
Return the value associated with the key.
The arguments are the response from either action/2
or action!/2
and the key of interest.
Request a list of kernels associated with the droplet.
Like kernels/1
but returns the response body only.
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.
Like migrate_droplet
but returns the response body only.
Request a new droplet.
Like new/1
but returns only the response body.
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.
Like password_reset
but returns the response body only.
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.
Like power_cycle
but returns the response body only.
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.
Like power_off
but returns the response body only.
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.
Like power_on
but returns the response body only.
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.
Like reboot
but returns the response body only.
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.
Like rebuild/2
but returns the response body only.
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.
Like rename/2
but returns the response body only.
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.
Like resize/2
but returns the response body only.
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.
Like restore/2
but returns the response body only.
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.
Like shutdown
but returns the response body only.
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.
Like snapshot/2
but returns the response body only.
Request a list of snapshots associated with the droplet.
Like snapshots/1
but returns the response body only.
Request a list of droplet upgrades
Like upgrades/1
but return only the response body.
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.
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}