Previous Topic: vol ObjectNext Topic: class Object


cat Object

Use this object to manage catalogs on a VDC.

Method

Description

list

Retrieve list of global catalogs

info

Retrieve information for a local application or a global catalog

create

Create a new global catalog

destroy

Destroy a global or application catalog

rename

Rename a global catalog

migrate

Migrate a catalog from a remote grid

export

Export catalog

import

Import catalog

get_desc

Retrieve catalog package descriptor

put_desc

Replace catalog package descriptor

get_acl

Retrieve global catalog ACL

put_acl

Replace entire catalog ACL

modify_acl

Replace portion of catalog ACL

list Method (cat Object)
Description

Retrieve list of global catalog

Syntax
/api/v2/cat/list?vdc=controller-name 
Arguments
vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Retrieve a list of the catalogs.

GET http://192.168.123.200/api/v2/cat/list?vdc=mygrid 
Sample Output
XML:

<catalogs>
  <catalog>
    <description></description>
    <name>system_ms</name>
  </catalog>
  <catalog>
    <description></description>
    <name>system</name>
  </catalog>
  <catalog>
    <description></description>
    <name>dynamic</name>
  </catalog>
  <catalog>
    <description></description>
    <name>user</name>
  </catalog>
  <catalog>
    <description></description>
    <name>OUT_6492</name>
  </catalog>
  <catalog>
    <description></description>
    <name>filer</name>
  </catalog>
</catalogs>
JSON:

{
   "catalog" : [
      {
         "name" : "system_ms",
         "description" : ""
      },
      {
         "name" : "system",
         "description" : ""
      },
      {
         "name" : "dynamic",
         "description" : ""
      },
      {
         "name" : "user",
         "description" : ""
      },
      {
         "name" : "OUT_6492",
         "description" : ""
      },
      {
         "name" : "filer",
         "description" : ""
      }
   ]
}
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 (cat Object)
Description

Retrieve information for a local application or a global catalog

Syntax
/api/v2/cat/info?cat=catalog&vdc=controller-name 
Arguments
cat

Name of the catalog

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Retrieve information for catalog test.

GET http://192.168.123.200/api/v2/cat/info?cat=/test&vdc=mygrid 
Sample Output
XML:
<catalog>
   <name>test</name>
   <description></description>
   <total_classes>0</total_classes>
   <total_diskspace>0</total_diskspace>
</catalog>
JSON:
{
    "total_classes" : "0",
   "name" : "test",
   "description" : "",
   "total_diskspace" : "0"
} 

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

404.1

'test' is not a valid catalog - Invalid catalog specified in the request.

create Method (cat Object)
Description

Create a new global catalog

Syntax
/api/v2/cat/create?cat=catalog&vdc=controller-name 
Arguments
cat

Name of the new catalog

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Create a catalog named /test.

GET http://192.168.123.200/api/v2/cat/create?cat=/test&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 (cat). - Argument cat=catalog missing in the request.

404.1

'test' is not a valid catalog. - Invalid catalog specified in the request. Only global catalogs can be created.

destroy Method (cat Object)
Description

Destroy a global or application catalog

Syntax
/api/v2/cat/destroy?cat=catalog&vdc=controller-name 
Arguments
cat

Name of the catalog to be destroyed

vdc

Name of the target virtual data center

Transaction Type

asynchronous

Request Type

GET

Examples

Destroy a catalog named /test.

GET http://192.168.123.200/api/v2/cat/destroy?cat=/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 (cat). - Argument cat=catalog missing in the request.

Notes: 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 (cat Object)
Description

Rename global catalog

Syntax
/api/v2/cat/rename?cat=catalog&new_name=new-catalog&vdc=controller-name 
Arguments
cat

Name of the catalog to be renamed

new_name

New name of the catalog

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Rename /test catalog to /test2.

GET http://192.168.123.200/api/v2/cat/rename?cat=/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 (cat). - Argument cat=catalog missing in the request.

400.4

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

404.1

Catalog 'test' doesn't exist. - Invalid catalog specified in the request.

404.1

'test' is not a valid catalog. - Invalid new_name specified in the catalog.

migrate Method (cat Object)
Description

Migrate a catalog from a remote grid

Syntax
/api/v2/cat/migrate?cat=catalog&grid=remote-grid&vdc=controller-name 
Arguments
cat

Name of the catalog to migrate

grid

IP or FQDN of the remote grid

vdc

Name of the target virtual data center

Transaction Type

asynchronous

Request Type

