ves-io-schema-views-policy_based_routing-API-Replace

Examples of replacing policybasedrouting

Usecase:

Replace policy-based-routing-1 to add rule-2

Request using vesctl:

vesctl configuration replace policy_based_routing -i policy_based_routing.yaml

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

metadata:
  name: policy-based-routing-1
  namespace: documentation
spec:
  forwardingClassList:
  - name: forward-class-1
    namespace: documentation
  networkPbr:
    any: {}
    networkPbrRules:
    - allTraffic: {}
      dnsName: www.abc.com
      forwardingClassList:
      - name: forward-class-2
        namespace: documentation
      metadata:
        name: rule-1
    - allTraffic: {}
      dnsName: www.xyz.com
      forwardingClassList:
      - name: forward-class-2
        namespace: documentation
      metadata:
        name: rule-2

vesctl yaml response: None

Request using curl:

curl -X 'PUT' -d '{"metadata":{"name":"policy-based-routing-1","namespace":"documentation"},"spec":{"networkPbr":{"any":{},"networkPbrRules":[{"metadata":{"name":"rule-1"},"forwardingClassList":[{"namespace":"documentation","name":"forward-class-2"}],"dnsName":"www.abc.com","allTraffic":{}},{"metadata":{"name":"rule-2"},"forwardingClassList":[{"namespace":"documentation","name":"forward-class-2"}],"dnsName":"www.xyz.com","allTraffic":{}}]},"forwardingClassList":[{"namespace":"documentation","name":"forward-class-1"}]}}' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build186462253_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/policy_based_routings/policy-based-routing-1'

curl response:

HTTP/1.1 200 OK
Content-Length: 4
Content-Type: application/json
Date: Wed, 02 Jun 2021 10:22:43 GMT
Vary: Accept-Encoding

{

}