DigitalOcean Connector

DigitalOcean is a cloud infrastructure provider focused on simplifying web infrastructure for software developers DigitalOcean’s servers use only high-performance Solid State Disks. Their speed directly benefits the performance of hosted web sites and applications. All DigitalOcean cloud servers are live and configurable in less than one minute.DigitalOcean’s command center makes configuring cloud servers and development frameworks simple and intuitive.DigitalOcean offers five popular Linux distributions that can be automatically pre-installed upon deployment of a server: Ubuntu, CentOS, Debian, Fedora, and CoreOS. FreeBSD is also supported.

With this document guide you will be able to work with and use a DigitalOcean Connector. While you start configuring the connector, this document will guide you through DigitalOcean Connector request and response parameters.

Design Aspects

Perform all standard application operations like Create, Start and Stop operations available through the DigitalOcean Connector. Some of them are listed below:

  • List
  • Create
  • Start
  • Stop
  • Reboot
  • Reset
  • Details
  • Delete
  • Check action status
  • get region

Also,

The ability to set Connector execution timeouts Synchronous / Asynchronous execution of the Connector

Configuring DigitalOcean Connector

Configuration parameters

ParameterDescriptionrequired
tokenDigitalOcean client tokentrue: config/request

Example

{
  "token" : "b7d03a6947b217efb6f3ec3bd3504582" 
}
 

Actions

list

List all instances of DigitalOcean associated with provided token.

Request parameters

ParameterDescriptionrequired
actionaction to perform: listtrue
tokenDigitalOcean client tokentrue: config/request

Response parameters

ParameterDescriptionrequired
responseResponse Body, list of all instances.true

Example

response = @call.connector("digitalocean_connector_name")
                  .set("action","list")
                  .set("token","b7d03a6947b217efb6f3ec3bd3504582")
                  .sync

ticket_content = response.get("response")  #Response Result, Array of droplets associated with provided token. 

create

Create a droplet on DigitalOcean.

Request parameters

ParameterDescriptionrequired
actionaction to perform: createtrue
tokenDigitalOcean client tokentrue: config/request
nameThe human-readable string you wish to use when displaying the Droplet name.true
regionThe region where DigitalOcean Instance will be created.true
sizeThe size of the DigitalOcean Instancetrue
imageThe image id of the operating system which you want in your DigitalOcean Instancetrue
ssh_keysArray of SSH key that you wants to embed in droplet.false
backups

 

Autometed backup should be enable or not

false
ipv6IPV6 enable or notfalse
user_dataUser data for the dropletfalse
private_networkingPrivate networking enable or notfalse

Response parameters

ParameterDescriptionrequired
responseResponse Body, details related to newly created instancetrue

Example

response = @call.connector("digitalocean_connector_name")
                .set("action","create")
                .set("token","b7d03a6947b217efb6f3ec3bd3504582")
                .set("name","example.com")
                .set("region","nyc3")
                .set("size","512mb")
                .set("image","ubuntu-14-04-x64")
                .set("ssh_keys",null)
                .set("backups",false)
                .set("ipv6",false)
                .set("user_data","")
                .set("private_networking", true)
                .sync

ticket_content = response.get("response")  #Response Result, droplet details. 

start

Start droplet.

Request parameters

ParameterDescriptionrequired
actionaction to perform: starttrue
tokenDigitalOcean client tokentrue: config/request
idUnique identifier of droplettrue

Response parameters

ParameterDescriptionrequired
responseResponse Body, Data related to action status performed on droplet i.e. starttrue

Example

response = @call.connector("digitalocean_connector_name")
                .set("action","start")
                .set("token","b7d03a6947b217efb6f3ec3bd3504582")
                .set("id", 3164450)
                .sync

ticket_content = response.get("response")  #Response Result, Action details. 

stop

Stop droplet.

Request parameters

ParameterDescriptionrequired
actionaction to perform: stoptrue
tokenDigitalOcean client tokentrue: config/request
idUnique identifier of droplettrue

Response parameters

ParameterDescriptionrequired
responseResponse Body, Data related to action status performed on droplet i.e. stoptrue

Example

response = @call.connector("digitalocean_connector_name")
                .set("action","stop")
                .set("token","b7d03a6947b217efb6f3ec3bd3504582")
                .set("id", 3164450)
                .sync

ticket_content = response.get("response")  #Response Result, Action details. 

 reboot

Reboot droplet.

Request parameters

ParameterDescriptionrequired
actionaction to perform: reboottrue
tokenDigitalOcean client tokentrue: config/request
idUnique identifier of droplettrue

Response parameters

ParameterDescriptionrequired
responseResponse Body, Data related to action status performed on droplet i.e. reboottrue

Example

