ves-io-schema-views-app_api_group-API-Create

Examples of creating app_api_group

Usecase:

Create "read-only" app_api_group

Request using vesctl:

vesctl configuration create app_api_group -i app_api_group.yaml

where file app_api_group.yaml has following contents (app_api_group.CreateRequest):

RequestJSON:

{"metadata":{"name":"read-only","namespace":"documentation","labels":{"ves.io/api-scope":"ves-io-part"}},"spec":{"elements":[{"methods":["GET"],"path_regex":"^/api/config/namespaces/([a-z]([-a-z0-9]*[a-z0-9])?)/advertise_policys$"}]}} `

vesctl yaml response:

ResponseJSON:

  "metadata": {
    "name": "read-only",
    "namespace": "documentation",
    "labels": {
      "ves.io/api-scope": "ves-io-part"
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "7b8a2f0a-14b8-4a6b-8380-86697adb4d2b",
    "creation_timestamp": "2022-07-28T12:14:18.448333638Z",
    "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": {
    "elements": [
      {
        "methods": [
          "GET"
        ],
        "path_regex": "^/api/config/namespaces/([a-z]([-a-z0-9]*[a-z0-9])?)/advertise_policys$"
      }
    ]
  }
}```
`

Request using curl:

    


curl -X 'POST' -d '{"metadata":{"name":"read-only","namespace":"documentation","labels":{"ves.io/api-scope":"ves-io-part"}},"spec":{"elements":[{"methods":["GET"],"path_regex":"^/api/config/namespaces/(a-z?)/advertise_policys$"}]}}' -H 'Content-Type: application/json' -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/app_api_groups'



curl response:

	


HTTP/1.1 200 OK Content-Length: 840 Content-Type: application/json Date: Thu, 28 Jul 2022 12:14:18 GMT Vary: Accept-Encoding

{ "metadata": { "name": "read-only", "namespace": "documentation", "labels": { "ves.io/api-scope": "ves-io-part" }, "annotations": { }, "description": "", "disable": false }, "system_metadata": { "uid": "7b8a2f0a-14b8-4a6b-8380-86697adb4d2b", "creation_timestamp": "2022-07-28T12:14:18.448333638Z", "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": { "elements": [ { "methods": [ "GET" ], "path_regex": "^/api/config/namespaces/(a-z?)/advertise_policys$" } ] } }