查询云主机所有快照

本页目录

https://www.cloudam.cn/vps/cvmresource/snapshot/list?accountId={ACCOUNT_ID}&ip={IP}

请求方式:GET

查询云主机所有快照

URL Parameters

ParameterTypeDescription
IPString弹性公网ip地址
Example: 121.41.107.138
ACCOUNT_IDString你的Cloudam账户ID, Cloudam会随Token一起提前发送给客户
Example: demoaccount

Request(请求)

Headers(HTTP头) 注: 请首先联系Cloudam获取API Token,token相当于密码,请妥善保护。

{
"Authorization": "Bearer ${token}",
"Content-Type": "application/json"
}

Response(响应) - 200

Headers(响应头)

{
"Content-Type": "application/json"
}

Body(响应体JSON) -- 正确响应

{
"success": true,
"errorCode": "",
"errorMsg": null,
"snapshots": [
{
"snapshotId": "s-2zeinznetzuyxo478q27",
"createTime": 1575369594000,
"snapshotType": "system",
"status": "success",
"snapshotSize": 20,
"id": "5de63b7c352df30001be04cb",
"username": "subtest",
"instanceId": "i-2ze0mno7pp379pjl9omh",
"deleteTime": 0,
"provider": "ALIYUN",
"region": "cn-beijing",
"deleted": false
},
{
"snapshotId": "s-2zean6oiqkrzwfst3yej",
"createTime": 1575442887000,
"snapshotType": "system",
"status": "success",
"snapshotSize": 20,
"id": "5de759c8ca5b7a0001feeed6",
"username": "subtest",
"instanceId": "i-2ze0mno7pp379pjl9omh",
"deleteTime": 0,
"provider": "ALIYUN",
"region": "cn-beijing",
"deleted": false
}
]
}

Response Body Attributes(响应Body属性)

AttributeTypeDescription
successboolean执行成功则返回true,失败则返回false
errorCodeString错误代码,空字符串表示成功,User.NotAllowed 表示请求异常,
如:User.NotAllowed:用户传入不正确的参数。
errorMsgString具体的错误信息可能取值如下:The user has no right to do this
snapshotsArray若执行成功则会返回创建的快照列表
Snapshot.snapshotIdString快照ID
Snapshot.CreateTimeString创建时间
Snapshot.snapshotTypeString快照的磁盘类型
Snapshot.statusString快照的状态
Snapshot.snapshotSizeString快照的大小
Snapshot.idString快照的云端ID
Snapshot.usernameString快照的创建者用户名
Snapshot.instanceIdString创建快照的实例的ID
Snapshot.deleteTimeString快照的删除时间
Snapshot.providerString此快照的云厂商
Snapshot.regionString此快照的所属地域
Snapshot.deletedboolean快照是否已被删除