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: "2020-07-31T12:53:59.985900100Z"
  creatorClass: examplesvc.ves.io
  finalizers: []
  tenant: acmecorp
  uid: 7d645264-fd8f-479a-be17-a4b89a8e0c7d

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-build896999001_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: 800
Content-Type: application/json
Date: Fri, 31 Jul 2020 12:53:59 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "bookinfo",
    "namespace": "shared",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "7d645264-fd8f-479a-be17-a4b89a8e0c7d",
    "creation_timestamp": "2020-07-31T12:53:59.985900100Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc.ves.io",
    "creator_id": "",
    "object_index": 0,
    "owner_view": null
  },
  "spec": {
    "features": [
      {
        "type": "BUSINESS_LOGIC_MARKUP"
      },
      {
        "type": "TIMESERIES_ANOMALY_DETECTION"
      }
    ],
    "business_logic_markup_setting": {
      "disable": {

      }
    }
  }
}