ves-io-schema-secret_policy-API-Create

Examples of creating secret_policy

Usecase:

Create secret-policy-1

Request using vesctl:

vesctl configuration create secret_policy -i secret_policy.yaml

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

metadata:
  name: secret-policy-1
  namespace: documentation
spec:
  rules:
  - kind: secret_policy_rule
    name: secret-policy-rule-1

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: secret-policy-1
  namespace: documentation
spec:
  rules:
  - kind: secret_policy_rule
    name: secret-policy-rule-1
    namespace: documentation
    tenant: acmecorp
    uid: ffffffff-ffff-ffff-ffff-ffffffffffff
systemMetadata:
  creationTimestamp: "2020-09-16T10:50:46.816915400Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: d252115f-fb78-4a24-b211-91299ffcae08

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"secret-policy-1","namespace":"documentation"},"spec":{"rules":[{"kind":"secret_policy_rule","name":"secret-policy-rule-1"}]}}' -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/secret_management/namespaces/documentation/secret_policys'

curl response:

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

{
  "metadata": {
    "name": "secret-policy-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "d252115f-fb78-4a24-b211-91299ffcae08",
    "creation_timestamp": "2020-09-16T10:50:46.816915400Z",
    "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": "secret_policy_rule",
        "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
        "tenant": "acmecorp",
        "namespace": "documentation",
        "name": "secret-policy-rule-1"
      }
    ],
    "allow_volterra": false
  }
}