Application Processes API Endpoints

Fetch the processes of an application with our API.

Get Processes

To list all processes of an application you can simply send a GET request to the following endpoint.

https://api.nodion.com/v1/applications/:id/processes

Required Headers: Authorization

URL Parameters:

id – The ID of the application.

Example Response:

{
  "processes": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "status": "available",
      "state": "default",
      "name": "Web",
      "slug": "web",
      "image_name": "registry.euc.nodion.net/my-app/web",
      "instance_amount": 2,
      "entrypoint": "web",
      "instance_type_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "instance_type": {
        "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
        "name": "GP-G2-4GB1C",
        "slug": "gp-g2-4gb1c",
        "category": "gp",
        "cpu": 1.0,
        "mem": 4.0,
        "price_month": "16.0",
        "price_second": "0.000006088280061"
      },
      "ports": [
        {
          "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
          "port": 3000,
          "protocol": "http"
        }
      ]
    },
    {
      "id": "d4e5f6a7-b8c9-0123-defa-234567890123",
      "status": "available",
      "state": "default",
      "name": "Worker",
      "slug": "worker",
      "image_name": "registry.euc.nodion.net/my-app/worker",
      "instance_amount": 1,
      "entrypoint": null,
      "instance_type_id": "e5f6a7b8-c9d0-1234-efab-345678901234",
      "instance_type": {
        "id": "e5f6a7b8-c9d0-1234-efab-345678901234",
        "name": "DS-G2-1GB",
        "slug": "ds-g2-1gb",
        "category": "sb",
        "cpu": 0.5,
        "mem": 1.0,
        "price_month": "4.0",
        "price_second": "0.000001522070015"
      },
      "ports": []
    }
  ]
}

Scale a Process

To scale a process up or down send a PATCH request to the following endpoint with the new instance_amount. Pass 0 to stop the process; pass any positive integer to run that many instances. This endpoint only accepts instance_amount; other process attributes (image, command, instance type, ports) must be changed in the dashboard.

https://api.nodion.com/v1/applications/:id/processes/:process_id

Required Headers: Authorization

Required Body Parameters:

instance_amount – New number of instances. Must be >= 0.

Possible Response Codes:

200 – The process was updated and is now scaling to the new instance count.
400instance_amount is missing or invalid.
404 – No process with that id exists on this application.

Example Request Body:

{
  "instance_amount": 3
}

Example Response:

{
  "process": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "status": "available",
    "state": "scaling",
    "name": "Web",
    "slug": "web",
    "image_name": "registry.euc.nodion.net/my-app/web",
    "instance_amount": 3,
    "entrypoint": "web",
    "instance_type_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
    "instance_type": { "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "name": "GP-G2-4GB1C", "slug": "gp-g2-4gb1c", "category": "gp", "cpu": 1.0, "mem": 4.0, "price_month": "16.0", "price_second": "0.000006088280061" },
    "ports": [ { "id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "port": 3000, "protocol": "http" } ]
  }
}