ves-io-schema-api_credential-CustomAPI-Activate

Examples of performing api_credential CustomAPI Activate

Usecase:

Create API Token for user-1 of acmecorp

Request:

Request using vesctl:

vesctl request rpc api_credential.CustomAPI.Activate -i request.yaml --uri /public/namespaces/system/api_credentials --http-method POST

where file request.yaml has following contents:

expirationTimestamp: "2020-10-06T10:49:55.061637700Z"
name: user-1-token-4
namespace: documentation
spec:
  type: API_TOKEN

vesctl yaml response:

{}

Request using curl:

curl -X 'POST' -d '{"namespace":"documentation","name":"user-1-token-4","spec":{"type":"API_TOKEN"},"expirationTimestamp":"2020-10-06T10:49:55.061637700Z"}' -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/web/namespaces/system/api_credentials'

curl response:

HTTP/1.1 200 OK
Content-Length: 30
Content-Type: application/json
Date: Wed, 16 Sep 2020 10:49:57 GMT
Vary: Accept-Encoding

{
  "data": "",
  "name": ""
}

Usecase:

Activate/De-activate API Token for user-1 of acmecorp

Request:

Request using vesctl:

vesctl request rpc api_credential.CustomAPI.Activate -i request.yaml --uri /public/namespaces/system/activate/api_credentials --http-method POST

where file request.yaml has following contents:

name: user-1-token-4-ed0561ca-b0af-42c3-b781-7e4a107b2c0a

vesctl yaml response:

{}

Request using curl:

curl -X 'POST' -d '{"name":"user-1-token-4-ed0561ca-b0af-42c3-b781-7e4a107b2c0a"}' -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/web/namespaces/system/activate/api_credentials'

curl response:

HTTP/1.1 200 OK
Content-Length: 21
Content-Type: application/json
Date: Wed, 16 Sep 2020 10:49:57 GMT
Vary: Accept-Encoding

{
  "status": false
}