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: "2021-08-25T09:04:10.691626888Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 505b5258-ddb2-402f-8565-dc7d4a91c3de

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-build970361017_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: 956
Content-Type: application/json
Date: Wed, 25 Aug 2021 09:04:10 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "apikey1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "505b5258-ddb2-402f-8565-dc7d4a91c3de",
    "creation_timestamp": "2021-08-25T09:04:10.691626888Z",
    "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
  }
}