ves-io-schema-protocol_policer-API-Replace

Examples of replacing protocol_policer

Usecase:

Replace protocol-policer-1 to ratelimit TCP Syn and Reset flags

Request using vesctl:

vesctl configuration replace protocol_policer -i protocol_policer.yaml

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

metadata:
  name: protocol-policer-1
  namespace: documentation
spec:
  protocolPolicer:
  - policer:
    - kind: policer
      name: new-tcp-syn-policer
    protocol:
      tcp:
        flags:
        - SYN
        - RST

vesctl yaml response: None

Request using curl:

curl -X 'PUT' -d '{"metadata":{"name":"protocol-policer-1","namespace":"documentation"},"spec":{"protocolPolicer":[{"protocol":{"tcp":{"flags":["SYN","RST"]}},"policer":[{"kind":"policer","name":"new-tcp-syn-policer"}]}]}}' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build013258245_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/documentation/protocol_policers/protocol-policer-1'

curl response:

HTTP/1.1 200 OK
Content-Length: 4
Content-Type: application/json
Date: Wed, 16 Sep 2020 10:50:40 GMT
Vary: Accept-Encoding

{

}