response = @call.connector("digitalocean_connector_name")
                .set("action","reboot")
                .set("token","b7d03a6947b217efb6f3ec3bd3504582")
                .set("id", 3164450)
                .sync

ticket_content = response.get("response")  #Response Result, Action details. 

reset

Reset droplet.

Request parameters

ParameterDescriptionrequired
actionaction to perform: resettrue
tokenDigitalOcean client tokentrue: config/request
idUnique identifier of droplettrue

Response parameters

ParameterDescriptionrequired
responseResponse Body, Data related to action status performed on droplet i.e. resettrue

Example

response = @call.connector("digitalocean_connector_name")
                .set("action","reset")
                .set("token","b7d03a6947b217efb6f3ec3bd3504582")
                .set("id", 3164450)
                .sync

ticket_content = response.get("response")  #Response Result, Action details. 

detail

Show an individual droplet.

Request parameters

ParameterDescriptionrequired
actionaction to perform: detailtrue
tokenDigitalOcean client tokentrue: config/request
idUnique identifier of droplettrue

Response parameters

ParameterDescriptionrequired
responseResponse Body, Data related to droplettrue

Example

response = @call.connector("digitalocean_connector_name")
                .set("action","detail")
                .set("token","b7d03a6947b217efb6f3ec3bd3504582")
                .set("id", 3164450)
                .sync

ticket_content = response.get("response")  #Response Result, Action details. 

delete

Delete a droplet.

Request parameters

ParameterDescriptionrequired
actionaction to perform: deletetrue
tokenDigitalOcean client tokentrue: config/request
idUnique identifier of droplettrue

Response parameters

ParameterDescriptionrequired
responseResponse Body, with action detailtrue

Example

response = @call.connector("digitalocean_connector_name")
                .set("action","delete")
                .set("token","b7d03a6947b217efb6f3ec3bd3504582")
                .set("id", 3164450)
                .sync

ticket_content = response.get("response")  #Response Result, Action details. 

 action-status

retrieve a Droplet action.

Request parameters
ParameterDescriptionrequired
actionaction to perform: action-statustrue
tokenDigitalOcean client tokentrue: config/request
idUnique identifier of droplettrue
action-idUnique identifier for each Droplet action eventtrue
Response parameters
ParameterDescriptionrequired
responseResponse Body, Data related to actiontrue
Example
response = @call.connector("digitalocean_connector_name")
                .set("action","action-status")
                .set("token","b7d03a6947b217efb6f3ec3bd3504582")
                .set("id", 3164450)
                .set("action-id",79986003)
                .sync

ticket_content = response.get("response")  #Response Result, Action details. 

 get-region

List all of the regions that are available.

Request parameters
ParameterDescriptionrequired
actionaction to perform: get-regiontrue
tokenDigitalOcean client tokentrue: config/request
Response parameters
ParameterDescriptionrequired
responseResponse Body, with list of available regionstrue
Example
response = @call.connector("digitalocean_connector_name")
                .set("action","get-region")
                .set("token","b7d03a6947b217efb6f3ec3bd3504582")
                .sync

ticket_content = response.get("response")  #Response Result, Action details. 
 
 

create-volume

create volume on DigitalOcean.

Request parameters

ParameterDescriptionrequired
actionaction to perform: create-volumetrue
tokenDigitalOcean client tokentrue:config/request
nameA human-readable name for the Block Storage volume.true
regionThe region where the Block Storage volume will be created. true
size_gigabytesThe size of the Block Storage volume in GiB (1024^3).true
descriptionAn optional free-form text field to describe a Block Storage volume.false
Response parameters
ParameterDescriptionrequired
responseResponse Body, with details of volumetrue
Example
response = @call.connector("digitalocean_connector_name")
                .set("action","create-volume")
                .set("token","b7d03a6947b217efb6f3ec3bd3504582")
				.set('name', "example")
  				.set('region',"nyc1")
				.set('size_gigabytes',10)	
				.set('description',"Block store for examples")
                .sync

ticket_content = response.get("response")  #Response Result, Action details. 

list-volume

List all of the volumes that are available.

Request parameters
ParameterDescriptionrequired
actionaction to perform: list-volumetrue
tokenDigitalOcean client tokentrue: config/request


Response parameters
ParameterDescriptionrequired
responseResponse Body, with list of available volumestrue
Example
response = @call.connector("digitalocean_connector_name")
                .set("action","list-volume")
                .set("token","b7d03a6947b217efb6f3ec3bd3504582")
                .sync

ticket_content = response.get("response")  #Response Result, Action details. 

detail-volume

Request parameters

