KDDIクラウドプラットフォームサービス ナレッジサイト

  • HOME
  • 提供API一覧
  • createTemplate

createTemplate

処理概要

テンプレートの作成

 

注意事項

・なし

 

リクエスト

・リクエストパラメータ

スナップショットからテンプレートを作成する場合

Parameter Name Description Required
snapshotid the ID of the snapshot the template is being created from. Either this parameter, or volumeId has to be passed in true
name the name of the template true
displaytext the display text of the template. This is usually used for display purposes. true
ostypeid the ID of the OS Type that best represents the OS of this template. true
isdynamicallyscalable true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory false
passwordenabled true if the template supports the password reset feature; default is false false

 

仮想サーバのROOTボリュームからテンプレートを作成する場合 仮想サーバが停止中に実施する必要があります。

Parameter Name Description Required
volumeid the ID of the disk volume the template is being created from. Either this parameter, or snapshotId has to be passed in true
name the name of the template true
displaytext the display text of the template. This is usually used for display purposes. true
ostypeid the ID of the OS Type that best represents the OS of this template. true
isdynamicallyscalable true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory false
passwordenabled true if the template supports the password reset feature; default is false false

 

・リクエストサンプル

$ ./kick_api.sh command=createTemplate snapshotid=763da263-a632-4c5e-a790-d4d33fb9fc47 name=apitest-temp displaytext=aaa ostypeid=9e4fd456-c234-11e4-a399-2c600c06bb24 isdynamicallyscalable=true passwordenabled=true

 

レスポンス

・レスポンスボディ

 

Response Name Description
id the template ID
account the account name to which the template belongs
accountid the account id to which the template belongs
bootable true if the ISO is bootable, false otherwise
checksum checksum of the template
created the date this template was created
crossZones true if the template is managed across all Zones, false otherwise
details additional key/value details tied with template
displaytext the template display text
domain the name of the domain to which the template belongs
domainid the ID of the domain to which the template belongs
format the format of the template.
hostid the ID of the secondary storage host for the template
hostname the name of the secondary storage host for the template
hypervisor the hypervisor on which the template runs
isdynamicallyscalable true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory
isextractable true if the template is extractable, false otherwise
isfeatured true if this template is a featured template, false otherwise
ispublic true if this template is a public template, false otherwise
isready true if the template is ready to be deployed from, false otherwise.
name the template name
ostypeid the ID of the OS type for this template.
ostypename the name of the OS type for this template.
passwordenabled true if the reset password feature is enabled, false otherwise
project the project name of the template
projectid the project id of the template
removed the date this template was removed
size the size of the template
sourcetemplateid the template ID of the parent template if present
sshkeyenabled true if template is sshkey enabled, false otherwise
status the status of the template
templatetag the tag of this template
templatetype the type of the template
zoneid the ID of the zone for this template
zonename the name of the zone for this template
tags(*) the list of resource tags associated with tempate
account the account associated with the tag
customer customer associated with the tag
domain the domain associated with the tag
domainid the ID of the domain associated with the tag
key tag key name
project the project name where tag belongs to
projectid the project id the tag belongs to
resourceid id of the resource
resourcetype resource type
value tag value
jobid the ID of the latest async job acting on this object
jobstatus the current status of the latest async job acting on this object

 

・レスポンスサンプル

【コマンド実行結果】

<?xml version=”1.0″ encoding=”UTF-8″?>
<createtemplateresponse cloud-stack-version=”4.3.0.2″>
<id>1dc01a57-ff9c-447d-b295-a3268dab56d9</id>
<jobid>883f0193-fa83-4c00-9aed-c4cfe8ac58d5</jobid>
</createtemplateresponse>
 

【queryAsyncJobResultでの確認結果】

<?xml version=”1.0″ encoding=”UTF-8″?>
<queryasyncjobresultresponse cloud-stack-version=”4.3.0.2″>
<accountid>d344caf5-24dc-4194-ac5f-2d78d5e38039</accountid>
<userid>0212ea46-0529-4250-9e3e-bcb03c114002</userid>
<cmd>org.apache.cloudstack.api.command.user.template.CreateTemplateCmd</cmd>
<jobstatus>1</jobstatus>
<jobprocstatus>0</jobprocstatus>
<jobresultcode>0</jobresultcode>
<jobresulttype>object</jobresulttype>
<jobresult>
<template>
<id>1dc01a57-ff9c-447d-b295-a3268dab56d9</id>
<name>apitest-temp</name>
<displaytext>aaa</displaytext>
<ispublic>false</ispublic>
<created>2016-09-24T11:45:31+0900</created>
<isready>true</isready>
<passwordenabled>true</passwordenabled>
<format>OVA</format>
<isfeatured>false</isfeatured>
<crossZones>false</crossZones>
<ostypeid>9e4fd456-c234-11e4-a399-2c600c06bb24</ostypeid>
<ostypename>CentOS 6.4 (64-bit)</ostypename>
<account>xxxx</account>
<zoneid>7d4b9647-356d-49a8-8e1a-28862b9c9082</zoneid>
<zonename>jp2-east03</zonename>
<status>Download Complete</status>
<size>107374182400</size>
<templatetype>USER</templatetype>
<hypervisor>VMware</hypervisor>
<domain>MXXXXXXXX</domain>
<domainid>57edb9da-0279-45f0-842a-d768c4ed0d47</domainid>
<isextractable>false</isextractable>
<sourcetemplateid>a42a3b6d-95db-417b-84a3-c1208dfcd509</sourcetemplateid>
<details>{memoryOvercommitRatio=1.0, keyboard=jp, Message.ReservedCapacityFreed.Flag=false, dataDiskController=osdefault, cpuOvercommitRatio=3.0, nicAdapter=Vmxnet3, rootDiskController=osdefault}</details>
<sshkeyenabled>false</sshkeyenabled>
<isdynamicallyscalable>true</isdynamicallyscalable>
</template>
</jobresult>
<created>2016-09-24T11:45:31+0900</created>
<jobid>883f0193-fa83-4c00-9aed-c4cfe8ac58d5</jobid>
</queryasyncjobresultresponse>

提供API一覧

2024/09/15 2024/09/15