Use this object to control user and group grid resource usage using quota specifications.
|
Method |
Description |
|
Define and manage warning and burst default thresholds for the grid |
|
|
List quota entries for users and groups |
|
|
Details quota entries for a specified user or group |
|
|
Set quota values for a user or a group |
|
|
Change quota data for a user or a group |
Display or set default warning and burst thresholds for the grid.
Get threshold values:
/api/v2/quota/config?vdc=controller-name
Set threshold values:
/api/v2/quota/config?vdc=controller-name&warn=warning-level&burst=burst-level
Name of the target virtual data center
Percentage of the grid’s resources past which consumption a warning is issued. 0 disables warnings.
Limits: 0-99
Percentage of the grid’s resources past which consumption a warning is issued. 0 disables resource usage beyond quota.
Notes:
synchronous
GET
Display default quota thresholds for a grid:
GET http://192.168.123.200/api/v2/quota/config?vdc=mygrid
Set the default warning threshold to 70%:
GET http://192.168.123.200/api/v2/quota/config?warn=70&vdc=mygrid
<quota_config> <burst>0</burst> <warn>75</warn> </quota_config>
{
"quota_config" : {
"warn" : "75",
"burst" : "0"
}
}
Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.
Invalid value ‘value’ specified for ‘resource’ parameter - The value assigned to the warn or burst parameter is out of range.
List quota entries for all users and groups of a grid.
/api/v2/quota/list?vdc=controller-name
Name of the target virtual data center
User or group for whom to display quota information. See Common Argument Types for details.
synchronous
GET
Obtain a detailed list of all quota entries:
GET http://192.168.123.200/api/v2/quota/list?vdc=mygrid&verbose
<quotas>
<quota>
<disk_used>724566016</disk_used>
<principal>all</principal>
<scope>local</scope>
<type>group</type>
</quota>
<quota>
<burst>75</burst>
<bw_allowed>17500000000</bw_allowed>
<bw_assigned>10000000000</bw_assigned>
<bw_available>10000000000</bw_available>
<cpu_allowed>17.5</cpu_allowed>
<cpu_assigned>10</cpu_assigned>
<cpu_available>17.5</cpu_available>
<description>Sample User</description>
<disk_allowed>37580963840</disk_allowed>
<disk_assigned>21474836480</disk_assigned>
<disk_available>20750270464</disk_available>
<disk_used>724566016</disk_used>
<mem_allowed>18790481920</mem_allowed>
<mem_assigned>10737418240</mem_assigned>
<mem_available>10737418240</mem_available>
<principal>ak</principal>
<scope>local</scope>
<type>user</type>
<warn>75</warn>
</quota>
</quotas>
{
"quota" : [
{
"principal" : "all",
"type" : "group",
"scope" : "local",
"disk_used" : "724566016"
},
{
"bw_allowed" : "17500000000",
"bw_assigned" : "10000000000",
"principal" : "ak",
"disk_available" : "20750270464",
"disk_assigned" : "21474836480",
"mem_available" : "10737418240",
"warn" : "75",
"scope" : "local",
"burst" : "75",
"description" : "Sample User",
"cpu_allowed" : "17.5",
"mem_allowed" : "18790481920",
"cpu_assigned" : "10",
"bw_available" : "10000000000",
"mem_assigned" : "10737418240",
"type" : "user",
"cpu_available" : "17.5",
"disk_used" : "724566016",
"disk_allowed" : "37580963840"
}
]
}
Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.
Display quota information for a specified user or group.
/api/v2/quota/info?principal=a-principal&vdc=controller-name
Name of the target virtual data center
User or group for whom to display quota information. A principal specification is one of the following:
Local user or group
Global user or group
A fully qualified principal name
where:
synchronous
GET
Display information for a user named john@CA.com.
GET http://192.168.123.200/api/v2/quota/info?principal=local:user:john@ca.com
<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>
{
"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"
}
}
}
Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.
Entity not found - There is no principal name match for principal.
Bad request syntax (URL) - missing required argument (principal).
Sets quota information for a user or group.
/api/v2/quota/put?principal=a-principal&vdc=controller-name
Name of the target virtual data center
User or group for whom to set quota information. A principal specification is one of the following:
Local user or group
Global user or group
A fully qualified principal name
where:
Arbitrary printable ASCII character string. Replace characters such as spaces with their hexadecimal representation (%hh), according to URL syntax.
Comma-separated list of tags sometimes used for billing purposes.
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.
Resource usage limits for processors.
Resource usage limits for memory (bytes).
Resource usage limits for bandwidth (bytes per second).
Resource usage limits for disk space (bytes).
Warning consumption threshold (as a percentage of total resources available), for the considered principal.
Burst resource consumption threshold (as a percentage of total resources available), for the considered principal.
synchronous
GET
Set quota values for a local user of the grid mygrid named john:
Get http://192.168.123.200/api/v2/quota/put?principal=local:user:john&vdc=mygrid&cpu=4&mem=200000000&bw=1000&disk=100000000000
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>
{
"message" : ""
}
Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.
Invalid value value specified for resource parameter. The value assigned to the warn or burst parameter is out of range.
Entity not found - There is no principal name match for principal.
Bad request syntax (URL) - missing required argument (principal).
Modifies existing quota information for a user or a group.
/api/v2/quota/modify?principal=a-principal&vdc=controller-name
Name of the target virtual data center
User or group for whom to update quota information. A principal specification is one of the following:
Local user or group
Global user or group
A fully qualified principal name
where:
Arbitrary printable ASCII character string. Replace characters such as spaces with their hexadecimal representation (%hh), according to URL syntax.
Comma-separated list of tags sometimes used for billing purposes.
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.
Resource usage limits for processors.
Resource usage limits for memory (bytes).
Resource usage limits for bandwidth (bytes per second).
Resource usage limits for disk space (bytes).
Warning consumption threshold (as a percentage of total resources available), for the considered principal.
Burst resource consumption threshold (as a percentage of total resources available), for the considered principal.
synchronous
GET
Modify existing quota values for a local user of the grid mygrid named john:
Get http://192.168.123.200/api/v2/quota/modify?principal=local:user:john&vdc=mygrid&cpu=5&mem=50000000&bw=2000&disk=50000000000&warn=85&burst=90
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>
{
"message" : ""
}
Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.
Invalid value value specified for resource parameter. The value assigned to the warn or burst parameter is out of range.
Entity not found - There is no principal name match for principal.
Bad request syntax (URL) - missing required argument (principal).
|
Copyright © 2013 CA Technologies.
All rights reserved.
|
|