API – Arukas ARUKAS is DOCKER CONTAINER HOSTING Sat, 01 Jul 2017 06:46:02 +0000 en-US hourly 1 https://wordpress.org/?v=4.8.1 Arukas API Reference /en/documents-en/arukas-api-reference-en/ /en/documents-en/arukas-api-reference-en/#respond Thu, 02 Jun 2016 07:57:25 +0000 /?p=706 Continue reading "Arukas API Reference"]]>
  • Overview
  • Authentication
  • Client
  • API Reference
  • Overview

    The Arukas API provides programmable access interface for resources, which extends and combines Arukas application with other services.
    Creating apps, provisioning, and performing other tasks through Arukas API empowers to automate your daily workflow.

    Authentication

    The API keys consist of API token and secret token. You can generate them in Arukas user control panel.
    To follow along with this document smoothly, it would be nice to create ~/.netrc including the lines of code below.

    
    machine app.arukas.io
        login #{ARUKAS_JSON_API_TOKEN}
        password #{ARUKAS_JSON_API_SECRET}
    
    

    Clients

    All Clients are required to request HTTPS connection to app.arukas.io/api specifing the Accept: application/vnd.api+json in Accept header.

    API REFERENCE

    apps

    Stability: beta

    controll an application.

    Attributes

    Name Type Description Example
    data:id uuid unique identifier of an application. "01234567-89ab-cdef-0123-456789abcdef"
    data:attributes:name string name of an application. "arukas-sample"
    data:attributes:image_id uuid unique identifier of a image. "01234567-89ab-cdef-0123-456789abcdef"
    data:attributes:created_at date-time timestamp of created an application. "2015-01-01T12:00:00Z"
    data:attributes:updated_at date-time timestamp of updated status an application. "2015-01-01T12:00:00Z"
    data:relationships:user:data:id uuid unique identifier of a user. "01234567-89ab-cdef-0123-456789abcdef"
    data:relationships:container:data:id uuid unique identifier of a container "01234567-89ab-cdef-0123-456789abcdef"

    list apps

    
    GET /apps
    
    

    Curl Example

    
    $ curl -n https://app.arukas.io/api/apps \
      -H "Content-Type: application/vnd.api+json" \
      -H "Accept: application/vnd.api+json"
    
    

    response Example

    
    HTTP/1.1 200 OK
    
    
    
      {
        "data": [
          {
            "id": "01234567-89ab-cdef-0123-456789abcdef",
            "type": "apps",
            "attributes": {
              "name": "arukas-sample",
              "image_id": "01234567-89ab-cdef-0123-456789abcdef",
              "created_at": "2015-01-01T12:00:00Z",
              "updated_at": "2015-01-01T12:00:00Z"
            },
            "relationships": {
              "user": {
                "data": {
                  "id": "01234567-89ab-cdef-0123-456789abcdef",
                  "type": "users"
                }
              },
              "container": {
                "data": {
                  "id": "01234567-89ab-cdef-0123-456789abcdef",
                  "type": "containers"
                }
              }
            }
          }
        ]
      }
    
    

    inspect apps

    inspect an application.

    
    GET /app/{apps_id}
    
    

    Curl Example

    
    $ curl -n https://app.arukas.io/api/apps/$APPS_ID \
      -H "Content-Type: application/vnd.api+json" \
      -H "Accept: application/vnd.api+json"
    
    

    Response Example

    
    HTTP/1.1 200 OK
    
    
    
      {
        "data": {
          "id": "01234567-89ab-cdef-0123-456789abcdef",
          "type": "apps",
          "attributes": {
            "name": "arukas-sample",
            "image_id": "01234567-89ab-cdef-0123-456789abcdef",
            "created_at": "2015-01-01T12:00:00Z",
            "updated_at": "2015-01-01T12:00:00Z"
          },
          "relationships": {
            "user": {
              "data": {
                "id": "01234567-89ab-cdef-0123-456789abcdef",
                "type": "users"
              }
            },
            "container": {
              "data": {
                "id": "01234567-89ab-cdef-0123-456789abcdef",
                "type": "containers"
              }
            }
          }
        }
      }
    
    

    remove

    remove an application

    
     DELETE /apps/{app_id} 
    
    

    Curl Example

    
    $ curl -n -X DELETE https://app.arukas.io/api/apps/$APP_ID \ 
      -H "Content-Type: application/vnd.api+json" \
      -H "Accept: application/vnd.api+json"
    
    

    Response Example

    
    HTTP/1.1 204 No Content
    
    

    app-sets

    Stability: beta
    create or edit an application.

    Attributes

    Name Type Description Example
    data:attributes:cmd nullable string command to run specified "tail -f /var/log/messages"
    data:attributes:envs/key string name of Environment variable "SAMPLEENVNAME"
    data:attributes:envs/value string value of Environment variable "VALUE"
    data:attributes:image_name string image name to use for the container "nginx:latest"
    data:attributes:instances integer number of instances. Range: 1 <= value <= 10 1
    data:attributes:ports/number integer number of service port Range: 0 <= value <= 65536 80
    data:attributes:ports/protocol string protocol of service port one of:"tcp" or "udp" "tcp"
    data:attributes:name string name of an application. "arukas-sample"
    data:attributes:arukas_domain string endpoint of an application. "arukas-endpoints"

     

     

    create

    
    POST /app-sets
    
    

    Required Parameters

    Name Type Description Example
    data:attributes:image_name string image name to use for the container "nginx:latest"
    data:attributes:instances integer number of instances.
    Range: 1 <= value <= 10
    1
    data:attributes:mem integer number of memory capacity.
    one of:256 or 512
    256
    data:attributes:ports/number integer number of service port
    Range: 0 <= value <= 65536
    80
    data:attributes:ports/protocol string protocol of service port
    one of:"tcp" or"udp"
    "tcp"

    Optional Parameters

    Name Type Description Example
    data:attributes:cmd string command to run specified "tail -f /var/log/messages"
    data:attributes:envs/key string name of Environment variable "SAMPLEENVNAME"
    data:attributes:envs/value string value of Environment variable "VALUE"
    data:attributes:name string name of an application. "arukas-sample"
    data:attributes:arukas_domain string endpoint of an application. "arukas-endpoint"

    Curl Example

    
    $ curl -n -X POST https://app.arukas.io/api/app-sets \
      -d '{
      "data": [
        {
          "type": "containers",
          "attributes": {
            "image_name": "nginx:latest",
            "instances": 1,
            "mem": 256,
            "cmd": "nginx -g \"daemon off;\"",
            "envs": [
              {
                "key": "ENVSAMPLE",
                "value": "VALUE"
              }
            ],
            "ports": [
              {
                "number": 80,
                "protocol": "tcp"
              },
              {
                "number": 443,
                "protocol": "tcp"
              }
            ],
            "arukas_domain": "endpoint-sample"
          }
        },
        {
          "type": "apps",
          "attributes": {
            "name": "app-sample"
          }
        }
      ]
    }' \
      -H "Content-Type: application/vnd.api+json"  \
      -H "Accept: application/vnd.api+json"
    
    

    Response Example

    
    HTTP/1.1 200 OK
    
    
    
    [
        {
          "id": "01234567-89ab-cdef-0123-456789abcdef",
          "type": "apps",
          "attributes": {
            "name": "app-sample",
            "image_id": "456789abcdef-89ab-cdef-0123-01234567",
            "created_at": "2016-05-31T18:06:48.726+09:00",
            "updated_at": "2016-05-31T18:06:48.726+09:00"
          },
          "relationships": {
            "user": {
              "data": {
                "id": "89abcdef4567-81dc-43ba-bb69-fedcba123456789",
                "type": [
                  "users"
                ]
              }
            },
            "container": {
              "data": {
                "id": "456789abcdef-89ab-cdef-0123-01234567",
                "type": [
                  "containers"
                ]
              }
            }
          }
        },
        {
          "id": "68a21307-b8b0-4216-bf47-fe760743720c",
          "type": "containers",
          "attributes": {
            "app_id": "01234567-89ab-cdef-0123-456789abcdef",
            "image_name": "nginx:latest",
            "cmd": "nginx -g \"daemon off;\"",,
            "is_running": false,
            "instances": 1,
            "mem": 512,
            "envs": [
              {
                "key": "ENVSAMPLE",
                "value": "VALUE"
              }
            ],
            "ports": [
              {
                "number": 80,
                "protocol": "tcp"
              },
              {
                "number": 443,
                "protocol": "tcp"
              }
            ],
            "port_mappings": "null",
            "created_at": "2016-05-31T18:06:48.751+09:00",
            "updated_at": "2016-05-31T18:06:48.751+09:00",
            "status_text": "stopped",
            "arukas_domain": "endpoint-sample",
            "end_point": "endpoint-sample.arukascloud.io"
          },
          "relationships": {
            "app": {
              "data": {
                "id": "01234567-89ab-cdef-0123-456789abcdef",
                "type": [
                  "apps"
                ]
              }
            }
          }
        }
    ]
    
    

    containers

    Stability: beta

    Manage containers

    Attributes

    Name Type Description Example
    id uuid unique identifier of a container "01234567-89ab-cdef-0123-456789abcdef"
    attributes:app_id uuid unique identifier of application. "01234567-89ab-cdef-0123-456789abcdef"
    attributes:image_name string image name to use for the container "nginx:latest"
    attributes:cmd nullable string command to run specified "tail -f /var/log/messages"
    attributes:is_running boolean flag of running application. true
    attributes:instances integer number of instances.
    Range: 1 <= value <= 10
    1
    attributes:mem integer number of memory capacity.
    one of:256 or512
    256
    attributes:end_point string url of an application. "arukas-sample.arukas.io"
    attributes:envs/key string name of Environment variable "SAMPLEENVNAME"
    attributes:envs/value string value of Environment variable "VALUE"
    attributes:arukas_domain string name of an endpoint or an application. "endpoint-sample
    attributes:ports/number integer number of service port
    Range: 0 <= value <= 65536
    80
    attributes:ports/protocol string protocol of service port
    one of:"tcp" or"udp"
    "tcp"
    attributes:port_mapping/container_port integer  number of service port on container.
    Range: 0 <= value <= 65536
    "80"
    attributes:port_mapping//service_port integer number of service port to global.
    Range: 0 <= value <= 65536
    32354
    attributes:port_mapping//host string hostname of a container running "seaof-255-255-255-255.jp-tokyo-01.arukascloud.io"
    attributes:status_text string status of an application.
    one of:"running" or"stopping" or"booting" or"interrupted"or "stopped"
    "running"
    attributes:created_at date-time timestamp of created an application. "2015-01-01T12:00:00Z"
    attributes:updated_ad date-time timestamp of updated status an application. "2015-01-01T12:00:00Z"
    relationships:app:data:id uuid unique identifier of application. "01234567-89ab-cdef-0123-456789abcdef"

    list containers

    list containers.

    
    GET /containers
    
    

    Curl Example

    
    $ curl -n https://app.arukas.io/api/containers \
      -H "Content-Type: application/vnd.api+json"  \
      -H "Accept: application/vnd.api+json"
    
    

    Response Example

    
    HTTP/1.1 200 OK
    
    
    
    [
      {
        "id": "01234567-89ab-cdef-0123-456789abcdef",
        "type": "containers",
        "attributes": {
          "app_id": "01234567-89ab-cdef-0123-456789abcdef",
          "image_name": "nginx:latest",
          "cmd": "nginx -g \"daemon off;\"",
          "is_running": true,
          "instances": 1,
          "mem": 256,
          "envs": [
            {
              "key": "SAMPLEENVNAME",
              "value": "VALUE"
            }
          ],
          "ports": [
            {
              "number": 80,
              "protocol": "tcp"
            }
          ],
          "port_mapping": [
            [
              {
                "container_port": 80,
                "service_port": 39323,
                "host": "seaof-255-255-255-255.jp-tokyo-01.arukascloud.io"
              }
            ]
          ],
          "created_at": "2015-01-01T12:00:00Z",
          "updated_ad": "2015-01-01T12:00:00Z",
          "status_text": "running",
          "arukas_domain": "endpoint-sample",
          "end_point": "endpoint-sample.arukas.io"
        },
        "relationships": {
          "app": {
            "data": {
              "id": "01234567-89ab-cdef-0123-456789abcdef",
              "type": "apps"
            }
          }
        }
      }
    ]
    
    

    start containers

    Start an application.

    
    POST /containers/{containers_id}/power
    
    

    Curl Example

    
    $ curl -n -X POST https://app.arukas.io/api/containers/$CONTAINERS_ID/power \
      -H "Content-Type: application/vnd.api+json"  \
      -H "Accept: application/vnd.api+json"
    
    

    Response Example

    
    HTTP/1.1 202 Accepted
    
    

    stop containers

    Stop an application.

    
    DELETE /containers/{containers_id}/power
    
    

    Curl Example

    
    $ curl -n -X DELETE https://app.arukas.io/api/containers/$CONTAINERS_ID/power \
      -H "Content-Type: application/vnd.api+json"  \
      -H "Accept: application/vnd.api+json"
    
    

    Response Example

    
    HTTP/1.1 202 Accepted
    
    

    update containers

    update parameters of a container

    
    PATCH /containers/{containers_id}
    
    

    Optional Parameters

    Name Type Description Example
    data:attributes:image_name string image name to use for the container "nginx:latest"
    data:attributes:cmd nullable string command to run specified "nginx -g \"daemon off;\"",
    data:attributes:instances integer number of instances.  Range: 1 &lt;= value &lt;= 10 1
    data:attributes:mem integer number of memory capacity.  one of:256 or 512 256
    data:attributes:envs/key string name of Environment variable "SAMPLEENVNAME"
    data:attributes:envs/value string value of Environment variable "VALUE"
    data:attributes:ports/number integer number of service port  Range: 0 <= value <= 65536 80
    data:attributes:ports/protocol string protocol of service port  one of:"tcp" or "udp" "tcp"
    data:attributes:arukas_domain string endpoint of an aplications "endpoint-arukas"

    Curl Example

    
    $ curl -n -X PATCH https://app.arukas.io/api/containers/$CONTAINERS_ID \
      -d '{
      "data": {
        "type": "containers",
        "attributes": {
          "image_name": "nginx:latest",
          "cmd": "nginx -g \"daemon off;\"",
          "instances": 1,
          "mem": 256,
          "envs": [
            {
              "key": "SAMPLEENVNAME",
              "value": "VALUE"
            }
          ],
          "ports": [
            {
              "number": 80,
              "protocol": "tcp"
            }
          ],
          "arukas_domain": "endpoint-sample"
        }
      }
    }' \
      -H "Content-Type: application/json" \
      -H "Accept: application/json"
    
    

    Response Example

    
    HTTP/1.1 202 Accepted
    
    
    
    [
      {
        "id": "01234567-89ab-cdef-0123-456789abcdef",
        "type": "containers",
        "attributes": {
          "app_id": "01234567-89ab-cdef-0123-456789abcdef",
          "image_name": "nginx:latest",
          "cmd": "nginx -g \"daemon off;\"",
          "is_running": true,
          "instances": 1,
          "mem": 256,
          "envs": [
            {
              "key": "SAMPLEENVNAME",
              "value": "VALUE"
            }
          ],
          "ports": [
            {
              "number": 80,
              "protocol": "tcp"
            }
          ],
          "port_mapping": [
            [
              {
                "container_port": 80,
                "service_port": 39323,
                "host": "seaof-255-255-255-255.jp-tokyo-01.arukascloud.io"
              }
            ]
          ],
          "created_at": "2015-01-01T12:00:00Z",
          "updated_ad": "2015-01-01T12:00:00Z",
          "status_text": "running",
          "arukas_domain": "endpoint-sample",
          "end_point": "endpoint-sample.arukas.io"
        },
        "relationships": {
          "app": {
            "data": {
              "id": "01234567-89ab-cdef-0123-456789abcdef",
              "type": "apps"
            }
          }
        }
      }
    ]
    
    
    ]]>
    /en/documents-en/arukas-api-reference-en/feed/ 0