ves-io-schema-route-API-Replace

Examples of replacing route

Usecase:

Replace route-1

Request using vesctl:

vesctl configuration replace route -i route.yaml

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

metadata:
  name: route-1
  namespace: documentation
spec:
  routes:
  - match:
    - path:
        regex: (.*?)
    routeDestination:
      destinations:
      - cluster:
        - kind: cluster
          name: cluster-1

vesctl yaml response: None

Request using curl:

curl -X 'PUT' -d '{"metadata":{"name":"route-1","namespace":"documentation"},"spec":{"routes":[{"match":[{"path":{"regex":"(.*?)"}}],"routeDestination":{"destinations":[{"cluster":[{"kind":"cluster","name":"cluster-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/routes/route-1'

curl response:

HTTP/1.1 200 OK
Content-Length: 4
Content-Type: application/json
Date: Thu, 02 Jul 2020 15:53:25 GMT
Vary: Accept-Encoding

{

}