Skip to content

Latest commit

 

History

History
209 lines (168 loc) · 4.53 KB

rest.md

File metadata and controls

209 lines (168 loc) · 4.53 KB

Akkeeper REST API

Deploy API

Deploy instances

Command

curl -X POST -H "Content-Type: application/json" -d "@body.json" http://<master_host>:5050/api/v1/deploy

Request body

{
  "name": "pingContainer",
  "quantity": 1
}

Response code

202 - Accepted

Response body

{
  "requestId": "477b324f-f620-45df-a0e6-bf7211d01fd2",
  "containerName": "pingContainer",
  "instanceIds": ["pingContainer-2aa1a500-4c6e-423c-bde1-d22295c7e1b6"]
}

Monitoring API

Retrieve a list of all instances in a cluster

Command

curl -X GET -H "Content-Type: application/json" http://<master_host>:5050/api/v1/instances

Request body

Response code

200 - OK

Response body

{
  "requestId": "1fec516e-aeda-4859-b25c-bd641988c91c",
  "instanceIds": ["pingContainer-2aa1a500-4c6e-423c-bde1-d22295c7e1b6", "pingContainer-2e76ea01-a623-4aea-abfa-cf5e37c6c898"]
}

Get all instances by specific role, container name or status

Command

curl -X GET -H "Content-Type: application/json" http://<master_host>:5050/api/v1/instances?role=ping&containerName=pingContainer&status=up

Request body

Response code

200 - OK

Response body

{
  "requestId": "1fec516e-aeda-4859-b25c-bd641988c91c",
  "instanceIds": ["pingContainer-2aa1a500-4c6e-423c-bde1-d22295c7e1b6", "pingContainer-2e76ea01-a623-4aea-abfa-cf5e37c6c898"]
}

Get a detailed info about the instance

Command

curl -X GET -H "Content-Type: application/json" http://<master_host>:5050/api/v1/instances/pingContainer-2aa1a500-4c6e-423c-bde1-d22295c7e1b6

Request body

Response code

200 - OK

Response body

{
  "requestId": "0f292e02-d12c-4926-82f4-085e4cff8a69",
  "info": {
    "instanceId": "pingContainer-2aa1a500-4c6e-423c-bde1-d22295c7e1b6",
    "containerName": "pingContainer",
    "roles": ["ping"],
    "status": "UP",
    "actors": ["/user/akkeeperInstance/pingService"],
    "address": {
      "protocol": "akka.tcp",
      "system": "AkkeeperSystem",
      "host": "172.17.0.7",
      "port": 44874
    }
  }
}

Instance termination

Command

curl -X DELETE -H "Content-Type: application/json" http://<master_host>:5050/api/v1/instances/pingContainer-2aa1a500-4c6e-423c-bde1-d22295c7e1b6

Request body

Response code

200 - OK

Response body

{
  "requestId": "382f7496-59b8-44fa-b877-35088faa1917",
  "instanceId": "pingContainer-2aa1a500-4c6e-423c-bde1-d22295c7e1b6"
}

Container API

Get a list of available containers

Command

curl -X GET -H "Content-Type: application/json" http://<master_host>:5050/api/v1/containers

Request body

Response code

200 - OK

Response body

{
  "requestId": "5096a7db-3cf9-4696-89e1-e0a143cc4d25",
  "containers": ["pingContainer"]
}

Get a detailed info about container

Command

curl -X GET -H "Content-Type: application/json" http://<master_host>:5050/api/v1/containers/pingContainer

Request body

Response code

200 - OK

Response body

{
  "requestId": "f423e203-936b-45e1-8a21-6b9da7c4f1e3",
  "container": {
    "name": "pingContainer",
    "jvmArgs": ["-Xmx1G"],
    "jvmProperties": {
      "akka.cluster.roles.\"0\"": "ping",
      "ping-app.response-value": "Akkeeper"
    },
    "environment": {

    },
    "actors": [{
      "name": "pingService",
      "fqn": "akkeeper.examples.PingActor"
    }],
    "cpus": 1,
    "memory": 1024
  }
}

Master API

Terminate master

Command

curl -X POST http://<master_host>:5050/api/v1/master/terminate

Request body

Response code

202 - Accepted

Response body