ves-io-schema-views-app_api_group-API-Replace

Examples of replacing appapigroup

Usecase:

Replace "read-only" appapigroup

Request using vesctl:

vesctl configuration replace app_api_group -i app_api_group.yaml

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

metadata:
  name: read-only
  namespace: documentation
spec:
  elements:
  - methods:
    - GET
    pathRegex: ^/api/config/namespaces/([a-z]([-a-z0-9]*[a-z0-9])?)/virtual_hosts$

vesctl yaml response: None

Request using curl:

curl -X 'PUT' -d '{"metadata":{"name":"read-only","namespace":"documentation"},"spec":{"elements":[{"methods":["GET"],"pathRegex":"^/api/config/namespaces/([a-z]([-a-z0-9]*[a-z0-9])?)/virtual_hosts$"}]}}' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build038462651_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/app_api_groups/read-only'

curl response:

HTTP/1.1 200 OK
Content-Length: 4
Content-Type: application/json
Date: Wed, 12 Jan 2022 14:51:32 GMT
Vary: Accept-Encoding

{

}