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: "2021-08-25T09:03:16.710746914Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: f7fb4f55-3931-4265-b543-0c1433966f9e

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-build970361017_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: 854
Content-Type: application/json
Date: Wed, 25 Aug 2021 09:03:16 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "kms-policy-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "f7fb4f55-3931-4265-b543-0c1433966f9e",
    "creation_timestamp": "2021-08-25T09:03:16.710746914Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "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"
      }
    ]
  }
}