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": "efa2354e-9acd-40fb-8165-b9ed5a15854d",
        "creation_timestamp": "2022-09-23T13:16:32.577519998Z",
        "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]([-a-z0-9]*[a-z0-9])?)/advertise_policys$"}]}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build243329498_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: Fri, 23 Sep 2022 13:16:32 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": "efa2354e-9acd-40fb-8165-b9ed5a15854d",
    "creation_timestamp": "2022-09-23T13:16:32.577519998Z",
    "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$"
      }
    ]
  }
}