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: "2020-07-02T15:53:31.349046200Z"
  creatorClass: examplesvc.ves.io
  finalizers: []
  tenant: acmecorp
  uid: 75c96a84-ae8a-4002-900d-5a3dc0c0e939

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-build743694289_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: 1042
Content-Type: application/json
Date: Thu, 02 Jul 2020 15:53:31 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "service-policy-set-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "75c96a84-ae8a-4002-900d-5a3dc0c0e939",
    "creation_timestamp": "2020-07-02T15:53:31.349046200Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc.ves.io",
    "creator_id": "",
    "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"
      }
    ]
  }
}