ves-io-schema-network_policy-API-Replace

Examples of replacing network_policy

Usecase:

Replace network-policy-1

Request using vesctl:

vesctl configuration replace network_policy -i network_policy.yaml

where file networkpolicy.yaml has following contents (networkpolicy.ReplaceRequest):

metadata:
  name: network-policy-1
  namespace: documentation
spec:
  endpoint:
    any: {}
  rules:
    egressRules:
    - ipPrefixSet:
        ref:
        - kind: ip_prefix_set
          name: ips-2
      metadata:
        name: egr-2
    ingressRules:
    - ipPrefixSet:
        ref:
        - kind: ip_prefix_set
          name: ips-2
      metadata:
        name: igr-2

vesctl yaml response: None

Request using curl:

curl -X 'PUT' -d '{"metadata":{"name":"network-policy-1","namespace":"documentation"},"spec":{"endpoint":{"any":{}},"rules":{"ingressRules":[{"metadata":{"name":"igr-2"},"ipPrefixSet":{"ref":[{"kind":"ip_prefix_set","name":"ips-2"}]}}],"egressRules":[{"metadata":{"name":"egr-2"},"ipPrefixSet":{"ref":[{"kind":"ip_prefix_set","name":"ips-2"}]}}]}}}' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build970361017_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/network_policys/network-policy-1'

curl response:

HTTP/1.1 200 OK
Content-Length: 4
Content-Type: application/json
Date: Wed, 25 Aug 2021 09:03:34 GMT
Vary: Accept-Encoding

{

}