ves-io-schema-app_setting-API-Replace

Examples of replacing app_setting

Usecase:

Use replace to update app-setting to add ANOMALYSERVICEPER_SITE

Request using vesctl:

vesctl configuration replace app_setting -i app_setting.yaml

where file appsetting.yaml has following contents (appsetting.ReplaceRequest):

metadata:
  name: app-setting
  namespace: documentation
spec:
  appTypeSettings:
  - appTypeRef:
    - kind: app_type
      name: bookinfo
      namespace: shared
      tenant: acmecorp
    timeseriesAnalysesSetting:
      metricSelectors:
      - metric:
        - REQUEST_RATE
        metricsSource: VIRTUAL_HOSTS

vesctl yaml response: None

Request using curl:

curl -X 'PUT' -d '{"metadata":{"name":"app-setting","namespace":"documentation"},"spec":{"appTypeSettings":[{"appTypeRef":[{"kind":"app_type","tenant":"acmecorp","namespace":"shared","name":"bookinfo"}],"timeseriesAnalysesSetting":{"metricSelectors":[{"metricsSource":"VIRTUAL_HOSTS","metric":["REQUEST_RATE"]}]}}]}}' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build743694289_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/app_settings/app-setting'

curl response:

HTTP/1.1 200 OK
Content-Length: 4
Content-Type: application/json
Date: Thu, 02 Jul 2020 15:52:54 GMT
Vary: Accept-Encoding

{

}