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
      ruleName: rule-1
    - allTraffic: {}
      dnsName: www.xyz.com
      forwardingClassList:
      - name: forward-class-2
        namespace: documentation
      ruleName: 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":[{"ruleName":"rule-1","forwardingClassList":[{"namespace":"documentation","name":"forward-class-2"}],"dnsName":"www.abc.com","allTraffic":{}},{"ruleName":"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-build013258245_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, 16 Sep 2020 10:51:05 GMT
Vary: Accept-Encoding

{

}