Previous Topic: quota ObjectNext Topic: log Object


list Method (quota Object)
Description

List quota entries for all users and groups of a grid.

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

Name of the target virtual data center

principal (optional)

User or group for whom to display quota information. See Common Argument Types for details.

Transaction Type

synchronous

Request Type

GET

Examples

Obtain a detailed list of all quota entries:

GET http://192.168.123.200/api/v1/quota/list?vdc=mygrid&verbose
Sample Output
XML:
{
   "quota1" : {
      "bw_allowed" : "3900000000",
      "bw_assigned" : "2000000000",
      "principal" : "specops",
      "disk_available" : "487500000000",
      "disk_assigned" : "250000000000",
      "mem_available" : "78000000000",
      "warn" : "80",
      "scope" : "local",
      "burst" : "95",
      "cpu_allowed" : "19",
      "mem_allowed" : "78000000000",
      "cpu_assigned" : "10",
      "bw_available" : "3900000000",
      "mem_assigned" : "40000000000",
      "type" : "group",
      "cpu_available" : "19",
      "disk_allowed" : "487500000000"
   },
   "quota0" : {
      "bw_allowed" : "1900000000",
      "bw_assigned" : "1000000000",
      "bw_used" : "631000000",
      "principal" : "gabriel@ca.com",
      "disk_available" : "89846248960",
      "disk_assigned" : "50000000000",
      "mem_available" : "16986734080",
      "warn" : "80",
      "cpu_used" : "1.25",
      "scope" : "local",
      "mem_used" : "2013265920",
      "burst" : "90",
      "cpu_allowed" : "11",
      "bw_available" : "1269000000",
      "mem_allowed" : "19000000000",
      "cpu_assigned" : "6",
      "mem_assigned" : "10000000000",
      "type" : "user",
      "cpu_available" : "9.75",
      "disk_allowed" : "95000000000",
      "disk_used" : "5153751040"
   }
}
JSON:
<opt>
  <quota0>
    <burst>90</burst>
    <bw_allowed>1900000000</bw_allowed>
    <bw_assigned>1000000000</bw_assigned>
    <bw_available>1269000000</bw_available>
    <bw_used>631000000</bw_used>
    <cpu_allowed>11</cpu_allowed>
    <cpu_assigned>6</cpu_assigned>
    <cpu_available>9.75</cpu_available>
    <cpu_used>1.25</cpu_used>
    <disk_allowed>95000000000</disk_allowed>
    <disk_assigned>50000000000</disk_assigned>
    <disk_available>89846248960</disk_available>
    <disk_used>5153751040</disk_used>
    <mem_allowed>19000000000</mem_allowed>
    <mem_assigned>10000000000</mem_assigned>
    <mem_available>16986734080</mem_available>
    <mem_used>2013265920</mem_used>
    <principal>gabriel@ca.com</principal>
    <scope>local</scope>
    <type>user</type>
    <warn>80</warn>
  </quota0>
  <quota1>
    <burst>95</burst>
    <bw_allowed>3900000000</bw_allowed>
    <bw_assigned>2000000000</bw_assigned>
    <bw_available>3900000000</bw_available>
    <cpu_allowed>19</cpu_allowed>
    <cpu_assigned>10</cpu_assigned>
    <cpu_available>19</cpu_available>
    <disk_allowed>487500000000</disk_allowed>
    <disk_assigned>250000000000</disk_assigned>
    <disk_available>487500000000</disk_available>
    <mem_allowed>78000000000</mem_allowed>
    <mem_assigned>40000000000</mem_assigned>
    <mem_available>78000000000</mem_available>
    <principal>specops</principal>
    <scope>local</scope>
    <type>group</type>
    <warn>80</warn>
  </quota1>
</opt>
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 (quota Object)
Description

Display quota information for a specified user or group.

Syntax
/api/v1/quota/info?principal=a-principal&vdc=controller-name 
Arguments
vdc

Name of the target virtual data center

principal

User or group for whom to display quota information. A principal specification is one of the following:

<name>

Local user or group

/<name>

Global user or group

<scope>:<type>:<name>

A fully qualified principal name

where:

  • <scope> is global or local
  • <type> is group or user
  • <name> is the group or the user name
Transaction Type

synchronous

Request Type

GET

Examples

Display information for a user named john@CA.com.

GET http://192.168.123.200/api/v1/quota/info?principal=local:user:john@ca.com
Sample Output
XML:
<quota>
  <burst>90</burst>
  <principal>
    <name>laura@ca.com</name>
    <scope>local</scope>
    <type>user</type>
  </principal>
  <resources allowed>
    <bw>1900000000</bw>
    <cpu>11</cpu>
    <disk>95000000000</disk>
    <mem>19000000000</mem>
  </resources allowed>
  <resources assigned>
    <bw>1000000000</bw>
    <cpu>6</cpu>
    <disk>50000000000</disk>
    <mem>10000000000</mem>
  </resources assigned>
  <warn>80</warn>
