请求所有主机信息
/api/v1/host
GET
参数名 | 风格 | 类型 | 是否必须 | 示例 | 描述 |
---|---|---|---|---|---|
accesskey | 参数 | String | 是 | t9xuit3pt202ou09 | 用户accessKey |
timestamp | 参数 | String | 是 | 18223784 | 当前时间戳(从1970.1.1到此刻的毫秒数) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | { "code" : "0" , "message" : "success" , "data" : [ { "id" : 2826 , "name" : "" , "instanceId" : "" , "internetIp" : "" , "intranetIp" : "" , "status" : "WAIT4PAYMENT" , "connectivity" : false , "regionId" : 7 , "regionDisplay" : "杭州" , "cpu" : 0 , "memory" : 0 , "diskSize" : 0 }, { "id" : 3505 , "name" : "iZ231nj0uyyZ" , "instanceId" : "i-231nj0uyy" , "internetIp" : "xxx.x.xx.xxx" , "intranetIp" : "xxx.xxx.x.xx" , "status" : "OK" , "connectivity" : true , "regionId" : 3 , "regionDisplay" : "杭州" , "cpu" : 2 , "cpuUsed" : 1 , "memory" : 15631 , "memUsed" : 948 , "diskSize" : 503837 , "diskUsed" : 5521 , "containerCount" : 0 } ... ] } |
字段 | 类型 | 描述 |
---|---|---|
code | String | 响应状态码 |
message | String | 响应消息 |
data->id | Long | 主机ID |
data->name | String | 主机名字 |
data->instanceId | String | 主机实例ID |
data->internetIp | String | 公网IP |
data->intranetIp | String | 内网IP |
data->status | String | 主机状态: 1. Ok : 正常 2. ALLOCATING :分配中 3. ALLOCATED :已分配 4. STARTING :启动中 5. STOPPING :停止中 6. STOPPED : 已停止 7. DELETING : 删除中 8. DELETED : 已删除 9. WAIT4PAYMENT : 等待支付 |
data->connectivity | Boolean | 是否受控 |
data->regionId | Long | 区域ID |
data->regionDisplay | String | 区域名字 |
data->cpu | Integer | cpu核数 |
data->cpuUsed | Integer | 已使用cpu核数 |
data->memory | Integer | 内存容量,单位MB |
data->memUsed | Integer | 已使用内存,单位MB |
data->diskSize | Integer | 磁盘大小,单位MB |
data->diskUsed | Integer | 已使用磁盘大小,单位MB |
data->containerCount | Integer | 容器数量 |
根据指定的{host_id}
获取主机信息
/api/v1/host/{host_id
}
GET
参数名 | 风格 | 类型 | 是否必须 | 示例 | 描述 |
---|---|---|---|---|---|
host_id | 路径(不参与签名计算) | Long | 是 | 1234 | 主机ID |
accesskey | 参数 | String | 是 | t9xuit3pt202ou09 | 用户accessKey |
timestamp | 参数 | String | 是 | 18223784 | 当前时间戳(从1970.1.1到此刻的毫秒数) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | { "code" : "0" , "message" : "success" , "data" : { "id" : 3505 , "name" : "iZ231nj0uyyZ" , "instanceId" : "i-231nj0uyy" , "internetIp" : "xxx.xxx.xxx.xxx" , "intranetIp" : "xxx.xxx.xxx.xxx" , "status" : "OK" , "connectivity" : true , "regionId" : 3 , "regionDisplay" : "杭州" , "cpu" : 2 , "cpuUsed" : 3 , "memory" : 15631 , "memUsed" : 949 , "diskSize" : 503837 , "diskUsed" : 5530 , "containerCount" : 0 } } |
字段 | 类型 | 描述 |
---|---|---|
code | String | 响应状态码 |
message | String | 响应消息 |
data->id | Long | 主机ID |
data->name | String | 主机名字 |
data->instanceId | String | 主机实例ID |
data->internetIp | String | 公网IP |
data->intranetIp | String | 内网IP |
data->status | String | 主机状态: 1. Ok : 正常 2. ALLOCATING :分配中 3. ALLOCATED :已分配 4. STARTING :启动中 5. STOPPING :停止中 6. STOPPED : 已停止 7. DELETING : 删除中 8. DELETED : 已删除 9. WAIT4PAYMENT : 等待支付 |
data->connectivity | Boolean | 是否受控 |
data->regionId | Long | 区域ID |
data->regionDisplay | String | 区域名字 |
data->cpu | Integer | cpu核数 |
data->cpuUsed | Integer | 已使用cpu核数 |
data->memory | Integer | 内存容量,单位MB |
data->memUsed | Integer | 已使用内存,单位MB |
data->diskSize | Integer | 磁盘大小,单位MB |
data->diskUsed | Integer | 已使用磁盘大小,单位MB |
data->containerCount | Integer | 容器数量 |
停止或者启动指定主机的日志监控
/api/v1/host/{host_id
}/monitor/{action
}
POST
参数名 | 风格 | 类型 | 是否必须 | 示例 | 描述 |
---|---|---|---|---|---|
host_id | 路径(不参与签名计算) | Long | 是 | 1234 | 主机ID |
action | 路径(不参与签名计算) | String | 是 | enable | 停止或者启动主机日志监控(忽略大小写) 1. enable 2 disable |
accesskey | 参数 | String | 是 | t9xuit3pt202ou09 | 用户accessKey |
timestamp | 参数 | String | 是 | 18223784 | 当前时间戳(从1970.1.1到此刻的毫秒数) |
1 2 3 4 | { "code" : "0" , "message" : "success" } |
字段 | 类型 | 描述 |
---|---|---|
code | String | 响应状态码 |
message | String | 响应消息 |
删除指定的主机
/api/v1/host/{host_id
}/
DELETE
参数名 | 风格 | 类型 | 是否必须 | 示例 | 描述 |
---|---|---|---|---|---|
host_id | 路径(不参与签名计算) | Long | 是 | 1234 | 主机ID |
accesskey | 参数 | String | 是 | t9xuit3pt202ou09 | 用户accessKey |
timestamp | 参数 | String | 是 | 18223784 | 当前时间戳(从1970.1.1到此刻的毫秒数) |
1 2 3 4 | { "code" : "0" , "message" : "success" } |
字段 | 类型 | 描述 |
---|---|---|
code | String | 响应状态码 |
message | String | 响应消息 |