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 workloadflavor.yaml has following contents (workloadflavor.CreateRequest):

metadata:
  name: tiny
  namespace: shared
spec:
  memory: "4"
  vcpus: 1

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: tiny
  namespace: shared
spec:
  memory: "4"
  vcpus: 1
systemMetadata:
  creationTimestamp: "2021-02-22T15:45:33.251107300Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 80a383ac-4ad9-4af4-8114-be4c0f714992

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-build817539475_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: 645
Content-Type: application/json
Date: Mon, 22 Feb 2021 15:45:33 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "tiny",
    "namespace": "shared",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "80a383ac-4ad9-4af4-8114-be4c0f714992",
    "creation_timestamp": "2021-02-22T15:45:33.251107300Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "memory": "4",
    "vcpus": 1,
    "ephemeral_storage": "0"
  }
}