Skip to content

SetServerLabels

POST
/hopbox.admin.v1.ServerService/SetServerLabels
curl --request POST \
--url https://example.com/hopbox.admin.v1.ServerService/SetServerLabels \
--header 'Connect-Protocol-Version: 1' \
--header 'Connect-Timeout-Ms: 1000' \
--header 'Content-Type: application/json' \
--data '{ "id": "example", "labels": { "additionalProperty": "example" } }'

SetServerLabels replaces the labels of a server. From then on, the install keeps these labels and ignores the labels that the heartbeats of the server report.

Connect-Protocol-Version
Connect-Protocol-Version

Define the version of the Connect protocol

number
Allowed value: 1

Define the version of the Connect protocol

Example

1
Connect-Timeout-Ms
Connect-Timeout-Ms

Define the timeout, in ms

number

Define the timeout, in ms

Example

1000
Media typeapplication/json
SetServerLabelsRequest

SetServerLabelsRequest names a server and its new labels.

object
id
id

Id is the ID of the server.

string
labels
labels

Labels are the new labels, such as zone=gra. They replace every label of the server.

object
key
additional properties
value
string

Example generated

{
"id": "example",
"labels": {
"additionalProperty": "example"
}
}

Success

Media typeapplication/json
SetServerLabelsResponse

SetServerLabelsResponse holds the server after the change.

object
server
server
object
id
id

Id is the ID of the server, a UUID.

string
pool
pool

Pool is the name of the pool of the server.

string
hostname
hostname

Hostname is the host name that the server sent at its enrollment.

string
roles
roles

Roles are the roles of the server, such as node or dns. Its certificate carries them.

Array<string>
state
state
string
Allowed values: SERVER_STATE_UNSPECIFIED SERVER_STATE_READY SERVER_STATE_CORDONED SERVER_STATE_UNRESPONSIVE SERVER_STATE_DECOMMISSIONED SERVER_STATE_DRAINING SERVER_STATE_SHUTTING_DOWN
cordoned
cordoned

Cordoned is true while an instance admin keeps the server cordoned, also while it is unresponsive.

boolean
status
status
string
Allowed values: SERVER_STATUS_UNSPECIFIED SERVER_STATUS_OK SERVER_STATUS_DEGRADED
problems
problems

Problems are the failed checks of the last heartbeat, such as a missing /dev/kvm.

Array<string>
labels
labels

Labels are the labels of the server, such as zone=gra.

object
key
additional properties
value
string
hopboxdVersion
hopboxd_version

Hopboxd_version is the version of hopboxd on the server, such as v0.1.0.

string
kernelRelease
kernel_release

Kernel_release is the release of the host kernel, such as 6.18.57-hopbox1.

string
cpu
cpu
object
arch
arch

Arch is the CPU architecture, such as amd64.

string
vendor
vendor

Vendor is the CPU vendor, such as GenuineIntel.

string
family
family
integer
model
model
integer
stepping
stepping
integer
modelName
model_name

Model_name is the name of the CPU model, such as Intel(R) Xeon(R) CPU E5-1650 v4 @ 3.60GHz.

string
microcode
microcode

Microcode is the microcode revision, such as 0xb000040.

string
flagsHash
flags_hash

Flags_hash is the SHA-256, in hex, of the sorted CPU flags.

string
cpuTemplate
cpu_template

Cpu_template is the Firecracker CPU template of the server, or none.

string
compatibilityClass
compatibility_class

Compatibility_class names the servers that can restore the memory state of each other.

string
capacity
capacity
object
cpuThreads
cpu_threads

Cpu_threads is the count of CPU threads.

integer
memoryBytes
memory_bytes

Memory_bytes is the size of the memory.

string format: int64
diskBytes
disk_bytes

Disk_bytes is the size of the file system of the data dir.

string format: int64
diskFreeBytes
disk_free_bytes

Disk_free_bytes is the free space on the file system of the data dir.

string format: int64
allocations
allocations

