更新(A)

対象仮想マシンのプロパティを更新します。

check
重要

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

PUT /api/1.0/vm/{vmId}

※ vmId :プロパティを更新したい仮想マシンのID

Request parameters
Name Description Type Data type Required
Authorization Bearer [APIキー] header string True
vm 対象の仮想マシン情報 body object True
body parameters
Name Description Example Data type Required
vm 仮想マシン情報 Object True
vmName 仮想マシン名 VM01 String True
guestName ゲスト名 computername String True
comment コメント コメント String
cpuHotAddFlg 仮想CPUホットアドフラグ false Boolean True
memoryHotAddFlg メモリホットアドフラグ false Boolean True
timeSyncFlg ゲスト時刻同期フラグ false Boolean True
guestOsType ゲストOSコード
※ 3.パラメータ詳細:guestOsType
01001 String True
vcpu 仮想CPU数 4 Number True
cpuCorePerSocket ソケットあたりのコア数 2 Number True
memory 仮想メモリ(MB) 1024 Number True
hwVersion 仮想ハードウェアバージョン
※ 3.パラメータ詳細:hwVersion
vmx-17 String True
firmwareKbn ファームウェア区分
1:BIOS
2:EFI
1 String True
bootSecureBootFlg セキュアブートフラグ false Boolean True
bootDelayTime 起動遅延時間(秒)
※0~10秒で指定
10 Number True
bootBiosSetupFlg 強制セットアップフラグ false Boolean True
storages 仮想マシンストレージ情報配列 Array True
storage 仮想マシンストレージ情報 Object True
vmStorageId 仮想マシンストレージID
※ディスク更新の場合は指定必須
01887c57faef446fb2cca00cef507efa String
size ストレージサイズ(GB) 100 Number True
busType バスタイプ
※ 3.パラメータ詳細:busType
lsilogocsas String True
busNo バスNo 0 String True
unitNo ユニットNo 0 String True
storageId ストレージID f1af87b78705473fb7ca7e5924fa1843 String True
nics 仮想マシンNIC
情報配列
Array
nic 仮想マシンNIC情報 Object
nicId 仮想マシンNICID
※NIC更新の場合は指定必須
4d8de6382bda48c58757fc8f280715d0 String
primaryKbn プライマリ区分
1:プライマリ
0:プライマリ以外
1 String True
networkId ネットワークID
※未接続で更新する場合は空文字(“”)を指定
df514769956a4c7a893bbb7e3761952c String True
networkAdapterName ネットワークアダプタ名
※追加NICでは指定可能、既存NICでは変更不可
※ 3.パラメータ詳細:networkAdapterName
VMXNET3 String True
ipAddressKbn IPアドレス区分
01:固定IPプール
02:手動
03:DHCP
※未接続で作成する場合は空文字(“”)を指定
02 String True
ipAddress IPアドレス
※ipAddressKbnが手動(02)の場合は記載必須
192.168.1.1 String
macAddress MACアドレス
※割当て済みのmacAddresもしくは空文字(“”)のみ指定可能
空文字を指定した場合はリセット
00:50:56:88:2c:00 String
guestOs 仮想マシンゲストOS情報
guestOsCustomizeFlg ゲストOS変更フラグ
※ゲストOSカスタマイズを実行する場合true
false Boolean True
adminPwdResetFlg ADMINパスワード リセットフラグ true Boolean True
adminPwdKbn ADMINパスワード区分
1:自動生成
2:手動
1 String
adminPwd ADMINパスワード
※adminパスワード区分が手動(2)の場合は指定必須
*** String
adminAutoLoginFlg ADMIN自動ログインフラグ true Boolean True
adminAutoLoginCount ADMIN自動ログインカウント 10 Number
initialLoginPwdChangeFlg 自動ログインパスワード変更フラグ true Boolean True
domainJoinFlg ドメイン参加フラグ true Boolean True
domainName ドメイン名
※ドメイン参加フラグがtrueの場合は指定必須
domain String
domainUserName ドメインユーザ名 domainuser String
domainUserPwd ドメインユーザ パスワード *** String
domainOu ドメインOU String
customScript カスタムスクリプト echo Test script started¥¥r¥¥necho Test script end String
startupOrder 仮想マシン起動順番 2 Number
startupActionKbn 仮想マシン開始アクション区分
0:なし
1:パワーオン
1 String True
startupWaitTime 仮想マシン起動待機時間(秒) 30 Number
stopActionKbn 仮想マシン停止アクション区分
0:シャットダウン
1:パワーオフ
1 String True
stopWaitTime 仮想マシン停止待機時間(秒) 10 Number
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 '{
      "vm": {
        "vmName": " VM02",
        "guestName": " VM02",
        "comment": "",
        "cpuHotAddFlg": true,
        "memoryHotAddFlg": true,
        "timeSyncFlg": true,
        "guestOsType": "01036",
        "vcpu": 2,
        "cpuCorePerSocket": 1,
        "memory": 2048,
        "hwVersion": "vmx-19",
        "firmwareKbn": "1",
        "bootSecureBootFlg": false,
        "bootDelayTime": 0,
        "bootBiosSetupFlg": false,
        "storages": [
          {
            "vmStorageId": "1effb157398a44a684b3ea3c983e689c",
            "size": 40,
            "busType": "paravirtual",
            "busNo": "0",
            "unitNo": "0",
            "storageId": "5bc98ac2356941ea981c29a53969c19a"
          }
        ],
        "nics": [
          {
            "nicId": "9070219a42054905a7d1d5bd406ec297",
            "primaryKbn": "1",
            "networkId": "b62be0f07dac46f2800c453ac2fee566",
            "networkAdapterName": "VMXNET3",
            "ipAddressKbn": "01",
            "ipAddress": "192.168.200.3",
            "macAddress": "00:50:56:ba:1f:4d"
          }
        ],
        "guestOs": {
          "guestOsCustomizeFlg": true,
          "adminPwdResetFlg": true,
          "adminPwdKbn": "2",
          "adminPwd": "***",
          "adminAutoLoginFlg": false,
          "adminAutoLoginCount": 0,
          "initialLoginPwdChangeFlg": false,
          "domainJoinFlg": false,
          "domainName": "",
          "domainUserName": "",
          "domainUserPwd": "",
          "domainOu": "",
          "customScript": ""
        },
        "startupOrder": 1,
        "startupActionKbn": "0",
        "startupWaitTime": 20,
        "stopActionKbn": "1",
        "stopWaitTime": 20
      }'https://eastapi.aspire.gcf.whitecloud.jp/api/1.0/vm/6dd5b...62a4b16ab9e85b...aedba
    }
  
レスポンス例
  
    {"taskId":"9acce9bd9ed8404f87c1ca40dcae4e49"}
  
タスク確認例
  
    # タスク確認実施
    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-06T17:02:48+0900",
        "startedDate": "2024-03-06T17:02:48+0900",
        "finishedDate": "2024-03-06T17:02:50+0900",
        "result": "OK"
       }
    }
  

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