ves-io-schema-contact-API-Create

Examples of creating contact

Usecase:

Create contact-1

Request using vesctl:

vesctl configuration create contact -i contact.yaml

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

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

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: contact-1
  namespace: documentation
spec: {}
systemMetadata:
  creationTimestamp: "2021-05-12T11:17:39.024935488Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 9f842fe4-e419-476d-a705-ad8bd6ac1cc0

Request using curl:

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

curl response:

HTTP/1.1 200 OK
Content-Length: 799
Content-Type: application/json
Date: Wed, 12 May 2021 11:17:39 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "contact-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "9f842fe4-e419-476d-a705-ad8bd6ac1cc0",
    "creation_timestamp": "2021-05-12T11:17:39.024935488Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "contact_type": "MAILING",
    "phone_number": "",
    "address1": "",
    "address2": "",
    "city": "",
    "county": "",
    "state": "",
    "state_code": "",
    "country": "",
    "zip_code": ""
  }
}