Previous Topic: class ObjectNext Topic: lock Method (class Object)


list Method (class Object)
Description

Retrieve list of classes in a package

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

Name of the package

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Retrieve list of classes in /test.

GET http://192.168.123.200/api/v1/class/list?class=/test&vdc=mygrid 
Sample Output
XML:
<catalog>
   <name>filer</name>
   <class>
      <class>
         <name>Filer_Linux</name>
         <category>Filer</category>
         <description>Linux Filer based on Ubuntu 7.04 (v3.1.2-1)</description>
         <locked>1</locked>
      </class>
       <class>
         <name>Filer_Solaris</name>
          <category>Filer</category>
         <description>Solaris Filer based on OpenSolaris build 2008.11 (v3.1.5-1)</description>
         <locked>1</locked>
      </class>
   </class>
</catalog>
JSON:
{
   "name" : "filer",
   "class" : [
       {
         "locked" : 1,
         "name" : "Filer_Linux",
         "category" : "Filer",
         "description" : "Linux Filer based on Ubuntu 7.04 v3.1.2-1)"
         },
      {
      "locked" : 1,
         "name" : "Filer_Solaris",
         "category" : "Filer",
         "description" : "Solaris Filer based on OpenSolaris build 2008.11 (v3.1.5-1)"
       }
   ]
} 

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

404.1

Application test does not exist. - Invalid application specified in the request.

404.1

Global catalog 'test' not found. - Invalid global catalog specified in the request.

move Method (class Object)
Description

Rename a class, or move a class from one package to another

Syntax
/api/v1/class/move?class=class&new_name=new-class&vdc=controller-name 
Arguments
class

Name of the class to be moved

new_name

Name of the new class

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Move /test:LUX5 to /test2:LUX5.

GET http://192.168.123.200/api/v1/class/move?class=/test:LUX5&new_name=/test2:LUX5&vdc=mygrid 
Sample Output
XML:
None
JSON:
None 

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

400.4

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

404.1

Could not find class LUX5 in source package. - Invalid class specified in the request.

404.1

Unable to move class '/system:LUX5' from read-only catalog 'system'. - Read-only source catalog specified in the request.

404.1

Unable to move class '/test:LUX5' into read-only catalog 'system'. - Read-only destination catalog specified in the request.

404.1

Global catalog 'test' not found. - Invalid source/destination catalog name specified in the request.

404.1

Failed to move volume boot. - Class volume is in-use or same source and destination catalog specified.

copy Method (class Object)
Description

Copy a class from one package to another

Syntax
/api/v1/class/copy?class=class&new_name=new-class&vdc=controller-name 
Arguments
class

Name of the class to be copied

new_name

Name of the new class

vdc

Name of the target virtual data center

Transaction Type

asynchronous

Request Type

GET

Examples

Copy /system:LUX5 to /test:LUX5.

GET http://192.168.123.200/api/v1/class/copy?class=/system:LUX5&new_name=/test:LUX5&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 (class). - Argument class=entity missing in the request.

400.4

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

Note: To get the status of job, issue a /api/v1/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 (class Object)
Description

Destroy a class

Syntax
/api/v1/class/destroy?class=class&vdc=controller-name 
Arguments
class

Name of the class to be destroyed

vdc

Name of the target virtual data center

Transaction Type

asynchronous

Request Type

GET

Examples

Destroy /test:LUX5.

GET http://192.168.123.200/api/v1/class/destroy?class=/test:LUX5&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 (class). - Argument class=entity missing in the request.

Note: To get the status of job, issue a /api/v1/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.