</quota>
JSON:
{
   "quota" : {
      "warn" : "80",
      "burst" : "90",
      "principal" : {
         "name" : "laura@ca.com",
         "type" : "user",
         "scope" : "local"
      },
      "resources assigned" : {
         "bw" : "1000000000",
         "cpu" : "6",
         "disk" : "50000000000",
         "mem" : "10000000000"
      },
      "resources allowed" : {
         "bw" : "1900000000",
         "cpu" : "11",
         "disk" : "95000000000",
         "mem" : "19000000000"
      }
   }
}
HTTP Error Codes
404

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

404.1

Entity not found - There is no principal name match for principal.

400.4

Bad request syntax (URL) - missing required argument (principal).

put Method (quota Object)
Description

Sets quota information for a user or group.

Syntax
/api/v1/quota/put?principal=a-principal&vdc=controller-name 
Arguments
vdc

Name of the target virtual data center

principal

User or group for whom to set quota information. A principal specification is one of the following:

<name>

Local user or group

/<name>

Global user or group

<scope>:<type>:<name>

A fully qualified principal name

where:

  • <scope> is global or local
  • <type> is group or user
  • <name> is the group or the user name
description

Arbitrary printable ASCII character string. Replace characters such as spaces with their hexadecimal representation (%hh), according to URL syntax.

tags=tag1,tag2,…,tagN

Comma-separated list of tags sometimes used for billing purposes.

parent=group-name

Reference to the parent group quota. Because users have their parent group set to their primary group, you can only set this argument for a group.

cpu=value

Resource usage limits for processors.

mem=value

Resource usage limits for memory (bytes).

bw=value

Resource usage limits for bandwidth (bytes per second).

disk=value

Resource usage limits for disk space (bytes).

warn=percentage

Warning consumption threshold (as a percentage of total resources available), for the considered principal.

burst=percentage

Burst resource consumption threshold (as a percentage of total resources available), for the considered principal.

Transaction Type

synchronous

Request Type

GET

Examples

Set quota values for a local user of the grid mygrid named john:

Get http://192.168.123.200/api/v1/quota/put?principal=local:user:john&vdc=mygrid&cpu=4&mem=200000000&bw=1000&disk=100000000000
Sample Output
XML:
Upon success:

<message></message>
Upon exceeded quota:

<opt>
  <error>404.1</error>
  <message>Entity not found - Error: User Daniel has reached its bandwidth quota of 100.00 Mbps.</message>
</opt>
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.7

Invalid value value specified for resource parameter. The value assigned to the warn or burst parameter is out of range.

404.1

Entity not found - There is no principal name match for principal.

400.4

Bad request syntax (URL) - missing required argument (principal).

modify Method (quota Object)
Description

Modifies existing quota information for a user or a group.

Syntax
/api/v1/quota/modify?principal=a-principal&vdc=controller-name 
Arguments
vdc

Name of the target virtual data center

principal

User or group for whom to update quota information. A principal specification is one of the following:

<name>

Local user or group

/<name>

Global user or group

<scope>:<type>:<name>

A fully qualified principal name

where:

  • <scope> is global or local
  • <type> is group or user
  • <name> is the group or the user name
description

Arbitrary printable ASCII character string. Replace characters such as spaces with their hexadecimal representation (%hh), according to URL syntax.

tags=tag1,tag2,…,tagN

Comma-separated list of tags sometimes used for billing purposes.

parent=group-name

Reference to the parent group quota. Because users have their parent group set to their primary group, you can only set this argument for a group.

cpu=value

Resource usage limits for processors.

mem=value

Resource usage limits for memory (bytes).

bw=value

Resource usage limits for bandwidth (bytes per second).

disk=value

Resource usage limits for disk space (bytes).

warn=percentage

Warning consumption threshold (as a percentage of total resources available), for the considered principal.

burst=percentage

Burst resource consumption threshold (as a percentage of total resources available), for the considered principal.

Transaction Type

synchronous

Request Type

GET

Examples

Modify existing quota values for a local user of the grid mygrid named john:

Get http://192.168.123.200/api/v1/quota/modify?principal=local:user:john&vdc=mygrid&cpu=5&mem=50000000&bw=2000&disk=50000000000&warn=85&burst=90
Sample Output
XML:
Upon success:

<message></message>
Upon exceeded quota:

<opt>
  <error>404.1</error>
  <message>Entity not found - Error: User Laura has reached its bandwidth quota of 953.67 MB.</message>
</opt>
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.7

Invalid value value specified for resource parameter. The value assigned to the warn or burst parameter is out of range.

404.1

Entity not found - There is no principal name match for principal.

400.4

Bad request syntax (URL) - missing required argument (principal).