ves-io-schema-token-CustomAPI-TokenState

Examples of performing token CustomAPI TokenState

Usecase:

Perform TokenState on token

Request:

Request using vesctl:

vesctl request rpc token.CustomAPI.TokenState -i request.yaml --uri /public/namespaces/namespace-literal/tokens/name-literal/state --http-method POST

where file request.yaml has following contents:

{}

vesctl yaml response:

obj:
  metadata:
    annotations:
      tu-generated: "yes"
    labels:
      abc: def
    name: token-7e3ed7f2-33ae-4e45-ac78-3f0a8a784608
    namespace: system
    uid: 7e3ed7f2-33ae-4e45-ac78-3f0a8a784608
  spec:
    gcSpec:
      state: VALID
  systemMetadata:
    finalizers: []
    namespace: []
    tenant: customer1
    uid: 7e3ed7f2-33ae-4e45-ac78-3f0a8a784608

Request using curl:

curl -X 'POST' -d '{}' -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/register/namespaces/namespace-literal/tokens/name-literal/state'

curl response:

HTTP/1.1 200 OK
Content-Length: 926
Content-Type: application/json
Date: Wed, 25 Aug 2021 09:04:09 GMT
Vary: Accept-Encoding

{
  "obj": {
    "metadata": {
      "name": "token-7e3ed7f2-33ae-4e45-ac78-3f0a8a784608",
      "namespace": "system",
      "uid": "7e3ed7f2-33ae-4e45-ac78-3f0a8a784608",
      "labels": {
        "abc": "def"
      },
      "annotations": {
        "tu-generated": "yes"
      },
      "description": "",
      "disable": false
    },
    "system_metadata": {
      "uid": "7e3ed7f2-33ae-4e45-ac78-3f0a8a784608",
      "creation_timestamp": null,
      "deletion_timestamp": null,
      "modification_timestamp": null,
      "initializers": null,
      "finalizers": [
      ],
      "tenant": "customer1",
      "creator_class": "",
      "creator_id": "",
      "creator_cookie": "",
      "trace_info": "",
      "object_index": 0,
      "namespace": [
      ],
      "owner_view": null,
      "sre_disable": false,
      "vtrp_id": ""
    },
    "spec": {
      "gc_spec": {
        "state": "VALID"
      }
    }
  }
}