Previous Topic: template ObjectNext Topic: comp Object


app Object

Use this object to create, configure and manage applications on a VDC.

Method

Description

list

Retrieve list of applications

info

Retrieve application info

create

Create a new application

destroy

Destroy an application

provision

Provision an application from a template.

rename

Rename an application

config

Retrieve application configuration parameters

config_boundary

Retrieve application boundary

start

Start an application

stop

Stop an application

stop_all

Stop all applications

copy

Copy an application

restart

Restart an application

migrate

Migrate an application from a remote grid

lock

Lock an application

unlock

Unlock an application

exec

Run a shell command on a specified application

clean

Clean instantiated application volumes

build

Prepare application for running

continue

Continue starting of an application

repair

Repair an application

export

Export an application

import

Import an application

get_desc

Retrieve application package descriptor

put_desc

Replace application package descriptor

get_acl

Retrieves the application ACL or portion of the application ACL

put_acl

Replace the entire application ACL

modify_acl

Replace portion of application ACL

list Method (app Object)
Description

Retrieve a list of applications

Syntax
/api/v<vers>/app/list?vdc=controller-name 
Arguments
vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Retrieve a list of applications.

GET http://192.168.123.200/api/v2/app/list?vdc=mygrid 
Sample Output
XML:
<applications> 
   <application> 
      name>J2EE</name> 
      description>J2EE application</description> 
      destroy_on_stop>0</destroy_on_stop> 
      doc_url></doc_url> 
      id>2</id> 
      state>stopped</state> 
      template>0</template> 
      user1></user1> 
      user2></user2> 
   </application> 
   <application> 
      name>Lamp</name> 
      description>Lamp application</description> 
      destroy_on_stop>0</destroy_on_stop> 
      doc_url></doc_url> 
      id>3</id> 
      state>running</state>
      template>0</template> 
      user1></user1> 
      user2></user2> 
   </application>
   . 
   . 
   . 
