Query details about a host

2023-08-15 11:21:17  Updated

Description

You can call this operation to query details about a host based on its ID.

Call description

Prerequisite

You have the HOST_VIEWER permissions.

Request path

GET /api/v2/compute/hosts/{hostId}

Request parameters

Parameter Type Required Example value Description
hostId Long Yes 100 The ID of the host.

Response parameters

Parameter Type Description
data Object The requested host data.
successful Boolean Indicates whether the request was successful.
timestamp Datetime The timestamp when the server completed the request.
duration Integer The time taken by the server to process the request, in milliseconds.
status Integer An HTTP status code.
traceId String The trace ID of the request. This trace ID is used for troubleshooting.
server String The address of the application server that responded to the request.

Data structure of the host information

Parameter Type Description
id Long The ID of the host.
name String The name of the host.
alias String The alias of the host.
description String The description of the host.
operatingSystem String The operating system.
operatingSystemRelease String The release name of the operating system.
architecture String The hardware architecture.
serialNumber String The serial number.
innerIpAddress String The IP address of the host.
sshPort Integer The SSH port number.
kind String The type of the host. Valid values: * DEDICATED_PHYSICAL_MACHINE * DEDICATED_CONTAINER
publishPorts String The port mapping.
services ObjectArray The ServiceSummary array, which is a summary of the deployed services.
status String The status of the host. Valid values: * NEW: The host is newly added without OCP-Agent and has not been initialized. * AVAILABLE: The host is online and available. * ONLINE: The host is online and the OCP-Agent service has been deployed on it. * OFFLINE: The host is offline. * DELETING
idcId Long The ID of the IDC.
idcName String The name of the IDC.
idcDescription String The description of the IDC.
typeId Long The ID of the host type.
typeName String The name of the host type.
typeDescription String The description of the host type.
regionId Long The ID of the region.
regionName String The name of the region.
regionDescription String The description of the region.
hostAgentId Long The ID of the OCP-Agent.
hostAgentVersion String The version of the OCP-Agent.
hostAgentStatus String The status of the OCP-Agent. Valid values: * AVAILABLE * RESTARTING * STOPPING * REINTSTALLING * OFFLINE * DELETED
createTime String The time when the host was created.
updateTime String The time when the host was modified.

Data structure of ServiceSummary

Parameter Type Description
name String The name of the service.
version String The version of the service.
type String The type of the service. Valid values: * OB_CLUSTER * OB_PROXY * OCP_AGENT * BACKUP_AGENT * RESTORE_AGENT * BACKUP_RESTORE_AGENT * OMS
softwarePackageId Long The ID of the software package.

Examples

Sample request

GET /api/v2/compute/hosts/100

Sample response

{
  "data": {
    "alias": null,
    "architecture": "x86_64",
    "createTime": "2021-08-10T11:56:16+08:00",
    "description": null,
    "hostAgentId": 6000001,
    "hostAgentStatus": "AVAILABLE",
    "hostAgentVersion": "3.1.2-20210812221645",
    "id": 3000002,
    "idcDescription": null,
    "idcId": 1,
    "idcName": "bejing1",
    "innerIpAddress": "xx.xx.xx.xx",
    "kind": "DEDICATED_PHYSICAL_MACHINE",
    "name": "OceanBase152105.et15qa",
    "operatingSystem": "4.9.168-018.ali3000.alios7.x86_64",
    "operatingSystemRelease": "alios7",
    "publishPorts": null,
    "regionDescription": null,
    "regionId": 1,
    "regionName": "beijing",
    "serialNumber": null,
    "services": [
      {
        "name": "cluster01:1",
        "softwarePackageId": null,
        "type": "OB_CLUSTER",
        "version": "2.2.76"
      }
    ],
    "sshPort": 22,
    "status": "ONLINE",
    "typeDescription": null,
    "typeId": 1,
    "typeName": "beijing",
    "updateTime": "2021-08-25T15:09:53+08:00"
  },
  "duration": 20,
  "server": "xx.xx.xx.xx",
  "status": 200,
  "successful": true,
  "timestamp": "2021-08-25T17:46:59.778+08:00",
  "traceId": "45d755410e824b50"
}

Contact Us