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: "2020-07-02T15:53:24.376482200Z"
  creatorClass: examplesvc.ves.io
  finalizers: []
  tenant: acmecorp
  uid: d68156a6-cabf-47f4-b1da-b38d4ed84b76

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-build743694289_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: 614
Content-Type: application/json
Date: Thu, 02 Jul 2020 15:53:24 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "role-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "d68156a6-cabf-47f4-b1da-b38d4ed84b76",
    "creation_timestamp": "2020-07-02T15:53:24.376482200Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc.ves.io",
    "creator_id": "",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "rbac_policy": [
    ]
  }
}