GET

Examples

Migrate the test catalog from remote-grid.mygrid.net.

GET http://192.168.123.200/api/v2/cat/migrate?cat=test&grid=remote-grid.mygrid.net&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 (cat). - Argument cat=catalog 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.

export Method (cat Object)
Description

Export a catalog

Syntax
/api/v2/cat/export?cat=catalog&dir=directory&vdc=controller-name 
Arguments
cat

Name of the catalog

dir

Name of exchange directory relative to /vol/_impex where catalog is to be exported to

vdc

Name of the target virtual data center

Transaction Type

asynchronous

Request Type

GET

Examples

Export /test.

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

HTTP Error Codes
400.4

Missing required arguments (cat,dir) - Argument cat=cat and dir=dir missing

400.4

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

400.4

Missing required argument (dir) - Argument dir=dir missing

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 (cat Object)
Description

Import a catalog

Syntax
/api/v2/cat/import?cat=catalog&dir=directory&vdc=controller-name 
Arguments
cat

Name of the catalog

dir

Name of exchange directory relative to /vol/_impex where catalog is to be imported from

vdc

Name of the target virtual data center

Transaction Type

asynchronous

Request Type

GET

Examples

Import /test.

GET http://192.168.123.200/api/v2/cat/import?cat=/test&dir=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 (cat,dir) - Argument cat=cat and dir=dir missing

400.4

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

400.4

Missing required argument (dir) - Argument dir=dir missing

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 (cat Object)
Description

Retrieve catalog package descriptor

Syntax
/api/v2/cat/get_desc?cat=catalog&vdc=controller-name 
Arguments
cat

Name of the catalog

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Retrieve package descriptor for /system.

GET http://192.168.123.200/api/v2/cat/get_desc?cat=/system&vdc=mygrid 
Sample Output
XML:
<message>package system 
   { 
   type = catalog 
 
   class HALB : file = HALB.desc 
 
   class IN : file = IN.desc 
 
   class INSSLR : file = INSSLR.desc 
 
   class LINUX5 : file = LINUX5.desc 
 
   class LINUX64 : file = LINUX64.desc 
 
   class LOAD : file = LOAD.desc 
 
   class LUX5 : file = LUX5.desc 
 
   class LUX64 : file = LUX64.desc 
 
   class L3LB : file = L3LB.desc 
 
   class MON : file = MON.desc 
 
   class MYSQLR : file = MYSQLR.desc 
 
   class MYSQLR64 : file = MYSQLR64.desc 
 
   class MYSQL5 : file = MYSQL5.desc 
 
   class NAS : file = NAS.desc 
 
   class NASR : file = NASR.desc 
 
   class NET : file = NET.desc 
 
   class OSOL : file = OSOL.desc 
 
   class OSOL64 : file = OSOL64.desc 
 
   class OUT : file = OUT.desc 
 
   class PGSQL64 : file = PGSQL64.desc 
 
   class PS8 : file = PS8.desc 
 
   class RPL : file = RPL.desc 
 
   class SQUID : file = SQUID.desc 
 
   class TOMCAT : file = TOMCAT.desc 
 
   class TOMCAT64 : file = TOMCAT64.desc 
 
   class URLSW : file = URLSW.desc 
 
   class VPN : file = VPN.desc 
 
   class WEBx4 : file = WEBx4.desc 
 
   class WEBx8 : file = WEBx8.desc 
 
   class WEB5 : file = WEB5.desc 
 
   class WEB64 : file = WEB64.desc 
 
   protocol mysql : filter = &quot;tcp_in:3306&quot; 
   protocol http : filter = &quot;tcp_in:80&quot; 
   protocol https : filter = &quot;tcp_in:443&quot; 
   protocol smtp : filter = &quot;tcp_in:25&quot; 
   protocol pgsql : filter = &quot;tcp_in:5432&quot; 
   protocol pop3 : filter = &quot;tcp_in:110&quot; 
   protocol nfs : filter = &quot;rpc:nfs&quot; 
   protocol syslog : filter = &quot;udp:514&quot; 
   protocol ssh : filter = &quot;tcp_in:22&quot; 
   protocol cce : filter = &quot;grb:90;ccs:91&quot; 
   protocol cifs : filter = &quot;tcp_in:445;udp:445&quot; 
   } 
