ves-io-schema-views-app_api_group-API-Create
On This Page:
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\$"
}
],
"http_loadbalancer": {
"http_loadbalancer": {
"tenant": "acmecorp",
"namespace": "documentation",
"name": "app-1"
}
},
"api_group_builder": {
"metadata": {
"name": "sensitive"
},
"path_filter": "/abc/.*"
}
}
}
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": "9dd61410-25c7-4906-8a78-bb7069d8289f",
"creation_timestamp": "2024-03-21T14:08:30.220495Z",
"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\$"
}
],
"http_loadbalancer": {
"http_loadbalancer": {
"tenant": "acmecorp",
"namespace": "documentation",
"name": "app-1"
}
},
"api_group_builder": {
"metadata": {
"name": "sensitive",
"description": "",
"disable": false
},
"path_filter": "/abc/.*",
"label_filter": null,
"included_operations": [],
"excluded_operations": []
},
"api_endpoints_count": 0
}
}
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]([-a-z0-9]*[a-z0-9])?)/advertise_policys\$"}],"http_loadbalancer":{"http_loadbalancer":{"tenant":"acmecorp","namespace":"documentation","name":"app-1"}},"api_group_builder":{"metadata":{"name":"sensitive"},"path_filter":"/abc/.*"}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_var_folders_2__8qnt6fwd5dvglr1xqq6l8b7w0000gp_T_go-build3109416560_b001_apidocs.test/host=C02FN35BMD6R/svc=S:examplesvc/site=mytestce01' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/app_api_groups'
curl response:
HTTP/1.1 200 OK
Content-Length: 1313
Content-Type: application/json
Date: Thu, 21 Mar 2024 14:08:30 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": "9dd61410-25c7-4906-8a78-bb7069d8289f",
"creation_timestamp": "2024-03-21T14:08:30.220495Z",
"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\$"
}
],
"http_loadbalancer": {
"http_loadbalancer": {
"tenant": "acmecorp",
"namespace": "documentation",
"name": "app-1"
}
},
"api_group_builder": {
"metadata": {
"name": "sensitive",
"description": "",
"disable": false
},
"path_filter": "/abc/.*",
"label_filter": null,
"included_operations": [
],
"excluded_operations": [
]
},
"api_endpoints_count": 0
}
}