ves-io-schema-tpm_api_key-API-Create

Examples of creating tpmapikey

Usecase:

Create "tpmapikey"

Request using vesctl:

vesctl configuration create tpm_api_key -i tpm_api_key.yaml

where file tpmapikey.yaml has following contents (tpmapikey.CreateRequest):

metadata:
  name: apikey1
  namespace: documentation
spec:
  categoryRef:
  - name: category-sku-001
    namespace: documentation

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: apikey1
  namespace: documentation
spec:
  categoryRef:
  - kind: tpm_category.Object
    name: category-sku-001
    namespace: documentation
    tenant: acmecorp
    uid: ffffffff-ffff-ffff-ffff-ffffffffffff
systemMetadata:
  creationTimestamp: "2020-09-16T10:50:56.166508Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 47b81429-13b0-4b6a-9140-004c6b07a4be

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"apikey1","namespace":"documentation"},"spec":{"categoryRef":[{"namespace":"documentation","name":"category-sku-001"}]}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build013258245_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/tpm/namespaces/documentation/tpm_api_keys'

curl response:

HTTP/1.1 200 OK
Content-Length: 953
Content-Type: application/json
Date: Wed, 16 Sep 2020 10:50:56 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "apikey1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "47b81429-13b0-4b6a-9140-004c6b07a4be",
    "creation_timestamp": "2020-09-16T10:50:56.166508Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "category_ref": [
      {
        "kind": "tpm_category.Object",
        "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
        "tenant": "acmecorp",
        "namespace": "documentation",
        "name": "category-sku-001"
      }
    ],
    "need_mtls": false,
    "apikey": "",
    "revoked_timestamp": null,
    "revoke_reason": "",
    "is_disabled": false
  }
}