Service Instances

In a site, each service in an application runs in one or more instances. A service instance is the smallest scheduled unit, which means that all containers in a service are always scheduled together.

Retrieve all service instances

Valid when: ../locally-deployed = "true"

SecurityaccessToken
Request
path Parameters
application-name
required
string <name> ^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$

The name of the application.

query Parameters
fields
string

Retrieve only requested fields from the resource

See section fields

site
string

Send the request to the specfifed site

keys
string <enumeration>

Retrieve only the keys for the list

Value: "true"
count
string <enumeration>

Retrieve only the number of elements in the list

Value: "true"
Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

503

Service Unavailable (strongbox sealed)

get/v1/state/applications/{application-name}/service-instances
Response samples
- name: popcorn-systems.myapp.cr-1
  application-version: 2.4.2
  oper-status: running
  ready: true
  host: host-001
  application-network:
    shared-application-network: mynetwork
    ips:
      - 172.19.0.1/16
    dns-records:
      - cr-1.myapp.internal. 15 IN A 172.19.0.1
      - cr.myapp.internal. 15 IN A 172.19.0.1
  gateway-network:
    ips:
      - 172.23.255.2/24
  ingress:
    interface: eth0
    ips:
      - 192.168.100.97
    dns-records:
      - cr-1.myapp.stockholm-sergel.trial.avassa.net. 15 IN A 192.168.100.97
      - cr.myapp.stockholm-sergel.trial.avassa.net. 15 IN A 192.168.100.97
  ephemeral-volumes:
    - name: fast-storage
      size: 1GB
      host-volume: fast-host-storage
  persistent-volumes:
    - name: persistent-storage
      size: 1GB
      host-volume: fast-host-storage
  init-containers:
    - name: setup
      id: 189d9234f12c
      oper-status: completed
      start-time: 2021-02-17T12:08:39.100Z
      current-restarts: 0
      total-restarts: 0
      devices:
        - /dev/rtc0
      gpus:
        - id: GPU-de663f3f-856c-4e48-9269-c2269169bfda
  containers:
    - name: popcorn-systems.myapp.cr-1.mydb
      id: 75be6d60d41f
      oper-status: running
      ready: true
      start-time: 2021-02-17T12:08:39.202Z
      current-restarts: 0
      total-restarts: 0
      probes:
        startup:
          status: success
        readiness:
          status: success
        liveness:
          status: success
      devices:
        - /dev/rtc0
      gpus:
        - id: GPU-de663f3f-856c-4e48-9269-c2269169bfda
  

Retrieve a service instance

Valid when: ../locally-deployed = "true"

SecurityaccessToken
Request
path Parameters
application-name
required
string <name> ^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$

The name of the application.

service-instance-name
required
string

The name of the service instance. This name is on the form <service-name>-<N>, where N is an integer, different for each running replica.

query Parameters
fields
string

Retrieve only requested fields from the resource

See section fields

site
string

Send the request to the specfifed site

Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

503

Service Unavailable (strongbox sealed)

get/v1/state/applications/{application-name}/service-instances/{service-instance-name}
Response samples
name: popcorn-systems.myapp.cr-1
application-version: 2.4.2
oper-status: running
ready: true
host: host-001
application-network:
  shared-application-network: mynetwork
  ips:
    - 172.19.0.1/16
  dns-records:
    - cr-1.myapp.internal. 15 IN A 172.19.0.1
    - cr.myapp.internal. 15 IN A 172.19.0.1
gateway-network:
  ips:
    - 172.23.255.2/24
ingress:
  interface: eth0
  ips:
    - 192.168.100.97
  dns-records:
    - cr-1.myapp.stockholm-sergel.trial.avassa.net. 15 IN A 192.168.100.97
    - cr.myapp.stockholm-sergel.trial.avassa.net. 15 IN A 192.168.100.97
ephemeral-volumes:
  - name: fast-storage
    size: 1GB
    host-volume: fast-host-storage
persistent-volumes:
  - name: persistent-storage
    size: 1GB
    host-volume: fast-host-storage
