ves-io-schema-known_label_key-CustomAPI-Get

Examples of performing knownlabelkey CustomAPI Get

Usecase:

Get knownlabelkey acmecorp/storetype with exact label query

Request:

Request using vesctl:

vesctl request rpc known_label_key.CustomAPI.Get -i request.yaml --uri /public/namespaces/shared/known_label_keys --http-method GET

where file request.yaml has following contents:

key: acmecorp/storetype
namespace: shared
query: QUERY_EXACT_LABEL_KEY

vesctl yaml response:

labelKey:
- description: Type of store where edge site will be located
  key: acmecorp/storetype

Request using curl:

curl -X 'GET' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build743694289_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/shared/known_label_keys?key=acmecorp0.000000storetype&namespace=shared&query=QUERY_EXACT_LABEL_KEY'

curl response:

HTTP/1.1 200 OK
Content-Length: 140
Content-Type: application/json
Date: Thu, 02 Jul 2020 15:53:12 GMT
Vary: Accept-Encoding

{
  "label_key": [
    {
      "key": "acmecorp/storetype",
      "description": "Type of store where edge site will be located"
    }
  ]
}

Usecase:

Get knownlabelkey with query param to get all

Request:

Request using vesctl:

vesctl request rpc known_label_key.CustomAPI.Get -i request.yaml --uri /public/namespaces/shared/known_label_keys --http-method GET

where file request.yaml has following contents:

namespace: shared

vesctl yaml response:

labelKey:
- description: Type of store where edge site will be located
  key: acmecorp/storetype
- description: Type of application deployment at the edge site
  key: acmecorp/deployment

Request using curl:

curl -X 'GET' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build743694289_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/shared/known_label_keys?key=&namespace=shared&query=QUERY_ALL_LABEL_KEYS'

curl response:

HTTP/1.1 200 OK
Content-Length: 260
Content-Type: application/json
Date: Thu, 02 Jul 2020 15:53:12 GMT
Vary: Accept-Encoding

{
  "label_key": [
    {
      "key": "acmecorp/storetype",
      "description": "Type of store where edge site will be located"
    },
    {
      "key": "acmecorp/deployment",
      "description": "Type of application deployment at the edge site"
    }
  ]
}