ves-io-schema-user-CustomAPI-AssignRole

Examples of performing user CustomAPI AssignRole

Usecase:

assign role to user-1@ves.io and user-2@ves.io

Request:

Request using vesctl:

vesctl request rpc user.CustomAPI.AssignRole -i request.yaml --uri /public/custom/namespaces/system/role_users --http-method POST

where file request.yaml has following contents:

namespace: system
namespacesRole:
  namespaces:
  - ns-1
  - ns-2
  role: role-1
username:
- user-1@ves.io
- user-2@ves.io

vesctl yaml response:

{}

Request using curl:

curl -X 'POST' -d '{"namespace":"system","namespacesRole":{"namespaces":["ns-1","ns-2"],"role":"role-1"},"username":["user-1@ves.io","user-2@ves.io"]}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build038462651_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/web/custom/namespaces/system/role_users'

curl response:

HTTP/1.1 200 OK
Content-Length: 4
Content-Type: application/json
Date: Wed, 12 Jan 2022 14:51:21 GMT
Vary: Accept-Encoding

{

}