​
Select Service
ves-io-schema-protocol_policer-API-Create
Published April 5, 2023 | Last modified May 30, 2025
Examples of creating protocol_policer
Usecase:
Create protocol-policer-1 to rate limit all TCP SYN packets
Request using vesctl:
vesctl configuration create protocol_policer -i protocol_policer.yaml
where file protocol_policer.yaml has following contents (protocol_policer.CreateRequest):
RequestJSON:
{
"metadata": {
"name": "protocol-policer-1",
"namespace": "system"
},
"spec": {
"protocol_policer": [
{
"protocol": {
"tcp": {
"flags": [
"SYN"
]
}
},
"policer": [
{
"kind": "policer",
"name": "tcp-syn-limiter"
}
]
}
]
}
}
Copied!
vesctl yaml response:
ResponseJSON:
{
"metadata": {
"name": "protocol-policer-1",
"namespace": "system",
"labels": {},
"annotations": {},
"description": "",
"disable": false
},
"system_metadata": {
"uid": "f68198be-d1ae-4299-a2a1-c93e2095a26c",
"creation_timestamp": "2025-05-30T01:21:05.616369Z",
"deletion_timestamp": null,
"modification_timestamp": null,
"initializers": null,
"finalizers": [],
"tenant": "acmecorp",
"creator_class": "examplesvc",
"creator_id": "examplesvc",
"object_index": 0,
"owner_view": null,
"labels": {}
},
"spec": {
"protocol_policer": [
{
"protocol": {
"tcp": {
"flags": [
"SYN"
]
}
},
"policer": [
{
"kind": "policer",
"uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"tenant": "acmecorp",
"namespace": "system",
"name": "tcp-syn-limiter"
}
]
}
]
}
}
Copied!
Request using curl:
curl -X 'POST' -d '{"metadata":{"name":"protocol-policer-1","namespace":"system"},"spec":{"protocol_policer":[{"protocol":{"tcp":{"flags":["SYN"]}},"policer":[{"kind":"policer","name":"tcp-syn-limiter"}]}]}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_var_folders_q2_3kp8z3zs0x5_m7pk1bgb0_ph0000gp_T_go-build1497866850_b001_apidocs.test/host=MTY6VVHQPH/svc=S:examplesvc/site=mytestce01' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/protocol_policers'
Copied!
curl response:
HTTP/1.1 200 OK
Content-Length: 1036
Content-Type: application/json
Date: Fri, 30 May 2025 01:21:05 GMT
Vary: Accept-Encoding
{
"metadata": {
"name": "protocol-policer-1",
"namespace": "system",
"labels": {
},
"annotations": {
},
"description": "",
"disable": false
},
"system_metadata": {
"uid": "f68198be-d1ae-4299-a2a1-c93e2095a26c",
"creation_timestamp": "2025-05-30T01:21:05.616369Z",
"deletion_timestamp": null,
"modification_timestamp": null,
"initializers": null,
"finalizers": [
],
"tenant": "acmecorp",
"creator_class": "examplesvc",
"creator_id": "examplesvc",
"object_index": 0,
"owner_view": null,
"labels": {
}
},
"spec": {
"protocol_policer": [
{
"protocol": {
"tcp": {
"flags": [
"SYN"
]
}
},
"policer": [
{
"kind": "policer",
"uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"tenant": "acmecorp",
"namespace": "system",
"name": "tcp-syn-limiter"
}
]
}
]
}
}
Copied!
Usecase:
Create protocol-policer-2 to rate limit all ICMP packets
Request using vesctl:
vesctl configuration create protocol_policer -i protocol_policer.yaml
where file protocol_policer.yaml has following contents (protocol_policer.CreateRequest):
RequestJSON:
{
"metadata": {
"name": "protocol-policer-2",
"namespace": "system"
},
"spec": {
"protocol_policer": [
{
"protocol": {
"icmp": {
"type": [
"ALL_ICMP_MSG"
]
}
},
"policer": [
{
"kind": "policer",
"name": "icmp-limiter"
}
]
}
]
}
}
Copied!
vesctl yaml response:
ResponseJSON:
{
"metadata": {
"name": "protocol-policer-2",
"namespace": "system",
"labels": {},
"annotations": {},
"description": "",
"disable": false
},
"system_metadata": {
"uid": "c4768415-5fba-4763-b05c-a5838366c5b3",
"creation_timestamp": "2025-05-30T01:21:05.622458Z",
"deletion_timestamp": null,
"modification_timestamp": null,
"initializers": null,
"finalizers": [],
"tenant": "acmecorp",
"creator_class": "examplesvc",
"creator_id": "examplesvc",
"object_index": 0,
"owner_view": null,
"labels": {}
},
"spec": {
"protocol_policer": [
{
"protocol": {
"icmp": {
"type": [
"ALL_ICMP_MSG"
]
}
},
"policer": [
{
"kind": "policer",
"uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"tenant": "acmecorp",
"namespace": "system",
"name": "icmp-limiter"
}
]
}
]
}
}
Copied!
Request using curl:
curl -X 'POST' -d '{"metadata":{"name":"protocol-policer-2","namespace":"system"},"spec":{"protocol_policer":[{"protocol":{"icmp":{"type":["ALL_ICMP_MSG"]}},"policer":[{"kind":"policer","name":"icmp-limiter"}]}]}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_var_folders_q2_3kp8z3zs0x5_m7pk1bgb0_ph0000gp_T_go-build1497866850_b001_apidocs.test/host=MTY6VVHQPH/svc=S:examplesvc/site=mytestce01' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/protocol_policers'
Copied!
curl response:
HTTP/1.1 200 OK
Content-Length: 1042
Content-Type: application/json
Date: Fri, 30 May 2025 01:21:05 GMT
Vary: Accept-Encoding
{
"metadata": {
"name": "protocol-policer-2",
"namespace": "system",
"labels": {
},
"annotations": {
},
"description": "",
"disable": false
},
"system_metadata": {
"uid": "c4768415-5fba-4763-b05c-a5838366c5b3",
"creation_timestamp": "2025-05-30T01:21:05.622458Z",
"deletion_timestamp": null,
"modification_timestamp": null,
"initializers": null,
"finalizers": [
],
"tenant": "acmecorp",
"creator_class": "examplesvc",
"creator_id": "examplesvc",
"object_index": 0,
"owner_view": null,
"labels": {
}
},
"spec": {
"protocol_policer": [
{
"protocol": {
"icmp": {
"type": [
"ALL_ICMP_MSG"
]
}
},
"policer": [
{
"kind": "policer",
"uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"tenant": "acmecorp",
"namespace": "system",
"name": "icmp-limiter"
}
]
}
]
}
}
Copied!