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: "2021-07-14T08:08:10.352411335Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 3b973f6e-4126-42f3-b071-ee9d4c4c2c96

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-build381173587_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: Wed, 14 Jul 2021 08:08:10 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "secret-policy-rule-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "3b973f6e-4126-42f3-b071-ee9d4c4c2c96",
    "creation_timestamp": "2021-07-14T08:08:10.352411335Z",
    "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
  }
}