ves-io-schema-infraprotect_deny_list_rule-API-Create
Examples of creating infraprotect_deny_list_rule
Usecase:
Create Deny List Rule-1
Request using vesctl:
vesctl configuration create infraprotect_deny_list_rule -i infraprotect_deny_list_rule.yaml
where file infraprotect_deny_list_rule.yaml has following contents (infraprotect_deny_list_rule.CreateRequest):
RequestJSON:
{
"metadata": {
"name": "deny-list-rule-1",
"namespace": "system"
},
"spec": {
"prefix": "12.13.14.0/24",
"expiration_never": {}
}
}
vesctl yaml response:
ResponseJSON:
{
"metadata": {
"name": "deny-list-rule-1",
"namespace": "system",
"labels": {},
"annotations": {},
"description": "",
"disable": false
},
"system_metadata": {
"uid": "960a8a52-029c-41b0-be75-aa89638d7989",
"creation_timestamp": "2025-03-11T00:56:00.318859Z",
"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": {
"prefix": "12.13.14.0/24",
"expiration_never": {}
}
}
Request using curl:
curl -X 'POST' -d '{"metadata":{"name":"deny-list-rule-1","namespace":"system"},"spec":{"prefix":"12.13.14.0/24","expiration_never":{}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_var_folders_q2_3kp8z3zs0x5_m7pk1bgb0_ph0000gp_T_go-build436303540_b001_apidocs.test/host=MTY6VVHQPH/svc=S:examplesvc/site=mytestce01' 'https://acmecorp.console.ves.volterra.io/api/infraprotect/namespaces/system/infraprotect_deny_list_rules'
curl response:
HTTP/1.1 200 OK
Content-Length: 677
Content-Type: application/json
Date: Tue, 11 Mar 2025 00:56:00 GMT
Vary: Accept-Encoding
{
"metadata": {
"name": "deny-list-rule-1",
"namespace": "system",
"labels": {
},
"annotations": {
},
"description": "",
"disable": false
},
"system_metadata": {
"uid": "960a8a52-029c-41b0-be75-aa89638d7989",
"creation_timestamp": "2025-03-11T00:56:00.318859Z",
"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": {
"prefix": "12.13.14.0/24",
"expiration_never": {
}
}
}
Usecase:
Create ASN-2
Request using vesctl:
vesctl configuration create infraprotect_deny_list_rule -i infraprotect_deny_list_rule.yaml
where file infraprotect_deny_list_rule.yaml has following contents (infraprotect_deny_list_rule.CreateRequest):
RequestJSON:
{
"metadata": {
"name": "deny-list-rule-2",
"namespace": "system"
},
"spec": {
"prefix": "12.13.14.0/24",
"expiration_timestamp": "2025-03-18T00:55:29.838135Z"
}
}
vesctl yaml response:
ResponseJSON:
{
"metadata": {
"name": "deny-list-rule-2",
"namespace": "system",
"labels": {},
"annotations": {},
"description": "",
"disable": false
},
"system_metadata": {
"uid": "31e750ab-c4d6-4174-a4c7-9f24bf986ec2",
"creation_timestamp": "2025-03-11T00:56:00.322229Z",
"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": {
"prefix": "12.13.14.0/24",
"expiration_timestamp": "2025-03-18T00:55:29.838135Z"
}
}
Request using curl:
curl -X 'POST' -d '{"metadata":{"name":"deny-list-rule-2","namespace":"system"},"spec":{"prefix":"12.13.14.0/24","expiration_timestamp":"2025-03-18T00:55:29.838135Z"}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_var_folders_q2_3kp8z3zs0x5_m7pk1bgb0_ph0000gp_T_go-build436303540_b001_apidocs.test/host=MTY6VVHQPH/svc=S:examplesvc/site=mytestce01' 'https://acmecorp.console.ves.volterra.io/api/infraprotect/namespaces/system/infraprotect_deny_list_rules'
curl response:
HTTP/1.1 200 OK
Content-Length: 702
Content-Type: application/json
Date: Tue, 11 Mar 2025 00:56:00 GMT
Vary: Accept-Encoding
{
"metadata": {
"name": "deny-list-rule-2",
"namespace": "system",
"labels": {
},
"annotations": {
},
"description": "",
"disable": false
},
"system_metadata": {
"uid": "31e750ab-c4d6-4174-a4c7-9f24bf986ec2",
"creation_timestamp": "2025-03-11T00:56:00.322229Z",
"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": {
"prefix": "12.13.14.0/24",
"expiration_timestamp": "2025-03-18T00:55:29.838135Z"
}
}
Usecase:
Create ASN-2
Request using vesctl:
vesctl configuration create infraprotect_deny_list_rule -i infraprotect_deny_list_rule.yaml
where file infraprotect_deny_list_rule.yaml has following contents (infraprotect_deny_list_rule.CreateRequest):
RequestJSON:
{
"metadata": {
"name": "deny-list-rule-3",
"namespace": "system"
},
"spec": {
"prefix": "12.13.14.0/24",
"one_hour": {}
}
}
vesctl yaml response:
ResponseJSON:
{
"metadata": {
"name": "deny-list-rule-3",
"namespace": "system",
"labels": {},
"annotations": {},
"description": "",
"disable": false
},
"system_metadata": {
"uid": "9456a172-2a1f-4c23-9680-7b28d91048c8",
"creation_timestamp": "2025-03-11T00:56:00.326522Z",
"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": {
"prefix": "12.13.14.0/24"
}
}
Request using curl:
curl -X 'POST' -d '{"metadata":{"name":"deny-list-rule-3","namespace":"system"},"spec":{"prefix":"12.13.14.0/24","one_hour":{}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_var_folders_q2_3kp8z3zs0x5_m7pk1bgb0_ph0000gp_T_go-build436303540_b001_apidocs.test/host=MTY6VVHQPH/svc=S:examplesvc/site=mytestce01' 'https://acmecorp.console.ves.volterra.io/api/infraprotect/namespaces/system/infraprotect_deny_list_rules'
curl response:
HTTP/1.1 200 OK
Content-Length: 643
Content-Type: application/json
Date: Tue, 11 Mar 2025 00:56:00 GMT
Vary: Accept-Encoding
{
"metadata": {
"name": "deny-list-rule-3",
"namespace": "system",
"labels": {
},
"annotations": {
},
"description": "",
"disable": false
},
"system_metadata": {
"uid": "9456a172-2a1f-4c23-9680-7b28d91048c8",
"creation_timestamp": "2025-03-11T00:56:00.326522Z",
"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": {
"prefix": "12.13.14.0/24"
}
}