ves-io-schema-network_policy_set-API-Create

Examples of creating networkpolicyset

Usecase:

Create network-policy-set-1

Request using vesctl:

vesctl configuration create network_policy_set -i network_policy_set.yaml

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

metadata:
  name: network-policy-set-1
  namespace: documentation
spec:
  policies:
  - kind: network_policy
    name: policy-1

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: network-policy-set-1
  namespace: documentation
spec:
  policies:
  - kind: network_policy
    name: policy-1
    namespace: documentation
    tenant: acmecorp
    uid: ffffffff-ffff-ffff-ffff-ffffffffffff
systemMetadata:
  creationTimestamp: "2020-09-23T09:53:41.996910100Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 720f2347-4854-4d3b-af9f-f8e0b864baf7

Request using curl:

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

curl response:

HTTP/1.1 200 OK
Content-Length: 828
Content-Type: application/json
Date: Wed, 23 Sep 2020 09:53:41 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "network-policy-set-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "720f2347-4854-4d3b-af9f-f8e0b864baf7",
    "creation_timestamp": "2020-09-23T09:53:41.996910100Z",
    "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": "network_policy",
        "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
        "tenant": "acmecorp",
        "namespace": "documentation",
        "name": "policy-1"
      }
    ]
  }
}