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-08-25T09:04:49.038490075Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: ea224c53-44a3-4bfa-a67a-75f9dd31a9e9

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-build970361017_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, 25 Aug 2021 09:04:49 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "tiny",
    "namespace": "shared",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "ea224c53-44a3-4bfa-a67a-75f9dd31a9e9",
    "creation_timestamp": "2021-08-25T09:04:49.038490075Z",
    "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"
  }
}