ListTopMachines
const url = 'https://example.com/hopbox.admin.v1.MonitorService/ListTopMachines';const options = { method: 'POST', headers: { 'Connect-Protocol-Version': '1', 'Connect-Timeout-Ms': '1000', 'Content-Type': 'application/json' }, body: '{"orderBy":"MACHINE_USE_ORDER_UNSPECIFIED","limit":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/hopbox.admin.v1.MonitorService/ListTopMachines \ --header 'Connect-Protocol-Version: 1' \ --header 'Connect-Timeout-Ms: 1000' \ --header 'Content-Type: application/json' \ --data '{ "orderBy": "MACHINE_USE_ORDER_UNSPECIFIED", "limit": 1 }'ListTopMachines returns the running machines that use the most CPU, RAM, disk, or egress.
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Define the version of the Connect protocol
Define the version of the Connect protocol
Example
1Define the timeout, in ms
Define the timeout, in ms
Example
1000Request Bodyrequired
Section titled “Request Bodyrequired”ListTopMachinesRequest selects the order and the number of machines.
object
Limit is the most machines in the response, 1 to 100. 0 means 20.
Responses
Section titled “Responses”Success
ListTopMachinesResponse holds the running machines of the history, the most first.
object
Sample_time is the time of the newest sample of a machine, or absent without one.
MachineUse is what a running machine uses, from the series of its node.
object
Machine_id is the ID of the machine.
Name is the name of the machine.
Org_id is the ID of the org of the machine.
Org_name is the name of the org. It is empty when the org is gone.
Owner_email is the first email of the first owner of the org, to tell the person.
Size is the name of the size of the machine.
Vcpus is the vCPUs of the size.
Memory_bytes is the RAM of the size.
Disk_bytes is the disk of the size.
Server_id is the ID of the node of the machine. It is empty when the node took the sample before its enrollment.
Url_visibility is the visibility of the URL of the machine. It is unspecified when the machine is gone from the control store.
Cpu_share_5m is the share of its vCPUs that the machine used in the last 5 minutes. 1 is every vCPU all the time.
Cpu_share_30m is the same share over the last 30 minutes. It is absent until the samples of the machine cover the 30 minutes, such as for a machine that started 10 minutes ago.
Cpu_share_1h is the same share over the last hour, absent until the samples cover the hour.
Cpu_history is the share of its vCPUs that the machine used in each 30 minutes of the last 24 hours. ListTopMachines fills it. A step in which the machine did not run has no point.
SamplePoint is a value of a trend at one time.
object
Time is the end of the step of the value.
Memory_used_bytes is the host RAM that the machine holds now (hopbox_machine_memory_bytes).
Disk_used_bytes is the bytes that the sparse disk file of the machine holds now (hopbox_machine_disk_bytes).
Egress_bytes is the bytes that the machine sent out in the last 24 hours.
Egress_connections counts the outbound connections that the machine opened in the last 24 hours.
Total counts the running machines of the history, also those past limit.
Grafana_url is grafana_url of the install config, or empty.
Example
{ "sampleTime": "2023-01-15T01:30:15.01Z", "machines": [ { "urlVisibility": "URL_VISIBILITY_UNSPECIFIED", "cpuHistory": [ { "time": "2023-01-15T01:30:15.01Z" } ] } ]}default
Section titled “default”Error
Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation
object
The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
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.
A list of messages that carry the error details. There is no limit on the number of messages.
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
A URL that acts as a globally unique identifier for the type of the serialized message. For example: type.googleapis.com/google.rpc.ErrorInfo.
The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the type field.
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
Example
{ "code": "canceled"}