VM Related Interfaces

Get VM Uptime

GET/zstack/v1/vm-instances/{uuid}/uptime

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vm-instances/f02cf46cd553364bb4ccebcce7728e14/uptime

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringurlVirtual Machine UUID 4.2.0
systemTags (Optional)ListquerySystem Tag 4.2.0
userTags (Optional)ListqueryUser Tag 4.2.0

API Response

Response Example

{
  "uptime": "2023-10-01 10:12:15"
}
NameTypeDescriptionStarting Version
successboolean 4.2.0
uptimeString 4.2.0
errorErrorCodeError code. If not null, the operation failed. When the operation succeeds, this field is null. For details, see error4.2.0

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier of the error, for example SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, defaults to null0.6
opaqueLinkedHashMapReserved field, defaults to null0.6
causeErrorCodeRoot cause. The error that triggered the current error. If there is no original error, this field is null0.6

SDK Examples

Java SDK

GetVmUptimeAction action = new GetVmUptimeAction();
action.uuid = "f02cf46cd553364bb4ccebcce7728e14";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetVmUptimeAction.Result res = action.call();

Python SDK

GetVmUptimeAction action = GetVmUptimeAction()
action.uuid = "f02cf46cd553364bb4ccebcce7728e14"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetVmUptimeAction.Result res = action.call()