ParameterDescriptionrequired
actionaction to perform: detail-volumetrue
tokenDigitalOcean client tokentrue: config/request
idUnique identifier of volumetrue
namename of volume to be fetchtrue(if Id not present)
regionname of region of volumetrue(if Id not present and Region given)


Response parameters

ParameterDescriptionrequired
responseResponse Body, with details of volumetrue
Example
		response=@call.connector("digitalocean_connector_name")
					  .set("token","b7d03a6947b217efb6f3ec3bd3504582")
					  .set('action',"detail-volume")
					  .set('id',"e8596110-8091-11e6-8840-000f53315871")
					  .set('name',"example")
					  .set('region',"nyc1")
					  .sync

ticket_content = response.get("response")  #Response Result, Action details. 

delete-volume

delete a Block Storage volume, destroying all data and removing it from your account.

Request parameters

ParameterDescriptionrequired
actionaction to perform: delete-volumetrue
tokenDigitalOcean client tokentrue: config/request
idUnique identifier of volumetrue
namename of volume to be deletetrue(if Id not given)
regionname of region of volumetrue(if Id not given and Region given)


Response parameters

ParameterDescriptionrequired
responseResponse Body, with the delete operation detailstrue


Example
		response=@call.connector("digitalocean_connector_name")
					  .set("token","b7d03a6947b217efb6f3ec3bd3504582")
					  .set('action',"delete-volume")
					  .set('id',"e8596110-8091-11e6-8840-000f53315871")
					  .set('name',"example")
					  .set('region',"nyc1")
					  .sync

ticket_content = response.get("response")  #Response Result, Action details. 


attach-volume

Attach a Block Storage volume to a Droplet.


Request parameters

ParameterDescriptionrequired
actionaction to perform: attach-volumetrue
tokenDigitalOcean client tokentrue: config/request
volume_idThe unique identifier for the volume which you want to attach to a droplettrue
typeThis must be "attach"true
droplet_idThe unique identifier for the Droplet the volume will be attached true
regionThe slug identifier for the region the volume is located in.true

Response parameters

ParameterDescriptionrequired
responseResponse Body, with the attach operation detailstrue


Example

 

		response=@call.connector("digitalocean_connector_name")
					  .set("token","b7d03a6947b217efb6f3ec3bd3504582")
					  .set('action',"attach-volume")
				      .set('id',"e8596110-8091-11e6-8840-000f53315871")
					  .set('droplet_id',3164450)
					  .set('type',"attch")
					  .set('region',"nyc1")
					  .sync

ticket_content = response.get("response")  #Response Result, Action details. 


detach-volume

Attach a Block Storage volume to a Droplet.

Request parameters

ParameterDescriptionrequired
actionaction to perform: detach-volumetrue
tokenDigitalOcean client tokentrue: config/request
volume_idThe unique identifier for the volume which you want to detach from a droplettrue
typeThis must be "detach"true
droplet_idThe unique identifier for the Droplet the volume will be attached true
regionThe slug identifier for the region the volume is located in.true

Response parameters

ParameterDescriptionrequired
responseResponse Body, with the detach operation detailstrue


Example

 

		response=@call.connector("digitalocean_connector_name")
					  .set("token","b7d03a6947b217efb6f3ec3bd3504582")
					  .set('id',"e8596110-8091-11e6-8840-000f53315871")
					  .set('action',"detach-volume")
					  .set('droplet_id',3164450)
					  .set('type',"detach")
					  .set('region',"nyc1")
					  .sync

ticket_content = response.get("response")  #Response Result, Action details. 


resize-volume

 resize a Block Storage volume.

Request parameters

ParameterDescriptionrequired
actionaction to perform: resize-volumetrue
tokenDigitalOcean client tokentrue: config/request
volume_idThe unique identifier for the volume which you want to resizetrue
typeThis must be "resize"true
regionThe slug identifier for the region the volume is located in.true

Response parameters

ParameterDescriptionrequired
responseResponse Body, with the resize operation detailstrue


Example

 

		response=@call.connector("digitalocean_connector_name")
					  .set("token","b7d03a6947b217efb6f3ec3bd3504582")
				      .set('id',"e8596110-8091-11e6-8840-000f53315871")
					  .set('action',"resize-volume")
					  .set('type',"resize")
					  .set('size_gigabytes',20)
					  .set('region',"nyc1")
					  .sync

ticket_content = response.get("response")  #Response Result, Action details. 


Connector request error handling

Here is how you can handle the connector requests success or failures within your Flintbit. This would help you to take appropriate action if something failed.

if response.exitcode == 0               # 0 is success.
  puts "success"
  # take action in case of success
else                                    # non zero means fail
  puts "fail"
  puts "Reason:" + response.message     # get the reason of failure
  ## Take action in case of failure
end
 

On this page: