Application Resource

Applications are your personal virtual machines with your favored preinstalled software.

List Applications

Returns a list of application resources associated with the currently logged in user.

GET /rest/applications

Response

[
   {
       "id": "43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59",
       "host": "d9tready.com",
       "webAccess": "http://my-plone.d9tready.com",
       "last_oom": "2015-06-09 06:53:40: update-apt-xapi killed",
       "text_status": "up",
       "template": "d9t:trusty",
       "image_url": "http://images.d9tready.com/plone.png",
       "name": "MyPlone",
       "created": "2014-08-29T11:53:54",
       "up": true,
       "_links":
       [
           {
               "href": "https://d9tready.com/rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59",
               "rel": "self"
           },
           {
               "href": "https://d9tready.com/rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/credentials",
               "rel": "credentials"
           },
           {
               "href": "https://d9tready.com/rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/firewall",
               "rel": "firewall"
           },
           {
               "href": "https://d9tready.com/rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/domains",
               "rel": "domains"
           },
           {
               "href": "https://d9tready.com/rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/mailaliases",
               "rel": "mailaliases"
           },
           {
               "href": "https://d9tready.com/rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/logs",
               "rel": "logs"
           },
           {
               "href": "https://d9tready.com/rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/console",
               "rel": "console"
           }
       ]
   },
   ...
]

Attributes

  • id - Unique resources identifier.
  • host - Hostname of the machine where your application is running.
  • webAccess - Direct link to first configured HTTP/HTTPS domain.
  • last_oom - Timestamp of last out of memory event.
  • text_status - Display version of up.
  • template - Name of your applications base.
  • image_url - Link to applications logo image.
  • name - Unique name of resource.
  • created - Creation date of resource.
  • up - Upstate of resource.
  • _links - Link relations.

HTTP Status Codes

Status Code Description
200 OK No error, operation successful
403 FORBIDDEN Authentication failure
503 SERVICE UNAVAILABLE Service not/partially reachable

Retrieve Application

Retrieve a single application resource.

GET /rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59

Response

{
   "id": "43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59",
   "name": "MyPlone",
   "created": "2014-08-29T11:53:54",
   "up": true,
   "domain_suffix": "d9tready.com",
   "sshAccess": "ssh://user@d9tready.com:10023",
   "webAccess": "http://my-plone.d9tready.com",
   "text_status": "up",
   "last_oom": "2015-06-09 06:53:40: update-apt-xapi killed",
   "image_url": "",
   "verificationKey": "d9tready:0a4e9f57d7a8195a7d7c73244ba14040ae2635f1e622",
   "memory_limit": 64,
   "memory_limit_minimum": 64,
   "mem_active_anon_cur": 0,
   "mem_inactive_anon_cur": 0,
   "cost": 2,
   "cost_up": 2,
   "cost_down": 0,
   "cost_memory": 2,
   "cost_hdd": 0,
   "net_tx_cur": 0,
   "net_rx_cur": 0,
   "du_diff_cur": 0,
   "cpu_pct_cur": 0,
   "_links":
   [
       {
           "href": "https://d9tready.com/rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59",
           "rel": "self"
       },
       {
           "href": "https://d9tready.com/rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/credentials",
           "rel": "credentials"
       },
       {
           "href": "https://d9tready.com/rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/firewall",
           "rel": "firewall"
       },
       {
           "href": "https://d9tready.com/rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/domains",
           "rel": "domains"
       },
       {
           "href": "https://d9tready.com/rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/mailaliases",
           "rel": "mailaliases"
       },
       {
           "href": "https://d9tready.com/rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/logs",
           "rel": "logs"
       },
       {
           "href": "https://d9tready.com/rest/applications/43678cada57a6b839653929905ff90129ab78c9e64cb6f5756ccacabc1f34a59/console",
           "rel": "console"
       }
   ]
}

Attributes

  • id - Unique resources identifier.
  • name - Unique name of resource.
  • created - Creation date of resource.
  • up - Upstate of resource.
  • memory_limit_minimum - Minimum of required memory.
  • memory_limit - Assigned memory limit.
  • net_tx_cur - Current network TX traffic in bytes.
  • net_rx_cur - Current network RX traffic in bytes.
  • cost_up - Cost while application in upstate.
  • cost_down - Cost while application in downstate.
  • cost - Current cost of application.
  • cost_memory - Cost of memory. Only while application is in upstate.
  • cost_hdd - Cost of hdd.
  • du_diff_cur - Disk usage.
  • cpu_pct_cur - CPU Usage in %.
  • mem_active_anon_cur - Active memory usage.
  • mem_inactive_anon_cur - Inactive memory usage.
  • domain_suffix - Domain suffix of the machine where your application is running.
  • sshAccess - Direct link to ssh service if available.
  • webAccess - Direct link to first configured HTTP/HTTPS domain.
  • last_oom - Timestamp of last out of memory event.
  • text_status - Display version of up.
  • image_url - Link to applications logo image.
  • verificationKey - Add this as a TXT record to your domain for verification.
  • _links - Link relations.

Link relations

HTTP Status Codes

Status Code Description
200 OK No error, operation successful
403 FORBIDDEN Authentication failure
404 NOT FOUND Resource not found

Create Application

Creates a new application resource.

POST /rest/applications

Payload

{
   "name": "<NAME>",
   "from_template": "<TEMPLATE_ID>",
   "from_application": "<APPLICATION_ID>"
}
  • name - Unique application identifier
  • from_template - Template for application. See Template Version Resource
  • from_application - Create a clone from an exisiting application.

Either specify from_template or from_application.

Response

On successful creation the URL to the new application resource is set in the Location-Header.

HTTP/1.0 201 CREATED
Location: https://d9tready.com/rest/applications/<CONTAINER_ID>

HTTP Status Codes

Status Code Description
201 CREATED Successful creation of resource
400 BAD REQUEST Malformed syntax or bad query
403 FORBIDDEN Authentication failure

Modify Application State

Modifying the state of an application resource. E.g. Upsate, name or memory settings.

PUT /rest/applications/<CONTAINER_ID>

Payload

{
   "up": <true|false>,
   "memory_limit": <MEMORY_LIMIT>,
   "name": "<NAME>"
}
  • up - true: Start container. false: Stop container
  • memory_limit - Assigned memory limit in MiB.
  • name - Change name of application.

HTTP Status Codes

Status Code Description
200 OK No error, operation successful
400 BAD REQUEST Malformed syntax or bad query
403 FORBIDDEN Authentication failure

Delete Application

Permanently delete an application resource.

DELETE /rest/applications/<CONTAINER_ID>

HTTP Status Codes

Status Code Description
204 NO CONTENT Successful deletion of resource
400 BAD REQUEST Malformed syntax or bad query
403 FORBIDDEN Authentication failure