​
Select Service
ves-io-schema-virtual_k8s-CustomDataAPI-PVCMetrics
Published April 5, 2023 | Last modified March 20, 2025
Examples of performing virtual_k8s CustomDataAPI PVCMetrics
Usecase:
Get Virkual K8s PVC metrics
Request:
Request using vesctl:
vesctl request rpc virtual_k8s.CustomDataAPI.PVCMetrics -i request.yaml --uri /public/namespaces/documentation/virtual_k8s/pvc/metrics --http-method POST
where file request.yaml has following contents:
endTime: "1593622800"
fieldSelector:
- PVC_USAGE
- PVC_CAPACITY
groupBy:
- PVC
- SITE
namespace: documentation
startTime: "1593619200"
Copied!
vesctl yaml response:
data:
- data:
- key:
PVC: pvc-1
SITE: site-1
value:
- timestamp: 1593622800
value: "134217728"
- key:
PVC: pvc-2
SITE: site-2
value:
- timestamp: 1593622800
value: "67108864"
- data:
- key:
PVC: pvc-1
SITE: site-1
value:
- timestamp: 1593622800
value: "268435456"
- key:
PVC: pvc-2
SITE: site-2
value:
- timestamp: 1593622800
value: "268435456"
type: PVC_CAPACITY
Copied!
Request using curl:
curl -X 'POST' -d '{"namespace":"documentation","group_by":["PVC","SITE"],"field_selector":["PVC_USAGE","PVC_CAPACITY"],"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-build436303540_b001_apidocs.test/host=MTY6VVHQPH/svc=S:examplesvc/site=mytestce01' 'https://acmecorp.console.ves.volterra.io/api/data/namespaces/documentation/virtual_k8s/pvc/metrics'
Copied!
curl response:
HTTP/1.1 200 OK
Content-Length: 1350
Content-Type: application/json
Date: Tue, 11 Mar 2025 00:57:53 GMT
Vary: Accept-Encoding
{
"data": [
{
"type": "PVC_USAGE",
"data": [
{
"key": {
"PVC": "pvc-1",
"SITE": "site-1"
},
"value": [
{
"timestamp": 1593622800,
"value": "134217728",
"trend_value": null
}
]
},
{
"key": {
"PVC": "pvc-2",
"SITE": "site-2"
},
"value": [
{
"timestamp": 1593622800,
"value": "67108864",
"trend_value": null
}
]
}
],
"unit": "UNIT_MILLISECONDS"
},
{
"type": "PVC_CAPACITY",
"data": [
{
"key": {
"PVC": "pvc-1",
"SITE": "site-1"
},
"value": [
{
"timestamp": 1593622800,
"value": "268435456",
"trend_value": null
}
]
},
{
"key": {
"PVC": "pvc-2",
"SITE": "site-2"
},
"value": [
{
"timestamp": 1593622800,
"value": "268435456",
"trend_value": null
}
]
}
],
"unit": "UNIT_MILLISECONDS"
}
],
"step": ""
}
Copied!