Previous Topic: power_cycle Method (srv Object)Next Topic: rename Method (template Object)


template Object

Use this object to manage existing templates.

Method

Description

list

Retrieve list of application templates

info

Retrieve application template information

rename

Rename an application template

destroy

Destroy an application template

import

Import an application template

export

Export an application template

copy

Copy an application template

migrate

Migrate a template from a remote grid

config

Retrieve application template configuration parameters

config_boundary

Retrieve application template boundary

lock

Lock an application template

unlock

Unlock an application template

get_acl

Retrieve template ACL.

put_acl

Replace entire template ACL

modify_acl

Replace a portion of template ACL

list Method (template Object)
Description

Retrieve list of application templates

Syntax
/api/v1/template/list?vdc=controller-name 
Arguments
vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Retrieve list of application templates

GET http://192.168.123.200/api/v1/template/list?vdc=mygrid 
Sample Output
XML:
<templates> 
   template> 
      name>TWiki_r11</name> 
      description>TWiki 4.3.1 collaboration platform (v4.3.1-7)</description> 
      destroy_on_stop>0</destroy_on_stop> 
      doc_url>http://doc.3tera.net/AppLogic29/RefAppsTWiki4.html</doc_url> 
      id>2</id> 
      state>stopped</state> 
      template>0</template> 
      user1></user1> 
      user2></user2> 
   </template> 
   . 
   . 
   . 
</templates> 
JSON:
{ 
   "template" : [ 
      { 
         "template" : "0", 
         "user1" : "", 
         "name" : "TWiki_r11", 
         "description" : "TWiki 4.3.1 collaboration platform (v4.3.1-7)", 
         "state" : "stopped", 
         "doc_url" : "http://doc.3tera.net/AppLogic29/RefAppsTWiki4.html", 
         "destroy_on_stop" : "0", 
         "id" : "2", 
         "user2" : "" 
      }, 
      . 
      . 
      . 
} 

HTTP Error Codes
404

Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.

info Method (template Object)
Description

Retrieve application template info

Syntax
 /api/v1/template/info?template=template&vdc=controller-name 
Arguments
template

Name of the application template

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Retrieve information for an application template named

VDS_CentOS51_r15. 
GET http://192.168.123.200/api/v1/template/info?template=VDS_CentOS51_r15&vdc=mygrid 
Sample Output
XML:
<template> 
<name>VDS_CentOS51_r15</name> 
<bw>1000000</bw> 
<cpu>0.25</cpu> 
<description>Virtual Dedicated Server - Based on CentOS 5.1 (v1.0.14-1)</description> 
<destroy_on_stop>0</destroy_on_stop> 
<dflt_appliance></dflt_appliance> 
<dflt_appliance_opts></dflt_appliance_opts> 
<doc_url>http://doc.3tera.net/AppLogic27/RefAppsVdsLinux.html</doc_url> 
<id>12</id> 
<incomplete>0</incomplete> 
<locked>0</locked> 
<mem>268435456</mem> 
<state>stopped</state> 
<template>0</template> 
<user1></user1> 
<user2></user2> 
</template>
JSON:
{ 
"locked" : "0", 
"template" : "0", 
"cpu" : "0.25", 
"user1" : "", 
"name" : "VDS_CentOS51_r15", 
"dflt_appliance" : "", 
"description" : "Virtual Dedicated Server - Based on CentOS 5.1 (v1.0.14-1)", 
"state" : "stopped", 
"bw" : "1000000", 
"incomplete" : "0", 
"doc_url" : "http://doc.3tera.net/AppLogic27/RefAppsVdsLinux.html", 
"dflt_appliance_opts" : "", 
"destroy_on_stop" : "0", 
"id" : "12", 
"mem" : "268435456", 
"user2" : "" 
} 

HTTP Error Codes
404

Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.

400.4

Missing required arguments (template). - Argument template=template missing in the request.

404.1

Application VDS_CentOS_r1 does not exist. - Template specified in the request does not exist on the VDC.