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-07-14T08:09:11.799456961Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: a7a5ec5a-6099-435b-8eb6-5b3785889ffe

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-build381173587_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: Wed, 14 Jul 2021 08:09:11 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "tiny",
    "namespace": "shared",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "a7a5ec5a-6099-435b-8eb6-5b3785889ffe",
    "creation_timestamp": "2021-07-14T08:09:11.799456961Z",
    "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"
  }
}