• No : 1869
  • 公開日時 : 2025/07/28 19:30
  • 更新日時 : 2025/11/14 01:04
  • 印刷

仮想マシンのロックを API で設定・解除できますか?

カテゴリー : 

回答

仮想マシンのロック設定・解除は、createTags および deleteTags コマンドで可能です。
利用方法については次のページをご参照ください。

▼APIドキュメント/createTags
https://tools.idcf.jp/api-docs/apis/?id=docs_compute_reference_Resource-tags_createTags

【仮想マシンのロック設定】
ご指定いただくパラメータは次のとおりです。

resourceids
対象の仮想マシンのID
resourcetype UserVm
tags[0].key cloud-lock
tags[0].value true

【仮想マシンのロック設定例】
idcfcloud compute createTags '{"tags[0].key" : "cloud-lock","tags[0].value" : "true","resourceids" : "×××××","resourcetype" : "UserVm"}'
 
 
 
【仮想マシンのロック解除】
ご指定いただくパラメータは次のとおりです。
resourceids
対象の仮想マシンのID
resourcetype UserVm

【仮想マシンのロック解除例】
idcfcloud compute deleteTags '{"resourceids" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","resourcetype" : "UserVm"}'