Previous Topic: unlock Method (template Object)Next Topic: app Object


get_acl Method (template Object)
Description

Retrieve the template ACL, or portion of the template ACL which relates to a particular principal.

Syntax
/api/v1/template/get_acl?template=template&principal=<principal>&vdc=controller-name 
Arguments
template

Name of the template

principal

A URL-encoded principal

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Example: Retrieve application ACL

Retrieve application ACL for template VDS_CentOS.

GET http://192.168.123.200/api/v1/template/get_acl?template=VDS_CentOS&principal=&vdc=mygrid 
Sample Output
JSON:
{
   "acl" : {
      "owner" : {
         "id" : "b543eff7-db88-4d79-a11c-4de22d5e6d3b"
      },
      "entries" : {
         "entries[0]" : {
            "id" : "4f865f5b-e63a-410a-9d9a-96427c3ecfc7",
            "full" : 1
         },
         "entries[1]" : {
            "id" : "b543eff7-db88-4d79-a11c-4de22d5e6d3b",
            "full" : 1
         }
      }
   }
}

XML:

<acl>
  <entries>
    <name>entries[0]</name>
    <full>1</full>
    <id>4f865f5b-e63a-410a-9d9a-96427c3ecfc7</id>
  </entries>
  <entries>
    <name>entries[1]</name>
    <configure>1</configure>
    <id>b543eff7-db88-4d79-a11c-4de22d5e6d3b</id>
  </entries>
  <owner>
    <id>b543eff7-db88-4d79-a11c-4de22d5e6d3b</id>
  </owner>
</acl> 

Example: Display the ACL data for principal

Display the ACL data for principal local:user:api@3tera.com for template VDS_CentOS

GET http://192.168.123.200/api/v1/template/get_acl?template=VDS_CentOS&principal=local%3Auser%3Aapi%403tera.com&vdc=mygrid
Sample Output
JSON:
{
   "acl" : {
      "entries" : {
         "entries[0]" : {
            "id" : "4f865f5b-e63a-410a-9d9a-96427c3ecfc7",
            "full" : 1
         }
      }
   }

XML:

<acl>
  <entries>
    <name>entries[0]</name>
    <full>1</full>
    <id>4f865f5b-e63a-410a-9d9a-96427c3ecfc7</id>
  </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 (template)

- Argument app=app missing

Missing required arguments (principal)

- Argument principal=principal missing

404.1

Entity not found - Application test does not exist.

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

Replace the entire template ACL.

Syntax
/api/v1/template/put_acl?template=template&owner=<owner>&acl=<ACLs>&vdc=controller-name 
Arguments
template

Name of the template

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 template application VDS_CentOS with an owner api@3tera.com

GET
http://192.168.123.200/api/v1/template/put_acl?template=VDS_CentOS&owner=local%3Auser%3Aapi%403tera.com&acl=&vdc=mygrid

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


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

Replace the entire ACL for template application VDS_CentOS 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/v1/template/put_acl?template=VDS_CentOS&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 (template)

- Argument template=template missing

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.

- A template 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

modify_acl Method (template Object)
Description

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

Syntax
/api/v1/template/modify_acl?template=template&acl=<ACLs>&vdc=controller-name 
Arguments
template

Name of the template

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 template application VDS_CentOS by replacing the owner with api@3tera.com

GET
http://192.168.123.200/api/v1/template/modify_acl?template=VDS_CentOS&acl=local%3Auser%3Aapi%403tera.com%3Downer&vdc=mygrid

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

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

Modify the ACL for template application VDS_CentOS 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/v1/template/modify_acl?template=VDS_CentOS&acl=local%3Auser%3Aapi%403tera.com%3Dconfigure%2Flocal%3Auser%3Atest%403tera.com%3Dread&vdc=mygrid

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 (template)

- Argument template=template missing

Missing required arguments (acl)

- Argument acl=acl missing

404.1

Entity not found - Template VDS_CentOS does not exist.

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

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

- An invalid owner or acl was specified

Sample Output
JSON:
{
   "message" : ""
} 
XML:
<message></message>

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