ves-io-schema-service_policy-API-Replace

Examples of replacing service_policy

Usecase:

Replace service-policy-1

Request using vesctl:

vesctl configuration replace service_policy -i service_policy.yaml

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

RequestJSON:

{"metadata":{"name":"service-policy-1","namespace":"documentation"},"spec":{"server_selector":{"expressions":["geoip.ves.io/region in (US-West), deployment in (testing)"]},"legacy_rule_list":{"rules":[{"kind":"service_policy_rule","name":"service-policy-rule-1"},{"kind":"service_policy_rule","name":"service-policy-rule-2"}]}}} `

vesctl yaml response: None

Request using curl:

curl -X 'PUT' -d '{"metadata":{"name":"service-policy-1","namespace":"documentation"},"spec":{"server_selector":{"expressions":["geoip.ves.io/region in (US-West), deployment in (testing)"]},"legacy_rule_list":{"rules":[{"kind":"service_policy_rule","name":"service-policy-rule-1"},{"kind":"service_policy_rule","name":"service-policy-rule-2"}]}}}' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build1372770011_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/service_policys/service-policy-1'

curl response:

HTTP/1.1 200 OK
Content-Length: 4
Content-Type: application/json
Date: Thu, 28 Jul 2022 12:11:54 GMT
Vary: Accept-Encoding

{

}