init-containers:
  - name: setup
    id: 189d9234f12c
    oper-status: completed
    start-time: 2021-02-17T12:08:39.100Z
    current-restarts: 0
    total-restarts: 0
    devices:
      - /dev/rtc0
    gpus:
      - id: GPU-de663f3f-856c-4e48-9269-c2269169bfda
containers:
  - name: popcorn-systems.myapp.cr-1.mydb
    id: 75be6d60d41f
    oper-status: running
    ready: true
    start-time: 2021-02-17T12:08:39.202Z
    current-restarts: 0
    total-restarts: 0
    probes:
      startup:
        status: success
      readiness:
        status: success
      liveness:
        status: success
    devices:
      - /dev/rtc0
    gpus:
      - id: GPU-de663f3f-856c-4e48-9269-c2269169bfda

Invoke the connect operation

Initiate a connection from the service's network namespace using the specified transport protocol to a specified IP and port.

This action upgrades the connection to websocket which allows to pass data to and from the socket.

SecurityaccessToken
Request
path Parameters
application-name
required
string <name> ^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$

The name of the application.

service-instance-name
required
string

The name of the service instance. This name is on the form <service-name>-<N>, where N is an integer, different for each running replica.

query Parameters
fields
string

Retrieve only requested fields from the resource

See section fields

site
string

Send the request to the specfifed site

protocol
required
string <enumeration>
  • tcp
  • udp

Transport protocol to use.

port
required
integer <uint16>

Port to connect to.

ip-address
string <ip-address>
Default: "127.0.0.1"

IP address to connect to.

header Parameters
Connection
required
string
Value: "upgrade"
Upgrade
required
string
Value: "websocket"
Sec-WebSocket-Version
required
integer
Value: 13
Sec-WebSocket-Key
required
string <byte>

base64-encoded randomly selected 16-byte nonce value

Sec-WebSocket-Protocol
Array of strings unique

Comma-separated list of websocket protocols in priority order. Valid protocol values are:

  • v1.connect.supd: protocol uses binary frames
    Websocket frames sent by the server contain raw data from the socket. For protocols that preserve message boundaries, such as UDP, each websocket frame corresponds to a single datagram. For protocols that do not preserve message boundaries, such as TCP, the contents of the frame correspond to arbitrary number of packets in proper sequence.
Responses
101

Switching Protocols

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

409

Conflict

426

Upgrade Required

503

Service Unavailable (strongbox sealed)

get/v1/state/applications/{application-name}/service-instances/{service-instance-name}/connect

Invoke the exec operation in a container

Execute a command inside the container and return its output, similar to docker exec command.

NOTE that there is no way to interrupt a long-running command, similarly to docker exec command behaviour. Closing the connection will only cause the system to interrupt its communication with docker daemon, but the command will continue to run in the container. Therefore it is recommended to make sure that the long-running commands are otherwise restricted (such as by running them with wrapped by timeout command), alternatively manual cleanup should be performed (such as by executing a kill command explicitly).

SecurityaccessToken
Request
path Parameters
application-name
required
string <name> ^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$

The name of the application.

service-instance-name
required
string

The name of the service instance. This name is on the form <service-name>-<N>, where N is an integer, different for each running replica.

container-name
required
string <name> ^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$

name of container

query Parameters
site
string

Send the request to the specfifed site

Request Body schema:
cmd
required
string <non-blank-string>

Command to invoke inside the container.

Responses
204

No Content

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

409

Conflict

503

Service Unavailable (strongbox sealed)

post/v1/state/applications/{application-name}/service-instances/{service-instance-name}/containers/{container-name}/exec
Request samples
cmd: ps auxww

Invoke the exec-interactive operation in a container

Execute a command inside the container and communicate with it, similar to docker exec -it command.

This action upgrades the connection to websocket which allows to pass data to action stdin, resize its tty and get back output via the same connection.

SecurityaccessToken
Request
path Parameters
application-name
required
string <name> ^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$

The name of the application.

service-instance-name
required
string

The name of the service instance. This name is on the form <service-name>-<N>, where N is an integer, different for each running replica.

container-name
required
string <name> ^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$

name of container

query Parameters
fields
string