</applications> 
JSON:
{ 
   "application" : [ 
      { 
         "template" : "0", 
         "user1" : "", 
         "name" : "J2EE", br>         "description" : "J2EE application",
         "state" : "stopped", 
         "doc_url" : "", 
         "destroy_on_stop" : "0", br>         "id" : "2", 
         "user2" : "" 
      }, 
      
      { 
         "template" : "0", 
         "user1" : "", 
         "name" : "Lamp", 
         "description" : "Lamp application", 
         "state" : "running", 
         "doc_url" : "", 
         "destroy_on_stop" : "0", 
         "id" : "3", 
         "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 (app Object)
Description

Retrieve application info

Syntax
/api/v2/app/info?app=application&vdc=controller-name 
Arguments
app

Name of the application

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Retrieve information for an application named test.

GET http://192.168.123.200/api/v2/app/info?app=test&vdc=mygrid 
Sample Output
XML:
<application> 
    <name>test</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> 
</application>
JSON:
{ 
    "locked" : "0", 
    "template" : "0", 
    "cpu" : "0.25", 
    "user1" : "", 
    "name" : "test", 
    "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 (app). - Argument app=app-name not specified in the request.

404.1

Entity not found – Permission denied – application ‘test123’ does not exist.

create Method (app Object)
Description

Create a new application

Syntax
/api/v2/app/create?app=application&vdc=controller-name 
Arguments
app

Name of the new application

vdc

Name of the target virtual data center

Options

See Application Control in the Command Line Shell Reference for descriptions of the options available for this command.

Transaction Type

asynchronous

Request Type

GET

Examples

Create a new empty application named test.

GET http://192.168.123.200/api/v2/app/create?app=test &vdc=mygrid 
Sample Output
XML:
<job>be805915-76b2-48c8-b8a0-b881cca66da6</job> 
JSON:
{
   "job" : "be805915-76b2-48c8-b8a0-b881cca66da6"
} 
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 (app). - Argument app=app missing in the request.

Note: To get the status of job, issue a /api/v2/job/info? request with the job_id returned above as the argument. For more information about how to obtain the job status, refer to the job object.

destroy Method (app Object)
Description

Destroy an application

Syntax
/api/v2/app/destroy?app=application&vdc=controller-name 
Arguments
app

Name of the application to be destroyed

vdc

Name of the target virtual data center

Transaction Type

asynchronous

Request Type

GET

Examples

Destroy an application named test.

GET http://192.168.123.200/api/v2/app/destroy?app=test&vdc=mygrid 
Sample Output
XML:
<job>be805915-76b2-48c8-b8a0-b881cca66da6</job>
JSON:
{
   "job" : "be805915-76b2-48c8-b8a0-b881cca66da6"
} 
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 (app). - Argument app=app missing in the request.

Note: To get the status of job, issue a /api/v2/job/info? request with the job_id returned above as the argument. For more information about how to obtain the job status, refer to the job object.

provision Method (app Object)
Description

Provision from a template, configure, and optionally start an application.

Syntax
/api/v2/app/provision?app=application&template=template&vdc=controller-name
Arguments
app

Name of the new application

template

Name of the template application

vdc

Name of the target virtual data center.

Options

See Application Control in the Command Line Shell Reference for descriptions of the options available for this command.

Transaction Type

asynchronous

Request Type

GET

Examples

Provision an application named test from VDS_CentOS51_r15 template.

GET http://192.168.123.200/api/v2/app/provision?app=test&template=VDS_CentOS51_r15&vdc=mygridcode2

Sample Output
XML:

<job>be805915-76b2-48c8-b8a0-b881cca66db7</job>

JSON:

{
   "job" : "be805915-76b2-48c8-b8a0-b881cca66db7"
}

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.

400.4

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

Note: To get the status of job, issue a /api/v2/job/info? request with the job_id returned above as the argument. For more information about how to obtain the job status, refer to the job object.

rename Method (app Object)
Description

Rename an application

Syntax
/api/v2/app/rename?app=application&new_name=new-application&vdc=controller-name 
Arguments
app

Name of the application to be renamed

new_name

New name of the application

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Rename an application named test to test2.

GET http://192.168.123.200/api/v2/app/rename?app=test&new_name=test2&vdc=mygrid 
Sample Output
XML:
<message></message>
JSON:
{
   "message" :""
}
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 (app). - Argument app=app missing in the request.

400.4

Missing required arguments (new_name). - Argument new=new-name missing in the request.

404.1

Entity not found – Permission denied – application ‘test123’ does not exist.

config Method (app Object)
Description

Retrieve application configuration parameters

Syntax
/api/v2/app/config?app=application&vdc=controller-name 
Arguments
app

Name of the application

vdc

Name of the target virtual data center

Options

See Application Control in the Command Line Shell Reference for descriptions of the options available for this command.

Transaction Type

synchronous

Request Type

GET

Examples

Retrieve configuration parameters for application test.

GET http://192.168.123.200/api/v2/app/config?app=test&vdc=mygrid 
Sample Output
XML:
<config>
   <name>test</name>
   <__description>Virtual Dedicated Server - Based on CentOS 5.1 (v1.0.14-1)</__description>
   <__doc_url>http://doc.3tera.net/AppLogic27/RefAppsVdsLinux.html</__doc_url> 
   <__template>0</__template>
</config>
JSON:
{
   "__doc_url" : "http://doc.3tera.net/AppLogic27/RefAppsVdsLinux.html",
   "__template" : "0",
   "__description" : "Virtual Dedicated Server - Based on CentOS 5.1 (v1.0.14-1)",
   "name" : "test"
} 
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 (app). - Argument app=app missing in the request.

404.1

Application test does not exist. - An invalid application name was specified in the request.

config_boundary Method (app Object)

Note: This method has been deprecated and is included here for compatibility with existing user scripts. New users should use the config command with the option flag &boundary.

Description

Retrieve application boundary

Syntax
/api/v2/app/config_boundary?app=application&vdc=controller-name 
Arguments
app

Name of the application

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Retrieve boundary for application main.

GET http://192.168.123.200/api/v2/app/config_boundary?app=main&vdc=mygrid 
Sample Output
XML:
<boundary>
  <interface>
    <name>ext</name>
  </interface>
  <name>main</name>
  <properties>
    <property>
      <mandatory>1</mandatory>
      <name>mode</name>
      <type>string</type>
      <values>manual|format|fscopy|fsck|fsrepair</values>
    </property>
    .
    .
    .
    <property>
      <dflt></dflt>
      <name>adv_options</name>
      <type>string</type>
    </property>
  </properties>
  <resources>
    <resource>
      <dflt>512M</dflt>
      <max>1024M</max>
      <min>160M</min>
      <name>mem</name>
    </resource>
    .
    .
    .
    </resource>
  </resources>
  <volume>
    <name>dst</name>
  </volume>
</boundary>
JSON:
{
   "resource" : [
      {
         "min" : "160M",
         "max" : "1024M",
         "name" : "mem",
         "dflt" : "512M"
      },
      .
      .
      .
      {
         "min" : "1000K",
         "max" : "1000K",
         "name" : "bw",
         "dflt" : "1000K"
      }
   ],
   "volume" : {
      "name" : "dst"
   },
   "interface" : {
      "name" : "ext"
   },
   "name" : "main",
   "property" : [
      {
         "name" : "mode",
         "type" : "string",
         "values" : "manual|format|fscopy|fsck|fsrepair",
         "mandatory" : 1
      },
      {
         "name" : "fs_type_src",
         "type" : "string",
         "values" : "ext2|ext3|ext4|fat16|fat32|reiserfs|swap|ext3-
snapshot|iso9660|partitioned|ufssol|zfs|raw",
         "dflt" : ""
      },
      {
         "name" : "fs_type_dst",
         "type" : "string",
         "values" : "ext2|ext3|ext4|fat16|fat32|reiserfs|swap|ext3-
snapshot|iso9660|partitioned|ufssol|zfs|raw",
         "dflt" : ""
      },
      .
      .
      .
      {
         "name" : "adv_options",
         "type" : "string",
         "dflt" : ""
      }
   ]
}
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 (app). - Argument app=app missing in the request.

404.1

Entity not found – Permission denied – application ‘test’ does not exist.

start Method (app Object)
Description

Start an application

Syntax
/api/v2/app/start?app=application&vdc=controller-name 
Arguments
app

Name of the application to be started

vdc

Name of the target virtual data center

Options

See Application Control in the Command Line Shell Reference for descriptions of the options available for this command.

Transaction Type

asynchronous

Request Type

GET

Examples

Start an application named test.

GET http://192.168.123.200/api/v2/app/start?app=test&vdc=mygrid 
Sample Output
XML:
<job>be805915-76b2-48c8-b8a0-b881cca66da6</job>
JSON:
{
   "job" : "be805915-76b2-48c8-b8a0-b881cca66da6"
} 
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 (app). - Argument app=app missing in the request.

Note: To get the status of job, issue a /api/v2/job/info? request with the job_id returned above as the argument. For more information about how to obtain the job status, refer to the job object.

stop Method (app Object)
Description

Stop an application

Syntax
/api/v2/app/stop?app=application&vdc=controller-name 
Arguments
app

Name of the application to be stopped

vdc

Name of the target virtual data center

Transaction Type

asynchronous

Request Type

GET

Examples

Stop an application named test.

GET http://192.168.123.200/api/v2/app/stop?app=test&vdc=mygrid 
Sample Output
XML:
<job>be805915-76b2-48c8-b8a0-b881cca66da6</job>
JSON:
{
   "job" : "be805915-76b2-48c8-b8a0-b881cca66da6"
} 
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 (app). - Argument app=app missing in the request.

Note: To get the status of job, issue a /api/v2/job/info? request with the job_id returned above as the argument. For more information about how to obtain the job status, refer to the job object.

stop_all Method (app Object)

Note: This method has been deprecated and is included here for compatibility with existing user scripts. New users should use the stop command with the option flag &all.

Description

Stop all applications

Syntax
/api/v2/app/stop_all?vdc=controller-name 
Arguments
vdc

Name of the target virtual data center

Transaction Type

asynchronous

Request Type

GET

Examples

Stop all applications.

GET http://192.168.123.200/api/v2/app/stop_all?vdc=mygrid 
Sample Output
XML:
<job>be805915-76b2-48c8-b8a0-b881cca66da6</job>
JSON:
{
   "job" : "be805915-76b2-48c8-b8a0-b881cca66da6"
} 
HTTP Error Codes
404

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

Note: To get the status of job, issue a /api/v2/job/info? request with the job_id returned above as the argument. For more information about how to obtain the job status, refer to the job object.

copy Method (app Object)
Description

Copy an application

Syntax
/api/v2/app/copy?app=application&new_name=new-application&vdc=controller-name 
Arguments
app

Name of the application to be copied

new_name

Name of the new application

vdc

Name of the target virtual data center

Transaction Type

asynchronous

Request Type

GET

Examples

Copy an application named test to test2.

GET http://192.168.123.200/api/v2/app/copy?app=test&new_name=test2&vdc=mygrid 
Sample Output
XML:
<job>be805915-76b2-48c8-b8a0-b881cca66da6</job>
JSON:
{
   "job" : "be805915-76b2-48c8-b8a0-b881cca66da6"
} 
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 (app). - Argument app=app missing in the request.

400.4

Missing required arguments (new_name). - Argument new=new-name missing in the request.

Note: To get the status of job, issue a /api/v2/job/info? request with the job_id returned above as the argument. For more information about how to obtain the job status, refer to the job object.

restart Method (app Object)
Description

Restart an application

Syntax
/api/v2/app/restart?app=application&vdc=controller-name 
Arguments
app

Name of the application to be restarted

vdc

Name of the target virtual data center

Transaction Type

asynchronous

Request Type

GET

Examples

Restart an application named test.

GET http://192.168.123.200/api/v2/app/restart?app=test&vdc=mygrid 
Sample Output
XML:
<job>be805915-76b2-48c8-b8a0-b881cca66da6</job>
JSON:
{
   "job" : "be805915-76b2-48c8-b8a0-b881cca66da6"
} 
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 (app). - Argument app=app missing in the request.

Note: To get the status of job, issue a /api/v2/job/info? request with the job_id returned above as the argument. For more information about how to obtain the job status, refer to the job object.

migrate Method (app Object)
Description

Migrate an application from a remote grid

Syntax
/api/v2/app/migrate?grid=remote-grid&app=application&vdc=controller-name 
Arguments
grid

Controller IP or FQDN of a remote grid

app

Name of the application to be migrated

vdc

Name of the target virtual data center

Options

See Application Control in the Command Line Shell Reference for descriptions of the options available for this command.

Note: The migrate method does not support SSH agent forwarding.

Transaction Type

asynchronous

Request Type

GET

Examples

Migrate an application named test from remote-grid.mygrid.net.

GET http://192.168.123.200/api/v2/app/migrate?grid=remote-grid.mygrid.net&app=test&vdc=mygrid 
Sample Output
XML:
<job>be805915-76b2-48c8-b8a0-b881cca66da6</job>
JSON:
{
   "job" : "be805915-76b2-48c8-b8a0-b881cca66da6"
} 
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 (app). - Argument app=app missing in the request.

400.4

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

Note: To get the status of job, issue a /api/v2/job/info? request with the job_id returned above as the argument. For more information about how to obtain the job status, refer to the job object.

lock Method (app Object)
Description

Lock an application

Syntax
/api/v2/app/lock?app=application&pwd=password&vdc=controller-name 
Arguments
app

Name of the application

pwd

Password

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Lock application test.

GET http://192.168.123.200/api/v2/app/lock?app=test&pwd=password&vdc=mygrid 
Sample Output
XML:
<message></message>
JSON:
{
   "message" :""
}
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 (app). - Argument app=app missing in the request.

400.4

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

404.1

Application test does not exist. - An invalid application name was specified in the request.

Note: The password that is used to lock an application is required to unlock the application. When an application is locked, no volumes belonging to the application may be managed and the application cannot be modified in any way.

unlock Method (app Object)
Description

Unlock an application

Syntax
/api/v2/app/unlock?app=application&pwd=password&vdc=controller-name 
Arguments
app

Name of the application

pwd

Password

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Unlock application test.

GET http://192.168.123.200/api/v2/app/unlock?app=test&pwd=password&vdc=mygrid 
Sample Output
XML:
<message></message>
JSON:
{
   "message" :""
}
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 (app). - Argument app=app missing in the request.

400.4

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

404.1

Application test does not exist. - An invalid application name was specified in the request.

Note: If the application was locked with a password, the passwords must match. If the application was locked without a password, then only an administrator may unlock the application.

exec Method (app Object)
Description

Run a shell command on a specified application.

Syntax

/api/v2/app/exec?app=application&cmd=command&vdc=controller-name

Arguments
app

Name of the application

cmd

Shell command to run.

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Run the ‘df’ command on application test.

GET http://192.168.123.200/api/v2/app/exec?app=test&cmd=’df’&vdc=mygrid 
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 (cmd). - Argument cmd=command missing in the request.

404.1

Application test does not exist. - An invalid application name was specified in the request.

Note: The command will not run unless an ACL is set on the target application to authorize the user representing the Web Services API to control the application.

clean Method (app Object)
Description

Clean instantiated application volumes

Syntax
/api/v2/app/clean?app=application&vdc=controller-name 
Arguments
app

Name of the application

vdc

Name of the target virtual data center

Transaction Type

asynchronous

Request Type

GET

Examples

Clean application named test

GET http://192.168.123.200/api/v2/app/clean?app=test&vdc=mygrid 
Sample Output
XML:
<job>be805915-76b2-48c8-b8a0-b881cca66da6</job>
JSON:
{
   "job" : "be805915-76b2-48c8-b8a0-b881cca66da6"
}
 
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 (app). - Argument app=app missing in the request.

Note: To get the status of job, issue a /api/v2/job/info? request with the job_id returned above as the argument. For more information about how to obtain the job status, refer to the job object.

build Method (app Object)
Description

Prepare application for running.

Syntax
/api/v2/app/build?app=application&vdc=controller-name 
Arguments
app

Name of the application

vdc

Name of the target virtual data center

Transaction Type

asynchronous

Request Type

GET

Examples

Build application named test

GET http://192.168.123.200/api/v2/app/build?app=test&vdc=mygrid 
Sample Output
XML:
<job>be805915-76b2-48c8-b8a0-b881cca66da6</job>
JSON:
{
   "job" : "be805915-76b2-48c8-b8a0-b881cca66da6"
}

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 (app). - Argument app=app missing in the request.

Note: To get the status of job, issue a /api/v2/job/info? request with the job_id returned above as the argument. For more information about how to obtain the job status, refer to the job object.

continue Method (app Object)
Description

Continue starting of an application.

Syntax
/api/v2/app/continue?app=application&vdc=controller-name 
Arguments
app

Name of the application

vdc

Name of the target virtual data center

Transaction Type

asynchronous

Request Type

GET

Examples

Continue starting of application named test

GET http://192.168.123.200/api/v2/app/continue?app=test&vdc=mygrid 
Sample Output
XML:
<job>be805915-76b2-48c8-b8a0-b881cca66da6</job>
JSON:
{
   "job" : "be805915-76b2-48c8-b8a0-b881cca66da6"
}

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 (app). - Argument app=app missing in the request.

Note: To get the status of job, issue a /api/v2/job/info? request with the job_id returned above as the argument. For more information about how to obtain the job status, refer to the job object.

repair Method (app Object)
Description

Repair an application.

Syntax
/api/v2/app/repair?app=application&vdc=controller-name 
Arguments
app

Name of the application

vdc

Name of the target virtual data center

Transaction Type

asynchronous

Request Type

GET

Examples

Repair application named test

GET http://192.168.123.200/api/v2/app/repair?app=test&vdc=mygrid 
Sample Output
XML:
<job>be805915-76b2-48c8-b8a0-b881cca66da6</job>
JSON:
{
   "job" : "be805915-76b2-48c8-b8a0-b881cca66da6"
}

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 (app). - Argument app=app missing in the request.

Note: To get the status of job, issue a /api/v2/job/info? request with the job_id returned above as the argument. For more information about how to obtain the job status, refer to the job object.

export Method (app Object)
Description

Export an application.

Syntax
/api/v2/app/export?app=application&target=directory-or-file&vdc=controller-name
Arguments
app

Name of the application

directory-or-file (optional)

One of the following:

Exchange Directory Name

Name of the exchange directory relative to /vol/_impex where the application is to be exported to.

Default: application name

Tar File Name

Name of tar file that is supposed to contain the exported application. The specified file must have one of the following extensions:

.tar

Creates a tar archive without compression

.tar.gz

Creates a zipped tar archive

.tar.bz2

Creates a bzip2 tar archive

vdc

Name of the target virtual data center

Transaction Type

asynchronous

Request Type

GET

Examples

Export application named test:

GET http://192.168.123.200/api/v2/app/export?app=test&vdc=mygrid 

Export application named test to compressed tar file test.tar.gz:

GET http://192.168.123.200/api/v2/app/export?app=test&target=test.tar.bz2&vdc=mygrid
Sample Output
XML:
<job>be805915-76b2-48c8-b8a0-b881cca66da6</job>
JSON:
{
   "job" : "be805915-76b2-48c8-b8a0-b881cca66da6"
}

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 (app). - Argument app=app missing in the request.

Note: To get the status of job, issue a /api/v2/job/info? request with the job_id returned above as the argument. For more information about how to obtain the job status, refer to the job object.

import Method (app Object)
Description

Import an application.

Syntax
/api/v2/app/import?app=application&target=directory-or-file&vdc=controller-name
Arguments
app

Name of the application

directory-or-file (optional)

One of the following:

Exchange Directory Name

Name of the exchange directory relative to /vol/_impex where the application is to be imported from.

Default: application name

Tar File Name

Name of tar file, optionally compressed to gzip or bzip2 format.

vdc

Name of the target virtual data center

Transaction Type

asynchronous

Request Type

GET

Examples

Import application named test:

GET http://192.168.123.200/api/v2/app/import?app=test&vdc=mygrid 

Import application named test, from sub-directory myapps:

GET http://192.168.123.200/api/v2/app/import?app=test&target=myapps&vdc=mygrid 
Sample Output

XML

<job>be805915-76b2-48c8-b8a0-b881cca66da6</job>


JSON

{
   "job" : "be805915-76b2-48c8-b8a0-b881cca66da6"
}

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 (app). - Argument app=app missing in the request.

Note: To get the status of job, issue a /api/v2/job/info? request with the job_id returned above as the argument. For more information about how to obtain the job status, refer to the job object.

get_desc Method (app Object)
Description

Retrieve application package descriptor.

Syntax
/api/v2/app/get_desc?app=application&vdc=controller-name
Arguments
app

Name of the application

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Retrieve package descriptor of application test

GET http://192.168.123.200/api/v2/app/get_desc?app=test&vdc=mygrid 
Sample Output
XML:
<message>package test
   { 
   type          = application 
   description   = quot;test description&quot; 
   uid           = 12 
 
   package local : file = local/package.desc , type      = catalog 
 
   class top     : top                       , singleton 
   class main    : file = main.desc          , singleton 
   } 
 
assembly top 
   { 
   .category        = General 
 
   subordinate main : .class = main 
 
   visual 
      { 
      color = gray 
      style = small 
      pan_x = 0 
      pan_y = 0 
      } 
   } 
</message>
JSON:
{ 
   "message" : "package test\n   {\n   type          = application\n   description   = \"test description\"\n uid           = 12\n\n   package local : file = local/package.desc , type      = catalog\n\n   class top : top                       , singleton\n   class main    : file = main.desc          , singleton\n   }\n\nassembly top\n   {\n   .category = General\n\n   subordinate main : .class = main\n\n visual\n      {\n      color = gray\n      style = small\n pan_x = 0\n      pan_y = 0\n      }\n   }\n"
}

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 (app). - Argument app=app missing in the request.

404.1

Entity not found – Permission denied – application ‘test’ does not exist.

put_desc Method (app Object)
Description

Replace application package descriptor.

Syntax
/api/v2/app/put_desc?vdc=controller-name -F app=application -F desc=@descriptor-file
Arguments
app

Name of the application

desc

Name of the package descriptor file

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

POST: multipart/form-data

Examples

Replace package descriptor of application named test

POST http://192.168.123.200/api/v2/app/put_desc?vdc=mygrid -F app=app -F desc=@desc.txt 
Sample Output
XML:
<message></message>
JSON:
{ 
   "message" : "" 
}

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 (app). - Argument app=app missing in the request.

404.1

Entity not found – Permission denied – application ‘test’ does not exist.

Note: Currently only requests of type “multipart/form-data” are supported. The descriptor file is expected to be UDL compliant.

get_acl Method (app Object)
Description

Retrieve the application ACL, or portion of the application ACL, that relates to a particular principal.

Syntax
/api/v2/app/get_acl?app=application&principal=<principal>&vdc=controller-name
Arguments
app

Name of the application

principal

A URL-encoded principal. For example, local:user:api@3tera.com should be passed as local%3Auser%3Aapi%403tera.com

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Example: Retrieve Application ACL

Retrieve application ACL for application test

GET http://192.168.123.200/api/v2/app/get_acl?app=test&principal=&vdc=mygrid 
Sample Output
JSON:
{
   "acl" : {
      "owner" : {
         "id" : ""
      },
      "entries" : [
         {
            "configure" : 1,
            "id" : "778fee4e-9b83-4160-8b79-8bb0e1a87af8"
         }
      ]
   }
}

XML:

<acl>
  <entries>
    <entry>
      <configure>1</configure>
      <id>778fee4e-9b83-4160-8b79-8bb0e1a87af8</id>
    </entry>
  </entries>
  <owner>
    <id></id>
  </owner>
</acl>

Example: Retrieve the ACL Data for principal

Retrieve the ACL data for principal local:user:api@3tera.com for application test.

GET
http://192.168.123.200/api/v2/app/get_acl?app=test&principal=local%3Auser%3Aapi%403tera.com&vdc=mygrid
Sample Output
JSON:

{
   "acl" : {
      "owner" : {
         "id" : ""
      },
      "entries" : [
         {
            "id" : "f9939715-e340-4e09-b179-f61e3b031338",
            "full" : 1
         },
         {
            "id" : "932b639b-2f78-4415-9c3b-22a2a98ce9fe",
            "full" : 1
         },
         {
            "configure" : 1,
            "id" : "778fee4e-9b83-4160-8b79-8bb0e1a87af8"
         }
      ]
   }
}

XML:

<acl>
  <entries>
    <entry>
      <full>1</full>
      <id>f9939715-e340-4e09-b179-f61e3b031338</id>
    </entry>
    <entry>
      <full>1</full>
      <id>932b639b-2f78-4415-9c3b-22a2a98ce9fe</id>
    </entry>
    <entry>
      <configure>1</configure>
      <id>778fee4e-9b83-4160-8b79-8bb0e1a87af8</id>
    </entry>
  </entries>
  <owner>
    <id></id>
  </owner>
</acl>

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 (app). 
- Argument app=app missing in the request.

Missing required arguments (principal)
- Argument principal=principal missing

404.1

Entity not found - Application test does not exist.

- An application was specified that does not exist on mygrid.

Entity not found - Failed to retrieve application ACL - ACL does not contain principal local user 'test@3tera.com'.

- An invalid principal was specified

Note: This API is available with WS_API_r6-1.0.6-1 and above.

put_acl Method (app Object)
Description

Replace the entire application ACL.

Syntax
/api/v2/app/put_acl?app=application&owner=<owner>&acl=<ACLs>&vdc=controller-name
Arguments
app

Name of the application

owner

A URL-encoded owner attribute of the application ACL to the specified principal. For example, local:user:api@3tera.com should be passed as local%3Auser%3Aapi%403tera.com

owner

A URL-encoded owner attribute of the grid ACL to the specified principal

acl

URL-encoded list of principals separated with a slash (/)

vdc

Name of the target virtual data center

Transaction Type

Synchronous

Request Type

GET

Examples

Replace the entire ACL for application test with an owner api@3tera.com

GET
http://192.168.123.200/api/v2/app/put_acl?app=test&owner=local%3Auser%3Aapi%403tera.com&acl=&vdc=mygrid 

Replace the entire ACL for application test with an owner api@3tera.com and principal local:user:api@3tera.com=full

GET
http://192.168.123.200/api/v2/app/put_acl?app=test&owner=local%3Auser%3Aapi%403tera.com&acl= local%3Auser%3Aapi%403tera.com%3Dfull&vdc=mygrid

Replace the entire ACL for application test with an owner api@3tera.com and principal local:user:api@3tera.com=full/local:user:test@3tera.com=configure.

GET
http://192.168.123.200/api/v2/app/put_acl?app=test&owner=local%3Auser%3Aapi%403tera.com&acl=local%3Auser%3Aapi%403tera.com%3Dfull%2Flocal%3Auser%3Atest%403tera.com%3Dconfigure&vdc=mygrid
Sample Output

JSON

{
   "message" : ""
} 

XML

<message></message>

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 (app). 
- Argument app=app missing in the request.

Missing required arguments (owner)

- Argument owner=owner

Missing required arguments (acl)

- Argument acl=acl missing

404.1

Entity not found - Application test does not exist.

- An application was specified that does not exist on mygrid.

Entity not found - Failed to put application ACL - invalid principal data - principal local user 'test@3tera.com' does not exist.

- An invalid owner or acl was specified

Notes

This API is available with WS_API_r6-1.0.6-1 and above.

modify_acl Method (app Object)
Description

Replace the portion of the application ACL that relates to the owner or a principal.

Syntax
/api/v2/app/modify_acl?app=application&acl=<ACLs>&vdc=controller-name
Arguments
app

Name of the application

acl

URL-encoded list of principals separated with a slash (/)

vdc

Name of the target virtual data center

Transaction Type

Synchronous

Request Type

GET

Examples

Modify the ACL for application test by replacing the owner with api@3tera.com

GET
http://192.168.123.200/api/v2/app/modify_acl?app=test&acl=local%3Auser%3Aapi%403tera.com%3Downer&vdc=mygrid

Modify the ACL for application test by replacing the owner api@3tera.com and principal local:user:api@3tera.com=full


GET
http://192.168.123.200/api/v2/app/modify_acl?app=test&acl=local%3Auser%3Aapi%403tera.com%3Downer%2Flocal%3Auser%3Aapi%403tera.com%3Dfull&vdc=mygrid

Modify the ACL for application by replacing the access levels for test@3tera.com and api@3tera.com and principal local:user:api@3tera.com=configure/local:user:test@3tera.com=read.

GET
http://192.168.123.200/api/v2/app/modify_acl?app=test&acl=local%3Auser%3Aapi%403tera.com%3Dconfigure%2Flocal%3Auser%3Atest%403tera.com%3Dread&vdc=mygrid
Sample Output
JSON:
{
   "message" : ""
} 

XML:

<message></message>
HTTP Error Codes
400

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

400.4

Missing required arguments (app)

- Argument app=app missing

Missing required arguments (acl)

- Argument acl=acl missing

404.1

Entity not found - Application test does not exist.

- An application was specified that does not exist on mygrid.

Entity not found - Failed to put application ACL - invalid principal data - principal local user 'test@3tera.com' does not exist.

- An invalid owner or acl was specified

Note: This API is available with WS_API_r6-1.0.6-1 and above.