​
Select Service
ves-io-schema-views-workload-CustomDataAPI-Usage
Published April 5, 2023 | Last modified September 10, 2026
Examples of performing workload CustomDataAPI Usage
Usecase:
Get workload usage
Request:
Request using vesctl:
vesctl request rpc workload.CustomDataAPI.Usage -i request.yaml --uri /public/namespaces/documentation/workloads/usage --http-method POST
where file request.yaml has following contents:
endTime: "1593622800"fieldSelector:- CPU_USAGE- MEMORY_USAGEfilter: '{POD="adservice"}'groupBy:- POD- SITEnamespace: documentationstartTime: "1593619200"vesctl yaml response:
data:- data: - key: POD: adservice SITE: site-1 value: - timestamp: 1593622800 value: "0.1" - key: POD: adservice SITE: site-2 value: - timestamp: 1593622800 value: "0.01"- data: - key: POD: adservice SITE: site-1 value: - timestamp: 1593622800 value: "10485760" - key: POD: adservice SITE: site-2 value: - timestamp: 1593622800 value: "26214400" type: MEMORY_USAGERequest using curl:
curl -X 'POST' -d '{"namespace":"documentation","filter":"{POD=\"adservice\"}","group_by":["POD","SITE"],"field_selector":["CPU_USAGE","MEMORY_USAGE"],"start_time":"1593619200","end_time":"1593622800"}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_var_folders_q2_3kp8z3zs0x5_m7pk1bgb0_ph0000gp_T_go-build1655461974_b001_apidocs.test/host=MTY6VVHQPH/svc=S:examplesvc/site=mytestce01' 'https://acmecorp.console.ves.volterra.io/api/data/namespaces/documentation/workloads/usage'curl response:
HTTP/1.1 200 OKContent-Length: 1354Content-Type: application/jsonDate: Fri, 19 Jun 2026 22:14:41 GMTVary: Accept-Encoding
{ "data": [ { "type": "CPU_USAGE", "data": [ { "key": { "POD": "adservice", "SITE": "site-1" }, "value": [ { "timestamp": 1593622800, "value": "0.1", "trend_value": null } ] }, { "key": { "POD": "adservice", "SITE": "site-2" }, "value": [ { "timestamp": 1593622800, "value": "0.01", "trend_value": null } ] } ], "unit": "UNIT_MILLISECONDS" }, { "type": "MEMORY_USAGE", "data": [ { "key": { "POD": "adservice", "SITE": "site-1" }, "value": [ { "timestamp": 1593622800, "value": "10485760", "trend_value": null } ] }, { "key": { "POD": "adservice", "SITE": "site-2" }, "value": [ { "timestamp": 1593622800, "value": "26214400", "trend_value": null } ] } ], "unit": "UNIT_MILLISECONDS" } ], "step": ""}