ves-io-schema-user-API-Create

Examples of creating user

Usecase:

Create user-1

Request using vesctl:

vesctl configuration create user -i user.yaml

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

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

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: user-1
  namespace: documentation
spec:
  contacts: []
systemMetadata:
  creationTimestamp: "2020-09-16T10:50:58.376478200Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: f3a2cd31-2e20-496d-9cc1-1d3940b1f377

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"user-1","namespace":"documentation"},"spec":{}}' -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/documentation/users'

curl response:

HTTP/1.1 200 OK
Content-Length: 712
Content-Type: application/json
Date: Wed, 16 Sep 2020 10:50:58 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "user-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "f3a2cd31-2e20-496d-9cc1-1d3940b1f377",
    "creation_timestamp": "2020-09-16T10:50:58.376478200Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "type": "USER",
    "locale": "",
    "first_name": "",
    "last_name": "",
    "email": "",
    "contacts": [
    ]
  }
}