コピー(A)

対象テナントの指定したサイト・Pod・契約リソース・仮想マシングループに仮想マシンをコピーします。

check
重要

APIを連続実行した場合、想定していない結果が生じる可能性がございます。実行したAPIの処理結果をGET /api/1.0/task で完了確認したうえで、次の処理を行ってください。

PUT /api/1.0/vm/{vmId}/action/copy

※ vmId :コピー元の仮想マシンのID

Request parameters
Name Description Type Data type Required
Authorization Bearer [APIキー] header String True
vm コピー先の仮想マシン情報 body Object True
Properties
Name Description Example Data type Required
vm 仮想マシン情報 Object True
siteId サイトID 8eb064f7a5db11e895ea005056898046 String True
vmName 仮想マシン名
※コピー先の仮想マシン名
VM01 String True
vmgroupId 仮想マシングループID
※コピー先の仮想マシングループID
1d10a85b0d774af6b79264717ed57416 String True
storages 仮想マシンストレージ情報配列 Array True
storage 仮想マシンストレージ情報
※コピー元で保持するディスク数分記載してください。
Object True
vmStorageId 仮想マシンストレージID
※コピー元の仮想マシンのvmStorageIdを指定
01887c57faef446fb2cca00cef507efa String True
storageId ストレージID
※コピー先で利用するstorageIdを指定
f1af87b78705473fb7ca7e5924fa1843 String True
nics 仮想マシンNIC
情報配列
Array
nic 仮想マシンNIC情報
※指定したテンプレートで保持するNIC数分記載
Object
primaryKbn プライマリ区分
1:プライマリ
0:プライマリ以外
1 String True
networkId ネットワークID
※未接続で作成する場合は空文字(“”)を指定
String True
ipAddressKbn IPアドレス区分
01:固定IPプール
02:手動
03:DHCP
※未接続で作成する場合は空文字(“”)を指定
01 String True
ipAddress IPアドレス
※ipAddressKbnが手動(02)の場合は記載必須
String
Successful Response
Response Code 200 OK
Response Headers Content-type: application/json
Response parameters
Name Description Example Data type
taskId 実行しているアクションのタスクID 24714aac4703428292a03cd847c9ed62 String
実行例) コピー元の仮想マシンのDisk数が2つ、NIC数1つの場合
  
    # Execute request
    curl -i -X PUT -H "Authorization:$token" -H Content-Type:application/json -d '{
        "vm": {
            "siteId": "8eb064f7a5db11e895ea005056898046",
            "vmName": "VMcopy",
            "vmgroupId": "5085715a2bf7477d91d996f970f9095d",
            "storages": [
                {
                    "vmStorageId": "900e4766eb5b4db398783bfee59f1d03",
                    "storageId": "e86e407045ad401f9a3602beed1dfb54"
                },
                {
                    "vmStorageId": "899f5123fw6c5kk928723cfgg60e2r35",
                    "storageId": "e86e407045ad401f9a3602beed1dfb54"
                }
            ],
            "nics": [
                {
                   "primaryKbn": 1,
                   "networkId": "df514769956a4c7a893bbb7e3761952c",
                   "ipAddressKbn": "02",
                   "ipAddress": "192.168.1.1"
                }
             ]
        }
    }'
    https://eastapi.aspire.gcf.whitecloud.jp/api/1.0/vm/e84daa...e4104bd04db...8c72/action/copy
  
レスポンス例
  
    {"taskId":" b1071f224a094822aa9134479449107c"}
  
タスク確認例
  
    # タスク確認実施
    curl -X GET -H "Authorization:$token" -H Content-Type:application/json
    https://eastapi.aspire.gcf.whitecloud.jp/api/1.0/task/b1071f224a094822aa9134479449107c
    
    # レスポンス例
    {
     "task":
       {
         "status":"SUCCESS",
         "progressPercentage":100,
         "targetId":"e84daa8cd47e4104bd04dbf134218c72",
         "acceptedDate":"2023-06-29T19:37:06+0900",
         "startedDate":"2023-06-29T19:37:06+0900",
         "finishedDate":"2023-06-29T19:37:13+0900",
         "result":"OK"
       }
    }
  

※ 出力された “targetId” はコピー元の仮想マシンの “vmId” となります。
※ コピー先の仮想マシン情報は仮想マシンの一覧取得をすることで確認できます。