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 secret_policy.yaml has following contents (secret_policy.CreateRequest):

RequestJSON:

{"metadata":{"name":"secret-policy-1","namespace":"documentation"},"spec":{"rules":[{"kind":"secret_policy_rule","name":"secret-policy-rule-1"}],"decrypt_cache_timeout":"604800s"}} `

vesctl yaml response:

ResponseJSON:

  "metadata": {
    "name": "secret-policy-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "619551a1-4683-4eea-a469-7bd4ad8d5f38",
    "creation_timestamp": "2022-07-28T12:11:49.695517466Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null,
    "labels": {
    }
  },
  "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,
    "decrypt_cache_timeout": "604800s",
    "marked_for_delete": false,
    "deletion_time": null
  }
}```
`

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"}],"decrypt_cache_timeout":"604800s"}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build1372770011_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: 1014 Content-Type: application/json Date: Thu, 28 Jul 2022 12:11:49 GMT Vary: Accept-Encoding

{ "metadata": { "name": "secret-policy-1", "namespace": "documentation", "labels": { }, "annotations": { }, "description": "", "disable": false }, "system_metadata": { "uid": "619551a1-4683-4eea-a469-7bd4ad8d5f38", "creation_timestamp": "2022-07-28T12:11:49.695517466Z", "deletion_timestamp": null, "modification_timestamp": null, "initializers": null, "finalizers": [ ], "tenant": "acmecorp", "creator_class": "examplesvc", "creator_id": "examplesvc", "object_index": 0, "owner_view": null, "labels": { } }, "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, "decrypt_cache_timeout": "604800s", "marked_for_delete": false, "deletion_time": null } }