ves-io-schema-kms_policy-API-Create

Examples of creating kms_policy

Usecase:

Create kms-policy-1

Request using vesctl:

vesctl configuration create kms_policy -i kms_policy.yaml

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

metadata:
  name: kms-policy-1
  namespace: documentation
spec:
  rules:
  - kind: kms_policy_rule
    name: kms-policy-rule-1

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: kms-policy-1
  namespace: documentation
spec:
  rules:
  - kind: kms_policy_rule
    name: kms-policy-rule-1
    namespace: documentation
    tenant: acmecorp
    uid: ffffffff-ffff-ffff-ffff-ffffffffffff
systemMetadata:
  creationTimestamp: "2020-05-15T10:52:43.488766930Z"
  creatorClass: examplesvc.ves.io
  finalizers: []
  tenant: acmecorp
  uid: 7402445f-e417-48a5-8b3b-07c78956ae48

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"kms-policy-1","namespace":"documentation"},"spec":{"rules":[{"kind":"kms_policy_rule","name":"kms-policy-rule-1"}]}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build144460626_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/kms/namespaces/documentation/kms_policys'

curl response:

HTTP/1.1 200 OK
Content-Length: 851
Content-Type: application/json
Date: Fri, 15 May 2020 10:52:43 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-policy-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "7402445f-e417-48a5-8b3b-07c78956ae48",
    "creation_timestamp": "2020-05-15T10:52:43.488766930Z",
    "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": {
    "algo": "FIRST_MATCH",
    "rules": [
      {
        "kind": "kms_policy_rule",
        "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
        "tenant": "acmecorp",
        "namespace": "documentation",
        "name": "kms-policy-rule-1"
      }
    ]
  }
}