ves-io-schema-workload_flavor-API-Create
On This Page:
Examples of creating workload_flavor
Usecase:
Create a workload flavor
Request using vesctl:
vesctl configuration create workload_flavor -i workload_flavor.yaml
where file workload_flavor.yaml has following contents (workload_flavor.CreateRequest):
RequestJSON:
{
"metadata": {
"name": "tiny",
"namespace": "shared"
},
"spec": {
"memory": "4",
"vcpus": 1
}
}
vesctl yaml response:
ResponseJSON:
{
"metadata": {
"name": "tiny",
"namespace": "shared",
"labels": {},
"annotations": {},
"description": "",
"disable": false
},
"system_metadata": {
"uid": "a10b0f41-ca44-44de-a3f7-8f9e0dc16a77",
"creation_timestamp": "2024-03-21T14:09:11.609367Z",
"deletion_timestamp": null,
"modification_timestamp": null,
"initializers": null,
"finalizers": [],
"tenant": "acmecorp",
"creator_class": "examplesvc",
"creator_id": "examplesvc",
"object_index": 0,
"owner_view": null,
"labels": {}
},
"spec": {
"memory": "4",
"vcpus": 1,
"ephemeral_storage": "0"
}
}
Request using curl:
curl -X 'POST' -d '{"metadata":{"name":"tiny","namespace":"shared"},"spec":{"memory":"4","vcpus":1}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_var_folders_2__8qnt6fwd5dvglr1xqq6l8b7w0000gp_T_go-build3109416560_b001_apidocs.test/host=C02FN35BMD6R/svc=S:examplesvc/site=mytestce01' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/shared/workload_flavors'
curl response:
HTTP/1.1 200 OK
Content-Length: 665
Content-Type: application/json
Date: Thu, 21 Mar 2024 14:09:11 GMT
Vary: Accept-Encoding
{
"metadata": {
"name": "tiny",
"namespace": "shared",
"labels": {
},
"annotations": {
},
"description": "",
"disable": false
},
"system_metadata": {
"uid": "a10b0f41-ca44-44de-a3f7-8f9e0dc16a77",
"creation_timestamp": "2024-03-21T14:09:11.609367Z",
"deletion_timestamp": null,
"modification_timestamp": null,
"initializers": null,
"finalizers": [
],
"tenant": "acmecorp",
"creator_class": "examplesvc",
"creator_id": "examplesvc",
"object_index": 0,
"owner_view": null,
"labels": {
}
},
"spec": {
"memory": "4",
"vcpus": 1,
"ephemeral_storage": "0"
}
}