Allocations are the resources that the machines of the server hold.

Array<object>
Allocation

Allocation is what one machine holds on its server.

object
machineId
machine_id

Machine_id is the ID of the machine.

string
vcpus
vcpus
integer
memoryBytes
memory_bytes
string format: int64
diskBytes
disk_bytes
string format: int64
actions
actions

Actions are the actions that the server started and did not finish yet.

Array<object>
ActionInProgress

ActionInProgress is an action that a server started and did not finish yet.

object
machineId
machine_id

Machine_id is the ID of the machine of the action.

string
action
action

Action names the action, such as start.

string
startTime
start_time

Start_time is the start of the action.

string format: date-time
lastHeartbeatTime
last_heartbeat_time

Last_heartbeat_time is the time of the last heartbeat. It is absent before the first one.

string format: date-time
enrollTime
enroll_time

Enroll_time is the time of the enrollment.

string format: date-time
certificateExpireTime
certificate_expire_time

Certificate_expire_time is the end of the newest certificate of the server.

string format: date-time
version
version

Version grows by 1 with each change of the row, such as each heartbeat.

string format: int64
updateTime
update_time

Update_time is the time of the last change.

string format: date-time
labelsSetByAdmin
labels_set_by_admin

Labels_set_by_admin is true once SetServerLabels set the labels. The install then ignores the labels of the heartbeats.

boolean
machineCount
machine_count

Machine_count is the count of machines on the server that their executor has not deleted yet, stopped machines included. Their disks live on the server.

integer format: int32
mesh
mesh

Mesh is the part of the server in the mesh. It is absent until the server reports the public key of its WireGuard device, and on a server without an address on the vRack.

object
address
address

Address is the mesh address of the server, in 10.239.0.0/16, such as 10.239.0.3.

string
vrackAddress
vrack_address

Vrack_address is deprecated, and always empty. The mesh runs on the peer address of each server, the field peer_address of Server.

string
publicKey
public_key

Public_key is the public key of the WireGuard device hbm0 of the server, in base64, as wg show prints it.

string
dnsZoneSerial
dns_zone_serial

Dns_zone_serial is the serial of the zones that the DNS role of the server served at its last heartbeat. It is absent on a server without the DNS role, and before its first zones.

integer | null
drain
drain

Drain is the drain of the server. It is absent on a server that does not drain, and after the decommission.

object
startTime
start_time

Start_time is the start of the drain, or of its last retry.

string format: date-time
moving
moving

Moving counts the cold moves from the server that run now.

integer format: int32
stranded
stranded

Stranded are the machines that the drain cannot move. Each one keeps its disk on the server.

Array<object>
StrandedMachine

StrandedMachine is a machine that the drain of a server, or the removal of its node role, cannot move.

object
machineId
machine_id

Machine_id is the ID of the machine.

string
name
name

Name is the name of the machine.

string
reason
reason

Reason says why the machine cannot move.

string
onServer
on_server

On_server is false for a machine on another node whose disk a failed move left on the server (reference/cold-move.md “A step that an older control process accepted”).

boolean
emptyChecks
empty_checks

Empty_checks counts the empty checks in a row: 0 to 3.

integer format: int32
lastCheckTime
last_check_time

Last_check_time is the time of the last empty check. It is absent before the first one.

string format: date-time
error
error

Error says why the drain waits now, such as a refused decommission. It is empty when the drain goes on.

string
stuck
stuck

Stuck is true when the drain cannot go on by itself: no move runs, and each machine left on the server is stranded, or the error names a refusal. A second DrainServer tries again.

boolean
cordonedBefore
cordoned_before

Cordoned_before is true when the server was cordoned before the drain, or an instance admin cordoned it during the drain. CancelDrain then keeps the cordon.

boolean
strandedDisks
stranded_disks

Stranded_disks are the detached extra disks that the drain cannot move. Each one keeps its data on the server.

Array<object>
StrandedDisk

