ves-io-schema-policer-API-Create

Examples of creating policer

Usecase:

Create policer-1 with 10kBps committed information rate and 10kB burst size

Request using vesctl:

vesctl configuration create policer -i policer.yaml

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

metadata:
  name: policer-1
  namespace: documentation
spec:
  burstSize: 10000
  committedInformationRate: 10000
  policerMode: POLICER_MODE_SHARED

vesctl yaml response:

metadata:
  annotations: {}
  labels: {}
  name: policer-1
  namespace: documentation
spec:
  burstSize: 10000
  committedInformationRate: 10000
  policerMode: POLICER_MODE_SHARED
systemMetadata:
  creationTimestamp: "2020-07-02T15:53:21.055058300Z"
  creatorClass: examplesvc.ves.io
  finalizers: []
  tenant: acmecorp
  uid: 15857622-3569-4a2e-b60a-a5a8fd316e3f

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"policer-1","namespace":"documentation"},"spec":{"committedInformationRate":10000,"burstSize":10000,"policerMode":"POLICER_MODE_SHARED"}}' -H 'Content-Type: application/json' -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/policers'

curl response:

HTTP/1.1 200 OK
Content-Length: 751
Content-Type: application/json
Date: Thu, 02 Jul 2020 15:53:21 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "policer-1",
    "namespace": "documentation",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "15857622-3569-4a2e-b60a-a5a8fd316e3f",
    "creation_timestamp": "2020-07-02T15:53:21.055058300Z",
    "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": {
    "policer_type": "POLICER_SINGLE_RATE_TWO_COLOR",
    "committed_information_rate": 10000,
    "burst_size": 10000,
    "policer_mode": "POLICER_MODE_SHARED"
  }
}