Retrieve only requested fields from the resource

See section fields

site
string

Send the request to the specfifed site

cmd
required
string <non-blank-string>

Command to invoke inside the container.

tty
boolean
Default: true

When set to true a tty processing will take place, otherwise not.

header Parameters
Connection
required
string
Value: "upgrade"
Upgrade
required
string
Value: "websocket"
Sec-WebSocket-Version
required
integer
Value: 13
Sec-WebSocket-Key
required
string <byte>

base64-encoded randomly selected 16-byte nonce value

Sec-WebSocket-Protocol
Array of strings unique

Comma-separated list of websocket protocols in priority order. Valid protocol values are:

  • v1.exec-interactive.supd: protocol uses binary frames
    Websocket frames sent by the server contain chunks of raw merged standard output and standard error streams.
    Websocket frames sent by the client can be of two types: data frames and control frames. Each data frame consists of a single 0x10 byte followed by a chunk of application's standard input stream. Each control frame consists of a single 0x11 byte followed by a json object containing two keys: h and w, denoting the number of lines and columns in the terminal correspondingly. Such control frame should be sent every time the terminal size changes.
Responses
101

Switching Protocols

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

409

Conflict

426

Upgrade Required

503

Service Unavailable (strongbox sealed)

get/v1/state/applications/{application-name}/service-instances/{service-instance-name}/containers/{container-name}/exec-interactive

Invoke the tcp-connect operation in a container

DEPRECATED - will be removed.

Connect to a port on the containers management IP.

This action upgrades the connection to websocket which allows to pass data to and from the socket.

SecurityaccessToken
Request
path Parameters
application-name
required
string <name> ^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$

The name of the application.

service-instance-name
required
string

The name of the service instance. This name is on the form <service-name>-<N>, where N is an integer, different for each running replica.

container-name
required
string <name> ^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$

name of container

query Parameters
fields
string

Retrieve only requested fields from the resource

See section fields

site
string

Send the request to the specfifed site

port
required
integer <uint16>

Port to connect to.

header Parameters
Connection
required
string
Value: "upgrade"
Upgrade
required
string
Value: "websocket"
Sec-WebSocket-Version
required
integer
Value: 13
Sec-WebSocket-Key
required
string <byte>

base64-encoded randomly selected 16-byte nonce value

Sec-WebSocket-Protocol
Array of strings unique

Comma-separated list of websocket protocols in priority order. Valid protocol values are:

  • v1.tcp-connect.supd: protocol uses binary frames
    Websocket frames sent by the server contain chunks of raw data from the tcp socket.
Responses
101

Switching Protocols

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

409

Conflict

426

Upgrade Required

503

Service Unavailable (strongbox sealed)

get/v1/state/applications/{application-name}/service-instances/{service-instance-name}/containers/{container-name}/tcp-connect

Invoke the exec operation in an init-container

Execute a command inside the container and return its output, similar to docker exec command.

NOTE that there is no way to interrupt a long-running command, similarly to docker exec command behaviour. Closing the connection will only cause the system to interrupt its communication with docker daemon, but the command will continue to run in the container. Therefore it is recommended to make sure that the long-running commands are otherwise restricted (such as by running them with wrapped by timeout command), alternatively manual cleanup should be performed (such as by executing a kill command explicitly).

SecurityaccessToken
Request
path Parameters
application-name
required
string <name> ^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$

The name of the application.

service-instance-name
required
string

The name of the service instance. This name is on the form <service-name>-<N>, where N is an integer, different for each running replica.

init-container-name
required
string <name> ^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$

name of init-container

query Parameters
site
string

Send the request to the specfifed site

Request Body schema:
cmd
required
string <non-blank-string>

Command to invoke inside the container.

Responses
204

No Content

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

409

Conflict

503

Service Unavailable (strongbox sealed)

post/v1/state/applications/{application-name}/service-instances/{service-instance-name}/init-containers/{init-container-name}/exec
Request samples
cmd: ps auxww

Invoke the exec-interactive operation in an init-container

Execute a command inside the container and communicate with it, similar to docker exec -it command.

