ves-io-schema-secret_policy_rule-API-Create

Examples of creating secretpolicyrule

Usecase:

Create secret-policy-rule-1

Request using vesctl:

vesctl configuration create secret_policy_rule -i secret_policy_rule.yaml

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

metadata:
  name: secret-policy-rule-1
  namespace: documentation
spec:
  action: ALLOW
  clientNameMatcher:
    regexValues:
    - akar\.gc(\d)*\.int\.ves\.io

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: secret-policy-rule-1
  namespace: documentation
spec:
  action: ALLOW
  clientNameMatcher:
    exactValues: []
    regexValues:
    - akar\.gc(\d)*\.int\.ves\.io
systemMetadata:
  creationTimestamp: "2020-10-19T09:49:08.937198800Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 8b8db122-b7a0-410f-8218-d8d396503ac3

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"secret-policy-rule-1","namespace":"documentation"},"spec":{"action":"ALLOW","clientNameMatcher":{"regexValues":["akar\.gc(\d)*\.int\.ves\.io"]}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build185306297_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/secret_management/namespaces/documentation/secret_policy_rules'

curl response:

HTTP/1.1 200 OK
Content-Length: 797
Content-Type: application/json
Date: Mon, 19 Oct 2020 09:49:08 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "secret-policy-rule-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "8b8db122-b7a0-410f-8218-d8d396503ac3",
    "creation_timestamp": "2020-10-19T09:49:08.937198800Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "action": "ALLOW",
    "client_name_matcher": {
      "exact_values": [
      ],
      "regex_values": [
        "akar\.gc(\d)*\.int\.ves\.io"
      ]
    },
    "label_matcher": null
  }
}