StrandedDisk is an extra disk that the drain of a server, or the removal of its node role, cannot move.

object
diskId
disk_id

Disk_id is the ID of the disk.

string
name
name

Name is the name of the disk in its org.

string
reason
reason

Reason says why the disk cannot move.

string
peerAddress
peer_address

Peer_address is the public IPv4 address at which the other servers reach the server, such as 203.0.113.12. It is empty on a server without one.

string
removal
removal

Removal is the pending removal of roles from the server. It is absent without one.

object
roles
roles

Roles are the roles that go, such as edge and dns.

Array<string>
startTime
start_time

Start_time is the start of the removal.

string format: date-time
cordonedBefore
cordoned_before

Cordoned_before is true when the server was cordoned before the removal. The end and the cancel of the removal lift only a cordon that the removal set.

boolean
moving
moving

Moving counts the cold moves from the server that run now.

integer format: int32
stranded
stranded

Stranded are the machines that the removal of the node role cannot move. Each one keeps its disk on the server.

Array<object>
StrandedMachine

StrandedMachine is a machine that the drain of a server, or the removal of its node role, cannot move.

object
machineId
machine_id

Machine_id is the ID of the machine.

string
name
name

Name is the name of the machine.

string
reason
reason

Reason says why the machine cannot move.

string
onServer
on_server

On_server is false for a machine on another node whose disk a failed move left on the server (reference/cold-move.md “A step that an older control process accepted”).

boolean
error
error

Error says why the removal waits now, such as a machine that has not booted yet. It is empty when the removal goes on.

string
stuck
stuck

Stuck is true when the removal of the node role cannot go on by itself: no move runs, and each machine left on the server is stranded.

boolean
ready
ready

Ready is true when the removal can end: the server holds no machine, no disk of a move, and no allocation, or the removal keeps the node role. An enrollment with the roles that stay then ends it.

boolean
strandedDisks
stranded_disks

Stranded_disks are the detached extra disks that the removal of the node role cannot move. Each one keeps its data on the server.

Array<object>
StrandedDisk

StrandedDisk is an extra disk that the drain of a server, or the removal of its node role, cannot move.

object
diskId
disk_id

Disk_id is the ID of the disk.

string
name
name

Name is the name of the disk in its org.

string
reason
reason

Reason says why the disk cannot move.

string
removedRoles
removed_roles

Removed_roles are the roles that a removal took from the server. A token adds a role to the server only when this list holds the role.

Array<string>

Example

{
"server": {
"state": "SERVER_STATE_UNSPECIFIED",
"status": "SERVER_STATUS_UNSPECIFIED",
"actions": [
{
"startTime": "2023-01-15T01:30:15.01Z"
}
],
"lastHeartbeatTime": "2023-01-15T01:30:15.01Z",
"enrollTime": "2023-01-15T01:30:15.01Z",
"certificateExpireTime": "2023-01-15T01:30:15.01Z",
"updateTime": "2023-01-15T01:30:15.01Z",
"drain": {
"startTime": "2023-01-15T01:30:15.01Z",
"lastCheckTime": "2023-01-15T01:30:15.01Z"
},
"removal": {
"startTime": "2023-01-15T01:30:15.01Z"
}
}
}

Error

Media typeapplication/json
Connect Error
object
code

The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].

string
Allowed values: canceled unknown invalid_argument deadline_exceeded not_found already_exists permission_denied resource_exhausted failed_precondition aborted out_of_range unimplemented internal unavailable data_loss unauthenticated
message

A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.

string
details

A list of messages that carry the error details. There is no limit on the number of messages.

Array<object>

Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details.

object
type

A URL that acts as a globally unique identifier for the type of the serialized message. For example: type.googleapis.com/google.rpc.ErrorInfo.

string
value

The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the type field.

string format: byte
debug
Debug

Deserialized error detail payload. The ‘type’ field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.

object
key
additional properties
any
key
additional properties
any
key
additional properties
any

Example

{
"code": "canceled"
}