This action upgrades the connection to websocket which allows to pass data to action stdin, resize its tty and get back output via the same connection.

SecurityaccessToken
Request
path Parameters
application-name
required
string <name> ^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$

The name of the application.

service-instance-name
required
string

The name of the service instance. This name is on the form <service-name>-<N>, where N is an integer, different for each running replica.

init-container-name
required
string <name> ^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$

name of init-container

query Parameters
fields
string

Retrieve only requested fields from the resource

See section fields

site
string

Send the request to the specfifed site

cmd
required
string <non-blank-string>

Command to invoke inside the container.

tty
boolean
Default: true

When set to true a tty processing will take place, otherwise not.

header Parameters
Connection
required
string
Value: "upgrade"
Upgrade
required
string
Value: "websocket"
Sec-WebSocket-Version
required
integer
Value: 13
Sec-WebSocket-Key
required
string <byte>

base64-encoded randomly selected 16-byte nonce value

Sec-WebSocket-Protocol
Array of strings unique

Comma-separated list of websocket protocols in priority order. Valid protocol values are:

  • v1.exec-interactive.supd: protocol uses binary frames
    Websocket frames sent by the server contain chunks of raw merged standard output and standard error streams.
    Websocket frames sent by the client can be of two types: data frames and control frames. Each data frame consists of a single 0x10 byte followed by a chunk of application's standard input stream. Each control frame consists of a single 0x11 byte followed by a json object containing two keys: h and w, denoting the number of lines and columns in the terminal correspondingly. Such control frame should be sent every time the terminal size changes.
Responses
101

Switching Protocols

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

409

Conflict

426

Upgrade Required

503

Service Unavailable (strongbox sealed)

get/v1/state/applications/{application-name}/service-instances/{service-instance-name}/init-containers/{init-container-name}/exec-interactive

Invoke the tcp-connect operation in an init-container

DEPRECATED - will be removed.

Connect to a port on the containers management IP.

This action upgrades the connection to websocket which allows to pass data to and from the socket.

SecurityaccessToken
Request
path Parameters
application-name
required
string <name> ^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$

The name of the application.

service-instance-name
required
string

The name of the service instance. This name is on the form <service-name>-<N>, where N is an integer, different for each running replica.

init-container-name
required
string <name> ^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$

name of init-container

query Parameters
fields
string

Retrieve only requested fields from the resource

See section fields

site
string

Send the request to the specfifed site

port
required
integer <uint16>

Port to connect to.

header Parameters
Connection
required
string
Value: "upgrade"
Upgrade
required
string
Value: "websocket"
Sec-WebSocket-Version
required
integer
Value: 13
Sec-WebSocket-Key
required
string <byte>

base64-encoded randomly selected 16-byte nonce value

Sec-WebSocket-Protocol
Array of strings unique

Comma-separated list of websocket protocols in priority order. Valid protocol values are:

  • v1.tcp-connect.supd: protocol uses binary frames
    Websocket frames sent by the server contain chunks of raw data from the tcp socket.
Responses
101

Switching Protocols

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

409

Conflict

426

Upgrade Required

503

Service Unavailable (strongbox sealed)

get/v1/state/applications/{application-name}/service-instances/{service-instance-name}/init-containers/{init-container-name}/tcp-connect

Invoke the restart operation

Force a restart of the service instance.

SecurityaccessToken
Request
path Parameters
application-name
required
string <name> ^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$

The name of the application.

service-instance-name
required
string

The name of the service instance. This name is on the form <service-name>-<N>, where N is an integer, different for each running replica.

query Parameters
site
string

Send the request to the specfifed site

Request Body schema:
no-delayed-shutdown
boolean

Must have the value true.

Responses
204

No Content

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

409

Conflict

503

Service Unavailable (strongbox sealed)

post/v1/state/applications/{application-name}/service-instances/{service-instance-name}/restart
Request samples
no-delayed-shutdown: true

Invoke the exec operation in a vm container

Execute a command inside the container and return its output, similar to docker exec command.

