ves-io-schema-workload_flavor-API-Create

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": "a217e920-ab0b-4e9e-af15-a2fae9d32674",
    "creation_timestamp": "2022-07-28T12:16:09.493758648Z",
    "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=_tmp_go-build1372770011_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/shared/workload_flavors'



curl response:

	


HTTP/1.1 200 OK Content-Length: 668 Content-Type: application/json Date: Thu, 28 Jul 2022 12:16:09 GMT Vary: Accept-Encoding

{ "metadata": { "name": "tiny", "namespace": "shared", "labels": { }, "annotations": { }, "description": "", "disable": false }, "system_metadata": { "uid": "a217e920-ab0b-4e9e-af15-a2fae9d32674", "creation_timestamp": "2022-07-28T12:16:09.493758648Z", "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" } }