ves-io-schema-service_policy_set-API-Create

Examples of creating servicepolicyset

Usecase:

Create service-policy-set-1

Request using vesctl:

vesctl configuration create service_policy_set -i service_policy_set.yaml

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

metadata:
  name: service-policy-set-1
  namespace: documentation
spec:
  policies:
  - kind: service_policy
    name: service-policy-1
  - kind: service_policy
    name: service-policy-2

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: service-policy-set-1
  namespace: documentation
spec:
  policies:
  - kind: service_policy
    name: service-policy-1
    namespace: documentation
    tenant: acmecorp
    uid: ffffffff-ffff-ffff-ffff-ffffffffffff
  - kind: service_policy
    name: service-policy-2
    namespace: documentation
    tenant: acmecorp
    uid: ffffffff-ffff-ffff-ffff-ffffffffffff
systemMetadata:
  creationTimestamp: "2021-03-31T08:29:57.513302800Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: ce088895-f4b6-44ad-bc7a-e06d60627b26

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"service-policy-set-1","namespace":"documentation"},"spec":{"policies":[{"kind":"service_policy","name":"service-policy-1"},{"kind":"service_policy","name":"service-policy-2"}]}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build318584715_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/service_policy_sets'

curl response:

HTTP/1.1 200 OK
Content-Length: 1173
Content-Type: application/json
Date: Wed, 31 Mar 2021 08:29:57 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "service-policy-set-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "ce088895-f4b6-44ad-bc7a-e06d60627b26",
    "creation_timestamp": "2021-03-31T08:29:57.513302800Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "policies": [
      {
        "kind": "service_policy",
        "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
        "tenant": "acmecorp",
        "namespace": "documentation",
        "name": "service-policy-1"
      },
      {
        "kind": "service_policy",
        "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
        "tenant": "acmecorp",
        "namespace": "documentation",
        "name": "service-policy-2"
      }
    ],
    "type": "NETWORK_SECURITY",
    "default_action": "DENY",
    "deny_info": null,
    "scope": "POLICY_SET_SCOPE_NAMESPACE"
  }
}