</message>   
JSON:
{ 
   "message" : "package system\n   {\n   type = catalog\n\n   class HALB : file = HALB.desc\n\n   class IN : file = IN.desc\n\n   class INSSL : file = INSSL.desc\n\n   class INSSLR : file = INSSLR.desc\n\n   class LINUX5 : file = LINUX5.desc\n\n   class LINUX64 : file = LINUX64.desc\n\n   class LOAD : file = LOAD.desc\n\n   class LUX5 : file = LUX5.desc\n\n   class LUX64 : file = LUX64.desc\n\n   class L3LB : file = L3LB.desc\n\n   class MON : file = MON.desc\n\n   class MYSQLR : file = MYSQLR.desc\n\n   class MYSQLR64 : file = MYSQLR64.desc\n\n   class MYSQL5 : file = MYSQL5.desc\n\n   class NAS : file = NAS.desc\n\n   class NASR : file = NASR.desc\n\n   class NET : file = NET.desc\n\n   class OSOL : file = OSOL.desc\n\n   class OSOL64 : file = OSOL64.desc\n\n   class OUT : file = OUT.desc\n\n   class PGSQL64 : file = PGSQL64.desc\n\n   class PS8 : file = PS8.desc\n\n   class RPL : file = RPL.desc\n\n   class SQUID : file = SQUID.desc\n\n   class TOMCAT : file = TOMCAT.desc\n\n   class TOMCAT64 : file = TOMCAT64.desc\n\n   class URLSW : file = URLSW.desc\n\n   class VPN : file = VPN.desc\n\n   class WEBx4 : file = WEBx4.desc\n\n   class WEBx8 : file = WEBx8.desc\n\n   class WEB5 : file = WEB5.desc\n\n   class WEB64 : file = WEB64.desc\n\n   protocol mysql : filter = \"tcp_in:3306\"\n   protocol http : filter = \"tcp_in:80\"\n   protocol https : filter = \"tcp_in:443\"\n   protocol smtp : filter = \"tcp_in:25\"\n   protocol pgsql : filter = \"tcp_in:5432\"\n   protocol pop3 : filter = \"tcp_in:110\"\n   protocol nfs : filter = \"rpc:nfs\"\n   protocol syslog : filter = \"udp:514\"\n   protocol ssh : filter = \"tcp_in:22\"\n   protocol cce : filter = \"grb:90;ccs:91\"\n   protocol cifs : filter = \"tcp_in:445;udp:445\"\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 (cat) - Argument cat=cat missing

404.1

Request processing failed - Global catalog 'test' not found - Invalid catalog specified

put_desc Method (cat Object)
Description

Replace catalog package descriptor

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

Name of the catalog

desc

Name of the descriptor file

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

POST: multipart/form-data

Examples

Replace descriptor for /test

POST http://192.168.123.200/api/v2/cat/put_desc?vdc=mygrid -F cat=cat -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 (cat) - Argument cat=cat missing

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

get_acl Method (cat Object)
Description

Retrieve the global catalog ACL, or display that portion of the global catalog ACL which relates to a particular principal.

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

Name of the catalog

principal

A URL-encoded principal

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Example: URL-encoded principal

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

GET http://192.168.123.200/api/v2/cat/get_acl?cat=/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: Display ACL data for principal

Display the ACL data for principal local:user:api@3tera.com for catalog test

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

Sample Output
JSON:

{
   "acl" : {
      "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>
</acl>

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 (cat)
- Argument cat=cat missing

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

404.1

Entity not found - Catalog test does not exist.

- A catalog 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 (cat Object)
Description

Replace the entire catalog ACL.

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

Name of the catalog

owner

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

acl

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

Transaction Type

synchronous

Request Type

GET

Examples

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

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

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


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

Replace the entire ACL for catalog 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/cat/put_acl?cat=/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
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 (cat)
- Argument cat=cat missing

Missing required arguments (owner)

- Argument owner=owner

Missing required arguments (acl)

- Argument acl=acl missing

404.1

Entity not found - Catalog test does not exist.

- A catalog was specified that does not exist on mygrid.

Entity not found - Failed to put catalog 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.

modify_acl Method (cat Object)
Description

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

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

Name of the catalog

acl

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

Transaction Type

synchronous

Request Type

GET

Examples

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

GET
http://192.168.123.200/api/v2/cat/modify_acl?cat=/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/cat/modify_acl?cat=/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/cat/modify_acl?cat=/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 (cat)
- Argument cat=cat missing

Missing required arguments (acl)

- Argument acl=acl missing

404.1

Entity not found - Catalog test does not exist.

- A catalog was specified that does not exist on mygrid.

Entity not found - Failed to put catalog 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.