​
Select Service
ves-io-schema-views-policy_based_routing-API-Create
Published April 5, 2023 | Last modified September 28, 2026
Examples of creating policy_based_routing
Usecase:
Create policy-based-routing-1 with rule-1 to send to forwarding-class-2
Request using vesctl:
vesctl configuration create policy_based_routing -i policy_based_routing.yaml
where file policy_based_routing.yaml has following contents (policy_based_routing.CreateRequest):
RequestJSON:
{ "metadata": { "name": "policy-based-routing-1", "namespace": "documentation" }, "spec": { "network_pbr": { "any": {}, "network_pbr_rules": [ { "metadata": { "name": "rule-1" }, "forwarding_class_list": [ { "namespace": "documentation", "name": "forward-class-2" } ], "dns_name": "www.abc.com", "all_traffic": {} } ] }, "forwarding_class_list": [ { "namespace": "documentation", "name": "forward-class-1" } ] }}vesctl yaml response:
ResponseJSON:
{ "metadata": { "name": "policy-based-routing-1", "namespace": "documentation", "labels": {}, "annotations": {}, "description": "", "disable": false }, "system_metadata": { "uid": "dfa7d5ab-35ad-4a5f-87f4-240b944f7793", "creation_timestamp": "2026-06-19T22:13:58.416333Z", "deletion_timestamp": null, "modification_timestamp": null, "initializers": null, "finalizers": [], "tenant": "acmecorp", "creator_class": "examplesvc", "creator_id": "examplesvc", "object_index": 0, "owner_view": null, "labels": {} }, "spec": { "network_pbr": { "any": {}, "network_pbr_rules": [ { "metadata": { "name": "rule-1", "description": "", "disable": false }, "rule_name": "", "forwarding_class_list": [ { "tenant": "acmecorp", "namespace": "documentation", "name": "forward-class-2" } ], "dns_name": "www.abc.com", "all_traffic": {} } ] }, "forwarding_class_list": [ { "tenant": "acmecorp", "namespace": "documentation", "name": "forward-class-1" } ] }}Request using curl:
curl -X 'POST' -d '{"metadata":{"name":"policy-based-routing-1","namespace":"documentation"},"spec":{"network_pbr":{"any":{},"network_pbr_rules":[{"metadata":{"name":"rule-1"},"forwarding_class_list":[{"namespace":"documentation","name":"forward-class-2"}],"dns_name":"www.abc.com","all_traffic":{}}]},"forwarding_class_list":[{"namespace":"documentation","name":"forward-class-1"}]}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_var_folders_q2_3kp8z3zs0x5_m7pk1bgb0_ph0000gp_T_go-build1655461974_b001_apidocs.test/host=MTY6VVHQPH/svc=S:examplesvc/site=mytestce01' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/policy_based_routings'curl response:
HTTP/1.1 200 OKContent-Length: 1320Content-Type: application/jsonDate: Fri, 19 Jun 2026 22:13:58 GMTVary: Accept-Encoding
{ "metadata": { "name": "policy-based-routing-1", "namespace": "documentation", "labels": { }, "annotations": { }, "description": "", "disable": false }, "system_metadata": { "uid": "dfa7d5ab-35ad-4a5f-87f4-240b944f7793", "creation_timestamp": "2026-06-19T22:13:58.416333Z", "deletion_timestamp": null, "modification_timestamp": null, "initializers": null, "finalizers": [ ], "tenant": "acmecorp", "creator_class": "examplesvc", "creator_id": "examplesvc", "object_index": 0, "owner_view": null, "labels": { } }, "spec": { "network_pbr": { "any": {
}, "network_pbr_rules": [ { "metadata": { "name": "rule-1", "description": "", "disable": false }, "rule_name": "", "forwarding_class_list": [ { "tenant": "acmecorp", "namespace": "documentation", "name": "forward-class-2" } ], "dns_name": "www.abc.com", "all_traffic": {
} } ] }, "forwarding_class_list": [ { "tenant": "acmecorp", "namespace": "documentation", "name": "forward-class-1" } ] }}