Skip to content

GetCapacity

POST
/hopbox.admin.v1.MonitorService/GetCapacity
curl --request POST \
--url https://example.com/hopbox.admin.v1.MonitorService/GetCapacity \
--header 'Connect-Protocol-Version: 1' \
--header 'Connect-Timeout-Ms: 1000' \
--header 'Content-Type: application/json' \
--data '{ "range": "HISTORY_RANGE_UNSPECIFIED" }'

GetCapacity returns the capacity of each node, what its machines hold and use, and the trend.

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
GetCapacityRequest

GetCapacityRequest selects the range of the trends.

object
range
range
string
Allowed values: HISTORY_RANGE_UNSPECIFIED HISTORY_RANGE_DAY HISTORY_RANGE_HOUR

Success

Media typeapplication/json
GetCapacityResponse

GetCapacityResponse holds the capacity of each node.

object
sampleTime
sample_time

Sample_time is the time of the newest sample of the leader, or absent without one.

string format: date-time
step
step

Step is the time between two points of each trend.

string format: duration
servers
servers

Servers are the servers with the node role that are not decommissioned, by ID.

Array<object>
ServerCapacity

ServerCapacity is the capacity of one node, what its machines hold, and what they use.

object
serverId
server_id

Server_id is the ID of the server.

string
vcpus
vcpus

Vcpus is the vCPU capacity of the node, with the overcommit of placement.

string format: int64
vcpusAllocated
vcpus_allocated

Vcpus_allocated is the vCPUs of the machines that hold compute on the node.

string format: int64
memoryBytes
memory_bytes

Memory_bytes is the RAM of the node.

string format: int64
memoryAllocatedBytes
memory_allocated_bytes

Memory_allocated_bytes is the RAM of the machines that hold compute on the node.

string format: int64
diskBytes
disk_bytes

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

string format: int64
diskFreeBytes
disk_free_bytes

Disk_free_bytes is the free space of that file system.

string format: int64
diskAllocatedBytes
disk_allocated_bytes

Disk_allocated_bytes is the disk sizes of the machines on the node.

string format: int64
cpuUsed
cpu_used

Cpu_used is the CPU threads that the machines of the node used in the last 5 minutes (hopbox_machines_cpu_seconds_total). It is absent when the history has no recent sample of the node, such as for a node without the control role.

number | null format: double
memoryUsedBytes
memory_used_bytes

Memory_used_bytes is the host RAM that the machines of the node hold now (hopbox_machines_memory_bytes). It is absent as cpu_used is.

string | null format: int64
cpuUsedHistory
cpu_used_history

Cpu_used_history is cpu_used in each step of the range.

Array<object>
SamplePoint

SamplePoint is a value of a trend at one time.

object
time
time

Time is the end of the step of the value.

string format: date-time
value
value
number format: double
memoryUsedHistory
memory_used_history

Memory_used_history is memory_used_bytes at the end of each step of the range.

Array<object>
SamplePoint

SamplePoint is a value of a trend at one time.

object
time
time

Time is the end of the step of the value.

string format: date-time
value
value
number format: double
vcpusAllocatedHistory
vcpus_allocated_history

Vcpus_allocated_history is vcpus_allocated at the end of each step of the range.

Array<object>
SamplePoint

SamplePoint is a value of a trend at one time.

object
time
time

Time is the end of the step of the value.

string format: date-time
value
value
number format: double
memoryAllocatedHistory
memory_allocated_history

Memory_allocated_history is memory_allocated_bytes at the end of each step of the range.

Array<object>
SamplePoint

SamplePoint is a value of a trend at one time.

object
time
time

Time is the end of the step of the value.

string format: date-time
value
value
number format: double
diskFreeHistory
disk_free_history

Disk_free_history is disk_free_bytes at the end of each step of the range.

Array<object>
SamplePoint

SamplePoint is a value of a trend at one time.

object
time
time

Time is the end of the step of the value.

string format: date-time
value
value
number format: double
hostname
hostname

Hostname is the host name of the server, or empty when the control store no longer has the server.

string
pool
pool

Pool is the name of the pool of the server, or empty as hostname.

string
roles
roles

Roles are the roles of the server.

Array<string>
state
state

State is the state of the server, or unspecified as hostname.

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
cpuThreads
cpu_threads

Cpu_threads is the count of CPU threads of the node. vcpus is cpu_threads times the vCPU overcommit of placement, so cpu_used compares with it.

integer format: int32
grafanaUrl
grafana_url

Grafana_url is grafana_url of the install config, or empty.

string

Example

{
"sampleTime": "2023-01-15T01:30:15.01Z",
"servers": [
{
"cpuUsedHistory": [
{
"time": "2023-01-15T01:30:15.01Z"
}
],
"memoryUsedHistory": [
{
"time": "2023-01-15T01:30:15.01Z"
}
],
"vcpusAllocatedHistory": [
{
"time": "2023-01-15T01:30:15.01Z"
}
],
"memoryAllocatedHistory": [
{
"time": "2023-01-15T01:30:15.01Z"
}
],
"diskFreeHistory": [
{
"time": "2023-01-15T01:30:15.01Z"
}
],
"state": "SERVER_STATE_UNSPECIFIED"
}
]
}

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"
}