ves-io-schema-role-API-Create

Examples of creating role

Usecase:

Create role-1

Request using vesctl:

vesctl configuration create role -i role.yaml

where file role.yaml has following contents (role.CreateRequest):

metadata:
  name: role-1
  namespace: documentation
spec: {}

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: role-1
  namespace: documentation
spec:
  rbacPolicy: []
systemMetadata:
  creationTimestamp: "2021-03-31T08:29:44.537108100Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 72d2a1e8-01dd-49ed-ad46-9f23c7908043

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"role-1","namespace":"documentation"},"spec":{}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build318584715_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/web/namespaces/documentation/roles'

curl response:

HTTP/1.1 200 OK
Content-Length: 617
Content-Type: application/json
Date: Wed, 31 Mar 2021 08:29:44 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "role-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "72d2a1e8-01dd-49ed-ad46-9f23c7908043",
    "creation_timestamp": "2021-03-31T08:29:44.537108100Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "rbac_policy": [
    ]
  }
}