対象の仮想マシンに対してスナップショットの作成を行います。
APIを連続実行した場合、想定していない結果が生じる可能性がございます。実行したAPIの処理結果をGET /api/1.0/task で完了確認したうえで、次の処理を行ってください。
PUT /api/1.0/vm/{vmId}/action/createSnapshot
※ vmId :スナップショットを作成したい仮想マシンのID
Request parameters |
Name |
Description |
Type |
Data type |
Required |
Authorization |
Bearer [APIキー] |
header |
string |
True |
body parameters |
Name |
Description |
Example |
Data type |
Required |
snapshotMemoryFlg |
仮想マシンのメモリをスナップショットするかのフラグ |
true |
Boolean |
True |
snapshotQuiesceFlg |
ゲストファイルシステムを休止するかのフラグ |
true |
Boolean |
True |
Successful Response |
Response Code |
200 OK |
Response Headers |
Content-type: application/json |
Response parameters |
Name |
Description |
Example |
Data type |
taskId |
実行しているアクションのタスクID |
24714aac4703428292a03cd847c9ed62 |
string |
実行例
|
# Execute request
curl -X PUT -H "Authorization:$token" -H "Content-Type:application/json" -d ‘{
"snapshotMemoryFlg": "false",
"snapshotQuiesceFlg": "false"
}’ https://eastapi.aspire.gcf.whitecloud.jp/api/1.0/vm/6dd ...419...dba/action/createSnapshot
|
レスポンス例
|
{"taskId":"b395d8b06a564f2688230b9b0f296c4b"}
|
タスク確認例
|
# タスク確認実施
curl -X GET -H "Authorization:$token" -H Content-Type:application/json
https://eastapi.aspire.gcf.whitecloud.jp/api/1.0/task/9acce9bd9ed8404f87c1ca40dcae4e49
# レスポンス例
{
"task": {
"status": "SUCCESS",
"progressPercentage": 100,
"targetId": "6dd5b295762a4b16ab9e85b8be5aedba",
"acceptedDate": "2024-03-06T18:13:33+0900",
"startedDate": "2024-03-06T18:13:33+0900",
"finishedDate": "2024-03-06T18:13:35+0900",
"result": "OK"
}
}
|
※ 出力された “targetId” はスナップショットを取得した仮想マシンの “vmId” となります。
※ 仮想マシン情報は仮想マシンの一覧取得をすることで確認できます。