NOTE that there is no way to interrupt a long-running command, similarly to docker exec command behaviour. Closing the connection will only cause the system to interrupt its communication with docker daemon, but the command will continue to run in the container. Therefore it is recommended to make sure that the long-running commands are otherwise restricted (such as by running them with wrapped by timeout command), alternatively manual cleanup should be performed (such as by executing a kill command explicitly).

SecurityaccessToken
Request
path Parameters
application-name
required
string <name> ^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$

The name of the application.

service-instance-name
required
string

The name of the service instance. This name is on the form <service-name>-<N>, where N is an integer, different for each running replica.

query Parameters
site
string

Send the request to the specfifed site

Request Body schema:
cmd
required
string <non-blank-string>

Command to invoke inside the container.

Responses
204

No Content

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

409

Conflict

503

Service Unavailable (strongbox sealed)

post/v1/state/applications/{application-name}/service-instances/{service-instance-name}/vm-container/exec
Request samples
cmd: ps auxww

Invoke the exec-interactive operation in a vm container

Execute a command inside the container and communicate with it, similar to docker exec -it command.

This action upgrades the connection to websocket which allows to pass data to action stdin, resize its tty and get back output via the same connection.

SecurityaccessToken
Request
path Parameters
application-name
required
string <name> ^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$

The name of the application.

service-instance-name
required
string

The name of the service instance. This name is on the form <service-name>-<N>, where N is an integer, different for each running replica.

query Parameters
fields
string

Retrieve only requested fields from the resource

See section fields

site
string

Send the request to the specfifed site

cmd
required
string <non-blank-string>

Command to invoke inside the container.

tty
boolean
Default: true

When set to true a tty processing will take place, otherwise not.

header Parameters
Connection
required
string
Value: "upgrade"
Upgrade
required
string
Value: "websocket"
Sec-WebSocket-Version
required
integer
Value: 13
Sec-WebSocket-Key
required
string <byte>

base64-encoded randomly selected 16-byte nonce value

Sec-WebSocket-Protocol
Array of strings unique

Comma-separated list of websocket protocols in priority order. Valid protocol values are:

  • v1.exec-interactive.supd: protocol uses binary frames
    Websocket frames sent by the server contain chunks of raw merged standard output and standard error streams.
    Websocket frames sent by the client can be of two types: data frames and control frames. Each data frame consists of a single 0x10 byte followed by a chunk of application's standard input stream. Each control frame consists of a single 0x11 byte followed by a json object containing two keys: h and w, denoting the number of lines and columns in the terminal correspondingly. Such control frame should be sent every time the terminal size changes.
Responses
101

Switching Protocols

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

409

Conflict

426

Upgrade Required

503

Service Unavailable (strongbox sealed)

get/v1/state/applications/{application-name}/service-instances/{service-instance-name}/vm-container/exec-interactive

Invoke the tcp-connect operation in a vm container

DEPRECATED - will be removed.

Connect to a port on the containers management IP.

This action upgrades the connection to websocket which allows to pass data to and from the socket.

SecurityaccessToken
Request
path Parameters
application-name
required
string <name> ^[a-z0-9]([a-z0-9\-]*[a-z0-9])?$

The name of the application.

service-instance-name
required
string

The name of the service instance. This name is on the form <service-name>-<N>, where N is an integer, different for each running replica.

query Parameters
fields
string

Retrieve only requested fields from the resource

See section fields

site
string

Send the request to the specfifed site

port
required
integer <uint16>

Port to connect to.

header Parameters
Connection
required
string
Value: "upgrade"
Upgrade
required
string
Value: "websocket"
Sec-WebSocket-Version
required
integer
Value: 13
Sec-WebSocket-Key
required
string <byte>

base64-encoded randomly selected 16-byte nonce value

Sec-WebSocket-Protocol
Array of strings unique

Comma-separated list of websocket protocols in priority order. Valid protocol values are:

  • v1.tcp-connect.supd: protocol uses binary frames
    Websocket frames sent by the server contain chunks of raw data from the tcp socket.
Responses
101

Switching Protocols

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

409

Conflict

426

Upgrade Required

503

Service Unavailable (strongbox sealed)

get/v1/state/applications/{application-name}/service-instances/{service-instance-name}/vm-container/tcp-connect