ves-io-schema-app_type-API-Create

Examples of creating app_type

Usecase:

Create app_type "bookinfo" for bookinfo app so that service mesh of productpage, review, rating and details can be created by applying "ves.io/app-type=bookinfo" label to these microservices.

Request using vesctl:

vesctl configuration create app_type -i app_type.yaml

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

metadata:
  name: bookinfo
  namespace: shared
spec:
  businessLogicMarkupSetting:
    disable: {}
  features:
  - {}
  - type: TIMESERIES_ANOMALY_DETECTION

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: bookinfo
  namespace: shared
spec:
  businessLogicMarkupSetting:
    disable: {}
  features:
  - {}
  - type: TIMESERIES_ANOMALY_DETECTION
systemMetadata:
  creationTimestamp: "2021-07-14T08:06:39.703458236Z"
  creatorClass: examplesvc
  creatorId: examplesvc
  finalizers: []
  tenant: acmecorp
  uid: 02fdfe7e-472f-46a5-b5a9-a001f21f4d46

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"bookinfo","namespace":"shared"},"spec":{"features":[{},{"type":"TIMESERIES_ANOMALY_DETECTION"}],"businessLogicMarkupSetting":{"disable":{}}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build381173587_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/shared/app_types'

curl response:

HTTP/1.1 200 OK
Content-Length: 803
Content-Type: application/json
Date: Wed, 14 Jul 2021 08:06:39 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "bookinfo",
    "namespace": "shared",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "02fdfe7e-472f-46a5-b5a9-a001f21f4d46",
    "creation_timestamp": "2021-07-14T08:06:39.703458236Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "features": [
      {
        "type": "BUSINESS_LOGIC_MARKUP"
      },
      {
        "type": "TIMESERIES_ANOMALY_DETECTION"
      }
    ],
    "business_logic_markup_setting": {
      "disable": {

      }
    }
  }
}