Overview
The Arukas API provides programmable access interface for resources, which extends and integrates 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 including a ~/.netrc
line 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 https://app.arukas.io/api
specifying the inAccept: application/vnd.api+json
Accept header.
Resources
Apps
Resource | Description |
---|---|
POST /api/apps | Create an application |
GET /api/apps | List all applications |
GET /api/apps/{APP_ID} | Show an application |
DELETE /api/apps/{APP_ID} | Delete an application |
Services
Resource | Description |
---|---|
GET /api/services | List all Services |
GET /api/services/{SERVICE_ID} | Show a Service |
PATCH /api/services/{SERVICE_ID} | Update a Service |
POST /api/services/{SERVICE_ID}/power | Power on a Service |
DELETE /api/services/{SERVICE_ID}/power | Power off a Service |
API REFERENCE
POST /api/apps
Create an application
Errors
Code | Description |
---|---|
409 | Cannot create application. |
422 | Required Paramters Missing. |
Examples
# Example Request $ curl -n -X POST -H "Content-Type: application/json" https://app.arukas.io/api/apps -d \ '{ "data":{ "type": "apps", "attributes": { "name": "myapp" }, "relationships": { "services": { "data": [ { "lid": "1", "type": "services" } ] } } }, "included": [ { "lid": "1", "type": "services", "attributes": { "command": "", "custom-domain": "", "image": "nginx", "instances": 1, "ports": [ "80/tcp", "443/tcp" ], "environment": [ { "key": "key1", "value": "value2" }, { "key": "key2", "value": "value2" } ], "subdomain": "example" }, "relationships": { "service-plan": { "data": { "type": "service-plans", "id": "jp-tokyo/hobby" } } } } ] }'
# Example Response
{
"data": {
"id": "874f887a-5ff6-4c0e-b526-5704ee963f10",
"type": "apps",
"attributes": {
"name": "myapp",
"created-at": "2019-06-03T08:24:56.848Z",
"updated-at": "2019-06-03T08:24:56.848Z"
},
"relationships": {
"user": {
"data": {
"id": "f5e201a1-32e6-4f3c-ba37-9aa073216bb2",
"type": "users"
}
},
"services": {
"data": [
{
"id": "a99e0913-1fb6-4ce9-b5e3-b9003eb602dd",
"type": "services"
}
]
}
}
},
"included": [
{
"id": "a99e0913-1fb6-4ce9-b5e3-b9003eb602dd",
"type": "services",
"attributes": {
"image": "nginx",
"command": "",
"instances": 1,
"cpus": 0.1,
"memory": null,
"environment": [
{
"key": "key1",
"value": "value2"
},
{
"key": "key2",
"value": "value2"
}
],
"ports": [
"80/tcp",
"443/tcp"
],
"created-at": "2019-06-03T08:24:56.880Z",
"updated-at": "2019-06-03T08:24:56.880Z",
"status": "stopped",
"subdomain": "example",
"endpoint": "example.arukascloud.io",
"custom-domain": "",
"last-instance-failed-at": null,
"last-instance-failed-status": null,
"last-instance-failed-message": null,
"port-mappings": null
},
"relationships": {
"app": {
"data": {
"id": "874f887a-5ff6-4c0e-b526-5704ee963f10",
"type": "apps"
}
},
"service-plan": {
"data": {
"id": "jp-tokyo/hobby",
"type": "service-plans"
}
}
}
},
{
"id": "jp-tokyo/hobby",
"type": "service-plans",
"attributes": {
"code": "jp-tokyo_hobby_v2",
"category": "hobby",
"name": "Hobby",
"region-id": 1,
"version": 2,
"cpus": "1.0",
"memory": 512,
"price": 540,
"created-at": "2019-02-19T00:00:00.000Z",
"updated-at": "2019-02-19T00:00:00.000Z"
},
"relationships": {
"region": {
"data": {
"id": "1",
"type": "regions"
}
},
"feature": {
"data": {
"id": "5",
"type": "features"
}
}
}
}
],
"meta": {},
"links": {}
}
Params
Param name | Description |
---|---|
:data required |
Validations:
|
:data[:id] required |
Application UUID. Total of 36 characters (32 alphanumeric characters and four hyphens). For example: 123e4567-e89b-12d3-a456-426655440000
Validations:
|
:data[:type] required |
Application type: apps
Validations:
|
:data[:attributes] optional , nil allowed |
Validations:
|
:data[:attributes][:name] optional , nil allowed |
Application name
Validations:
|
:data[:attributes][:created-at] optional , nil allowed |
Creation timestamp
Validations:
|
:data[:attributes][:updated-at] optional , nil allowed |
Updated timestamp
Validations:
|
:data[:relationships] optional , nil allowed |
Validations:
|
:data[:relationships][:user] optional , nil allowed |
Validations:
|
:data[:relationships][:user][:data] optional , nil allowed |
Validations:
|
:data[:relationships][:user][:data][:id] optional , nil allowed |
User UUID.
Validations:
|
:data[:relationships][:user][:data][:type] optional , nil allowed |
User type: users
Validations:
|
:data[:relationships][:services] optional , nil allowed |
Validations:
|
:data[:relationships][:services][:data] required |
Validations:
|
:data[:relationships][:services][:data][:id] optional , nil allowed |
Service UUID. Total of 36 characters (32 alphanumeric characters and four hyphens). For example: 123e4567-e89b-12d3-a456-426655440000
Validations:
|
:data[:relationships][:services][:data][:lid] required |
Service temp ID
Validations:
|
:data[:relationships][:services][:data][:type] required |
Service type: services
Validations:
|
:included required |
Validations:
|
:included[:id] optional , nil allowed |
Service UUID
Validations:
|
:included[:lid] required |
Service temp ID
Validations:
|
:included[:type] required |
Service type: services
Validations:
|
:included[:attributes] required |
Validations:
|
:included[:attributes][:app-id] optional , nil allowed |
Application UUID
Validations:
|
:included[:attributes][:image] required |
Docker image name to use for the Application.
Validations:
|
:included[:attributes][:command] optional , nil allowed |
Application to run specified. (maximum is 4096 characters)
Validations:
|
:included[:attributes][:instances] required |
Number (quantity) of Application instances. (Range: 1 <= value <= 10 )
Validations:
|
:included[:attributes][:cpus] optional , nil allowed |
virtual CPU(vCPU) of Applications. (This value is inherited from Service Plan.)
Validations:
|
:included[:attributes][:memory] optional , nil allowed |
Memory size of Application instances. (This value is inherited from Service Plan.)
Validations:
|
:included[:attributes][:environment] optional , nil allowed |
Application environment variables.
Validations:
|
:included[:attributes][:key] optional , nil allowed |
Environment variable key
Validations:
|
:included[:attributes][:value] optional , nil allowed |
Environment variable value
Validations:
|
:included[:attributes][:ports] optional , nil allowed |
Application ports.
Validations:
|
:included[:attributes][:number] optional , nil allowed |
Port Number. (Port Range: 0 <= value <= 65535 )
Validations:
|
:included[:attributes][:protocol] optional , nil allowed |
Port protocol. (Protocol: tcp or udp )
Validations:
|
:included[:attributes][:port-mappings] optional , nil allowed |
Application port mappings.
Validations:
|
:included[:attributes][:container-port] optional , nil allowed |
Port number. (Port Range: 0 <= value <= 65535 )
Validations:
|
:included[:attributes][:host] optional , nil allowed |
Hostname.
Validations:
|
:included[:attributes][:protocol] optional , nil allowed |
Port protocol. (Protocol: tcp or udp )
Validations:
|
:included[:attributes][:service-port] optional , nil allowed |
Port number. (Port Range: 0 <= value <= 65535 )
Validations:
|
:included[:attributes][:created-at] optional , nil allowed |
Created timestamp.
Validations:
|
:included[:attributes][:updated-at] optional , nil allowed |
Updated timestamp.
Validations:
|
:included[:attributes][:status] optional , nil allowed |
Status of Application. Either booting or terminated or running or stopping or stopped or rebooting .
Validations:
|
:included[:attributes][:subdomain] optional , nil allowed |
Subdomain name of Application. subdomain value with a maximum length of 63 characters.
Validations:
|
:included[:attributes][:endpoint] optional , nil allowed |
HTTP/HTTPS Endpoint URL of Application.
Validations:
|
:included[:attributes][:custom-domain] optional , nil allowed |
Custom domain name of Application.
Validations:
|
:included[:attributes][:last-instance-failed-at] optional , nil allowed |
Last instance failed at.
Validations:
|
:included[:attributes][:last-instance-failed-status] optional , nil allowed |
Last instance failed status message.
Validations:
|
:included[:relationships] optional , nil allowed |
Validations:
|
:included[:relationships][:app] optional , nil allowed |
Validations:
|
:included[:relationships][:app][:data] optional , nil allowed |
Validations:
|
:included[:relationships][:app][:data][:id] optional , nil allowed |
Application UUID. Total of 36 characters (32 alphanumeric characters and four hyphens). For example: 123e4567-e89b-12d3-a456-426655440000
Validations:
|
:included[:relationships][:app][:data][:type] optional , nil allowed |
Application type: apps
Validations:
|
:included[:relationships][:service-plan] required |
Validations:
|
:included[:relationships][:service-plan][:data] required |
Validations:
|
:included[:relationships][:service-plan][:data][:id] required |
Service plan ID. Either jp-tokyo/free or jp-tokyo/hobby or jp-tokyo/standard-1 or jp-tokyo/standard-2
Validations:
|
:included[:relationships][:service-plan][:data][:type] required |
Service plan type: service-plans
Validations:
|
GET /api/apps
List all applications
GET /api/apps/{APP_ID}
Show an application
Errors
Code | Description |
---|---|
404 | No such app |
Examples
# Example Request $ curl -n -X GET https://app.arukas.io/api/apps/874f887a-5ff6-4c0e-b526-5704ee963f10
# Example Response
{
"data": {
"id": "874f887a-5ff6-4c0e-b526-5704ee963f10",
"type": "apps",
"attributes": {
"name": "myapp",
"created-at": "2019-06-03T08:24:56.848Z",
"updated-at": "2019-06-03T08:24:56.848Z"
},
"relationships": {
"user": {
"data": {
"id": "f5e201a1-32e6-4f3c-ba37-9aa073216bb2",
"type": "users"
}
},
"services": {
"data": [
{
"id": "a99e0913-1fb6-4ce9-b5e3-b9003eb602dd",
"type": "services"
}
]
}
}
},
"meta": {},
"links": {}
}
Params
Param name | Description |
---|---|
id required |
UUID of Application. Total of 36 characters (32 alphanumeric characters and four hyphens). For example: 123e4567-e89b-12d3-a456-426655440000
Validations:
|
DELETE /api/apps/{APP_ID}
Delete an application
Errors
Code | Description |
---|---|
404 | No such application |
422 | Unprocessable Entity |
Examples
# Example Request $ curl -n -X DELETE https://app.arukas.io/api/apps/a99e0913-1fb6-4ce9-b5e3-b9003eb602dd
# Example Response null
Params
Param name | Description |
---|---|
id required |
Application UUID. Total of 36 characters (32 alphanumeric characters and four hyphens). For example: 123e4567-e89b-12d3-a456-426655440000
Validations:
|
GET /api/services
List all Services
GET /api/services/{SERVICE_ID}
Show a Service
Errors
Code | Description |
---|---|
404 | No such service |
Examples
# Example Request $ curl -n -X GET https://app.arukas.io/api/services/a99e0913-1fb6-4ce9-b5e3-b9003eb602dd
# Example Response
{
"data": {
"id": "a99e0913-1fb6-4ce9-b5e3-b9003eb602dd",
"type": "services",
"attributes": {
"image": "nginx",
"command": "",
"instances": 1,
"cpus": 0.1,
"memory": null,
"environment": [
{
"key": "key1",
"value": "value2"
},
{
"key": "key2",
"value": "value2"
}
],
"ports": [
"80/tcp",
"443/tcp"
],
"created-at": "2019-06-03T08:24:56.880Z",
"updated-at": "2019-06-03T08:28:27.035Z",
"status": "running",
"subdomain": "example",
"endpoint": "example.arukascloud.io",
"custom-domain": "",
"last-instance-failed-at": null,
"last-instance-failed-status": null,
"last-instance-failed-message": null,
"port-mappings": [
[
{
"container-port": 80,
"host": "seaof-163-43-82-148.jp-tokyo-01.arukascloud.io",
"protocol": "tcp",
"service-port": 31528
},
{
"container-port": 443,
"host": "seaof-163-43-82-148.jp-tokyo-01.arukascloud.io",
"protocol": "tcp",
"service-port": 31529
}
]
]
},
"relationships": {
"app": {
"data": {
"id": "874f887a-5ff6-4c0e-b526-5704ee963f10",
"type": "apps"
}
},
"service-plan": {
"data": {
"id": "jp-tokyo/hobby",
"type": "service-plans"
}
}
}
},
"meta": {},
"links": {}
}
Params
Param name | Description |
---|---|
id required |
UUID of Services. Total of 36 characters (32 alphanumeric characters and four hyphens). For example: 123e4567-e89b-12d3-a456-426655440000
Validations:
|
PATCH /api/services/{SERVICE_ID}
Update a Service
Errors
Code | Description |
---|---|
404 | No such service |
422 | Unprocessable Entity |
Examples
# Example Request $ curl -n -X PATCH -H "Content-Type: application/json" https://app.arukas.io/api/services/950f24ba-cc0b-495d-9ed7-16e332649637 -d \ '{ "data": { "id": "950f24ba-cc0b-495d-9ed7-16e332649637", "type": "services", "attributes": { "command": null, "instances": 3, "ports": [ "80/tcp" ] } } }'
# Example Response
{
"data": {
"id": "a99e0913-1fb6-4ce9-b5e3-b9003eb602dd",
"type": "services",
"attributes": {
"image": "nginx",
"command": null,
"instances": 3,
"cpus": 0.1,
"memory": null,
"environment": [
{
"key": "key1",
"value": "value2"
},
{
"key": "key2",
"value": "value2"
}
],
"ports": [
"80/tcp"
],
"created-at": "2019-06-03T08:24:56.880Z",
"updated-at": "2019-06-03T08:36:47.882Z",
"status": "rebooting",
"subdomain": "example-hogehoge",
"endpoint": "example-hogehoge.arukascloud.io",
"custom-domain": "",
"last-instance-failed-at": null,
"last-instance-failed-status": null,
"last-instance-failed-message": null,
"port-mappings": [
[
{
"container-port": 8080,
"host": "seaof-163-43-82-148.jp-tokyo-01.arukascloud.io",
"protocol": "tcp",
"service-port": 31528
}
],
[
{
"container-port": 8080,
"host": "seaof-163-43-82-146.jp-tokyo-01.arukascloud.io",
"protocol": "tcp",
"service-port": 31163
}
],
[
{
"container-port": 8080,
"host": "seaof-163-43-82-143.jp-tokyo-01.arukascloud.io",
"protocol": "tcp",
"service-port": 31784
}
],
[
{
"container-port": 8080,
"host": "seaof-163-43-82-143.jp-tokyo-01.arukascloud.io",
"protocol": "tcp",
"service-port": 31425
}
]
]
},
"relationships": {
"app": {
"data": {
"id": "874f887a-5ff6-4c0e-b526-5704ee963f10",
"type": "apps"
}
},
"service-plan": {
"data": {
"id": "jp-tokyo/hobby",
"type": "service-plans"
}
}
}
},
"meta": {},
"links": {}
}
Params
Param name | Description |
---|---|
:data required |
Validations:
|
:data[:id] optional , nil allowed |
Service ID. Total of 36 characters (32 alphanumeric characters and four hyphens). For example: 123e4567-e89b-12d3-a456-426655440000
Validations:
|
:data[:type] optional , nil allowed |
Service type: services
Validations:
|
:data[:attributes] required |
Validations:
|
:data[:attributes][:app-id] optional , nil allowed |
Application ID. Total of 36 characters (32 alphanumeric characters and four hyphens). For example: 123e4567-e89b-12d3-a456-426655440000
Validations:
|
:data[:attributes][:image] required |
Docker image name to use for the Application.
Validations:
|
:data[:attributes][:command] optional , nil allowed |
Application to run specified. (maximum is 4096 characters)
Validations:
|
:data[:attributes][:instances] required |
Number of Application instances. (Range: 1 <= value <= 10 )
Validations:
|
:data[:attributes][:cpus] optional , nil allowed |
Virtual CPU(vCPU) of Applications. (This value is inherited from Service Plan.)
Validations:
|
:data[:attributes][:memory] optional , nil allowed |
Memory size of Application instances. (This value is inherited from Service Plan.)
Validations:
|
:data[:attributes][:environment] optional , nil allowed |
Application environment variables.
Validations:
|
:data[:attributes][:key] optional |
Environment variable key
Validations:
|
:data[:attributes][:value] optional |
Environment variable value
Validations:
|
:data[:attributes][:ports] optional , nil allowed |
Application ports.
Validations:
|
:data[:attributes][:number] optional |
Port Number. (Port Range: 0 <= value <= 65535 )
Validations:
|
:data[:attributes][:protocol] optional |
Port protocol. (Protocol: tcp or udp )
Validations:
|
:data[:attributes][:port-mappings] optional , nil allowed |
Application port mappings.
Validations:
|
:data[:attributes][:container-port] optional |
Port number. (Port Range: 0 <= value <= 65535 )
Validations:
|
:data[:attributes][:host] optional |
Hostname.
Validations:
|
:data[:attributes][:protocol] optional |
Port protocol. (Protocol: tcp or udp )
Validations:
|
:data[:attributes][:service-port] optional |
Port number. (Port Range: 0 <= value <= 65535 )
Validations:
|
:data[:attributes][:created-at] optional , nil allowed |
Created timestamp.
Validations:
|
:data[:attributes][:updated-at] optional , nil allowed |
Updated timestamp.
Validations:
|
:data[:attributes][:status] optional , nil allowed |
Status of Application. Either booting or terminated or running or stopping or stopped or rebooting .
Validations:
|
:data[:attributes][:subdomain] optional , nil allowed |
Subdomain name of Application. subdomain value with a maximum length of 63 characters.
Validations:
|
:data[:attributes][:endpoint] optional , nil allowed |
HTTP/HTTPS Endpoint URL of Application.
Validations:
|
:data[:attributes][:custom-domain] optional , nil allowed |
Custom domain name of Application.
Validations:
|
:data[:attributes][:last-instance-failed-at] optional , nil allowed |
Last instance failed at.
Validations:
|
:data[:attributes][:last-instance-failed-status] optional , nil allowed |
Last instance failed status message.
Validations:
|
:data[:relationships] optional |
Validations:
|
:data[:relationships][:app] optional |
Validations:
|
:data[:relationships][:app][:data] optional |
Validations:
|
:data[:relationships][:app][:data][:id] optional , nil allowed |
Application ID
Validations:
|
:data[:relationships][:app][:data][:type] optional , nil allowed |
Application type: apps
Validations:
|
:data[:relationships][:service-plan] optional |
Validations:
|
:data[:relationships][:service-plan][:data] optional |
Validations:
|
:data[:relationships][:service-plan][:data][:id] optional , nil allowed |
ServicePlan ID
Validations:
|
:data[:relationships][:service-plan][:data][:type] optional , nil allowed |
ServicePlan type: service-plans
Validations:
|
POST /api/services/{SERVICE_ID}/power
Power on a Service
Errors
Code | Description |
---|---|
403 | You have been not allowed to boot app due to penalty. |
404 | No such service |
409 | The app is not bootable. |
Examples
# Example Request $ curl -n -X POST https://app.arukas.io/api/services/a99e0913-1fb6-4ce9-b5e3-b9003eb602dd/power
# Example Response
{
"data": {
"id": "a99e0913-1fb6-4ce9-b5e3-b9003eb602dd",
"type": "services",
"attributes": {
"image": "nginx",
"command": null,
"instances": 3,
"cpus": 0.1,
"memory": null,
"environment": [
{
"key": "key1",
"value": "value2"
},
{
"key": "key2",
"value": "value2"
}
],
"ports": [
"80/tcp"
],
"created-at": "2019-06-03T08:24:56.880Z",
"updated-at": "2019-06-03T08:39:10.554Z",
"status": "booting",
"subdomain": "example",
"endpoint": "example.arukascloud.io",
"custom-domain": "",
"last-instance-failed-at": null,
"last-instance-failed-status": null,
"last-instance-failed-message": null,
"port-mappings": null
},
"relationships": {
"app": {
"data": {
"id": "874f887a-5ff6-4c0e-b526-5704ee963f10",
"type": "apps"
}
},
"service-plan": {
"data": {
"id": "jp-tokyo/hobby",
"type": "service-plans"
}
}
}
},
"meta": {},
"links": {}
}
Params
Param name | Description |
---|---|
id required |
UUID of Services. Total of 36 characters (32 alphanumeric characters and four hyphens). For example: 123e4567-e89b-12d3-a456-426655440000
Validations:
|
DELETE /api/services/{SERVICE_ID}/power
Power off a Service
Errors
Code | Description |
---|---|
404 | No such service |
Examples
# Example Request $ curl -n -X DELETE https://app.arukas.io/api/services/a99e0913-1fb6-4ce9-b5e3-b9003eb602dd/power
# Example Response null
Params
Param name | Description |
---|---|
id required |
UUID of Services. Total of 36 characters (32 alphanumeric characters and four hyphens). For example: 123e4567-e89b-12d3-a456-426655440000
Validations:
|