ves-io-schema-api_credential-CustomAPI-CreateServiceCredentials

Examples of performing api_credential CustomAPI CreateServiceCredentials

Usecase:

Create service credentials

Request:

Request using vesctl:

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

where file request.yaml has following contents:

expirationTimestamp: "2020-07-31T12:53:55.092466Z"
name: user-1-service-creds
namespace: documentation
namespaceRoles:
- namespace: system
  role: ves-io-admin-role3
type: KUBE_CONFIG

vesctl yaml response:

{}

Request using curl:

curl -X 'POST' -d '{"type":"KUBE_CONFIG","namespace":"documentation","name":"user-1-service-creds","namespaceRoles":[{"namespace":"system","role":"ves-io-admin-role3"}],"expirationTimestamp":"2020-07-31T12:53:55.092466Z"}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build896999001_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/web/namespaces/system/service_credentials'

curl response:

HTTP/1.1 200 OK
Content-Length: 30
Content-Type: application/json
Date: Fri, 31 Jul 2020 12:53:57 GMT
Vary: Accept-Encoding

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