Cluster

Represents the site-local cluster formed by supd running on each host.

Retrieve the cluster

SecurityaccessToken
Request
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/system/cluster
Response samples
site-name: gothenburg-bergakungen
versions:
  22.10.3-911e04be: 3

Invoke the drain-host operation

Put the specified host into drain mode. While in drain mode, service instances scheduled to this host will be stopped or rescheduled to other hosts, and no new service instances will be scheduled to this host.

Putting a host in drain mode can be useful in order to e.g., upgrade the operating system or hardware, or do host replacement, with minimal impact on running applications.

When this operation returns successfully, the host is in drain mode. If the result parameter is drained, no services are running on the host.

Drain mode is an ephemeral state, which means that if supd is restarted, the host is no longer in drain mode. In order to ensure that the host will not run any service instances even after a restart, configure the host's maintenance-mode to blocked.

drain-host can be used regardless of the host's maintenance-mode setting. If the host has maintenance-mode out-of-service, drain-host is superfluous, but it can be used to wait for all running service instances to be rescheduled to new hosts.

SecurityaccessToken
Request
query Parameters
site
string

Send the request to the specfifed site

Request Body schema:
One of:
no-reschedule
boolean

Must have the value true.

If this parameter is given, existing service instances will be stopped but not rescheduled to other hosts. This can be useful if the host will be down for a brief period of time.

Note that if the host is not restarted, the service instances will not automatically be rescheduled.

timeout
string <duration | infinity>
Default: "infinity"
  • duration: A duration in years, days, hours, minutes and seconds.
    Format is [<digits>y][<digits>d][<digits>m][<digits>s].
    Examples: 1y2d5h, 5h or 10m30s
  • infinity: - infinity

Wait at most the given time before returning. A timeout of 0s sets the host in drain mode and returns immediately.

hostname
required
string

The hostname of the host that will be put into drain mode.

Responses
200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

503

Service Unavailable (strongbox sealed)

post/v1/state/system/cluster/drain-host
Request samples
hostname: h02
no-reschedule: true
timeout: 30s
Response samples
result: drained

Invoke the reschedule operation

Optimize how service instances are distributed among hosts on this site. The algorithm attempts to be somewhat conservative, to mainly move service instances when it is a good need for it. However, since normal scheduling rules and filters apply to the rescheduling algorithm, the number of service instances per host is a factor.

SecurityaccessToken
Request
query Parameters
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)

post/v1/state/system/cluster/reschedule
Response samples
rescheduled-service-instances:
  - name: telco.alpine.my-srv-1
    from-host: h01
    to-host: h02
  - name: telco.alpine.my-srv-2
    from-host: h02
    to-host: h03
  - name: telco.alpine.my-srv-3
    from-host: h01
    to-host: h04