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 servicepolicy.yaml has following contents (servicepolicy.ReplaceRequest):

metadata:
  name: service-policy-1
  namespace: documentation
spec:
  rules:
  - kind: service_policy_rule
    name: service-policy-rule-1
  serverName: pokemon-go-homepage
  serverSelector:
    expressions:
    - geoip.ves.io/region in (US-West), deployment in (testing)

vesctl yaml response: None

Request using curl:

curl -X 'PUT' -d '{"metadata":{"name":"service-policy-1","namespace":"documentation"},"spec":{"serverName":"pokemon-go-homepage","serverSelector":{"expressions":["geoip.ves.io/region in (US-West), deployment in (testing)"]},"rules":[{"kind":"service_policy_rule","name":"service-policy-rule-1"}]}}' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build743694289_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, 02 Jul 2020 15:53:30 GMT
Vary: Accept-Encoding

{

}