Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Wuwan, Qi <wuwanqi1@noreply.gitea.eco.tsi-dev.otc-service.com> Co-committed-by: Wuwan, Qi <wuwanqi1@noreply.gitea.eco.tsi-dev.otc-service.com>
16 KiB
Obtaining the Real-Time Resource Usage
Function
This API is used to obtain the real-time usage of all resource pools in the current project.
URI
GET /v2/{project_id}/metrics/runtime/pools
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
project_id |
Yes |
String |
Project ID. For details, see Obtaining a Project ID and Name. |
Request Parameters
None
Response Parameters
Status code: 200
Parameter |
Type |
Description |
|---|---|---|
apiVersion |
String |
Resource version. Options:
|
kind |
String |
Resource type. Options:
|
items |
Array of MetricsItem objects |
Metric list |
Parameter |
Type |
Description |
|---|---|---|
table |
MetricTableItem object |
Resource list |
metadata |
ResourceMetricsMetadata object |
Metadata of resource metrics |
Parameter |
Type |
Description |
|---|---|---|
allocated |
Allocated object |
Information about allocated resources. |
capacity |
Capacity object |
Resource capacity information. |
Parameter |
Type |
Description |
|---|---|---|
value |
Value object |
Resource amount |
timestamp |
String |
UTC time, in the format of yyyy-MM-dd'T'HH:mm:ss'Z' |
window |
String |
Statistics interval. 1s indicates 1 second, 1m indicates 1 minute, and 1h indicates 1 hour. |
Parameter |
Type |
Description |
|---|---|---|
value |
Value object |
Resource amount |
maxValue |
Value object |
Maximum number of elastic resources |
timestamp |
String |
UTC time, in the format of yyyy-MM-dd'T'HH:mm:ss'Z' |
window |
String |
Statistics interval. 1s indicates 1 second, 1m indicates 1 minute, and 1h indicates 1 hour. |
Example Requests
Obtain the real-time resource usage of a resource pool.
GET https://{endpoint}/v2/{project_id}/metrics/runtime/pools
Example Responses
Status code: 200
OK
{
"apiVersion" : "v2",
"kind" : "PoolMetricsList",
"items" : [ {
"table" : {
"allocated" : {
"value" : {
"cpu" : 5,
"memory" : "15548Mi",
"tnt004" : "1073m"
},
"timestamp" : "2022-03-30T07:09:10Z",
"window" : "1m"
},
"capacity" : {
"value" : {
"cpu" : 16,
"memory" : "64Gi",
"tnt004" : 2
},
"maxValue" : {
"cpu" : 16,
"memory" : "64Gi",
"tnt004" : 2
},
"timestamp" : "2022-03-30T07:09:10Z",
"window" : "1m"
}
},
"metadata" : {
"name" : "hougang-rse-pool"
}
} ]
}
Status Codes
Status Code |
Description |
|---|---|
200 |
OK |
Error Codes
See Error Codes.