ves-io-schema-fast_acl_rule-API-Create

Examples of creating fast_acl_rule

Usecase:

Create fast-acl-rule-black-list-deny to deny traffic from source IPs defined black list by ves-io tenant

Request using vesctl:

vesctl configuration create fast_acl_rule -i fast_acl_rule.yaml

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

RequestJSON:

{
    "metadata": {
        "name": "fast-acl-rule-black-list-deny",
        "namespace": "system"
    },
    "spec": {
        "action": {
            "simple_action": "DENY"
        },
        "ip_prefix_set": {
            "ref": [
                {
                    "kind": "ip_prefix_set",
                    "tenant": "ves-io",
                    "namespace": "shared",
                    "name": "ddos-black-list"
                }
            ]
        }
    }
}

vesctl yaml response:

ResponseJSON:

{
    "metadata": {
        "name": "fast-acl-rule-black-list-deny",
        "namespace": "system",
        "labels": {},
        "annotations": {},
        "description": "",
        "disable": false
    },
    "system_metadata": {
        "uid": "5e1e87d4-f6df-4bd0-9523-ffa9436e3070",
        "creation_timestamp": "2022-09-23T13:12:09.106678588Z",
        "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": {
        "action": {
            "simple_action": "DENY"
        },
        "port": [],
        "ip_prefix_set": {
            "ref": [
                {
                    "kind": "ip_prefix_set",
                    "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
                    "tenant": "ves-io",
                    "namespace": "shared",
                    "name": "ddos-black-list"
                }
            ]
        }
    }
}

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"fast-acl-rule-black-list-deny","namespace":"system"},"spec":{"action":{"simple_action":"DENY"},"ip_prefix_set":{"ref":[{"kind":"ip_prefix_set","tenant":"ves-io","namespace":"shared","name":"ddos-black-list"}]}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build243329498_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/fast_acl_rules'

curl response:

HTTP/1.1 200 OK
Content-Length: 966
Content-Type: application/json
Date: Fri, 23 Sep 2022 13:12:09 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "fast-acl-rule-black-list-deny",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "5e1e87d4-f6df-4bd0-9523-ffa9436e3070",
    "creation_timestamp": "2022-09-23T13:12:09.106678588Z",
    "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": {
    "action": {
      "simple_action": "DENY"
    },
    "port": [
    ],
    "ip_prefix_set": {
      "ref": [
        {
          "kind": "ip_prefix_set",
          "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
          "tenant": "ves-io",
          "namespace": "shared",
          "name": "ddos-black-list"
        }
      ]
    }
  }
}

Usecase:

Create fast-acl-rule-white-list to accept traffic only from tenant created white list

Request using vesctl:

vesctl configuration create fast_acl_rule -i fast_acl_rule.yaml

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

RequestJSON:

{
    "metadata": {
        "name": "fast-acl-rule-white-list",
        "namespace": "system"
    },
    "spec": {
        "action": {
            "simple_action": "ALLOW"
        },
        "ip_prefix_set": {
            "ref": [
                {
                    "kind": "ip_prefix_set",
                    "tenant": "acmecorp",
                    "namespace": "system",
                    "name": "acmecorp-white-list"
                }
            ]
        }
    }
}

vesctl yaml response:

ResponseJSON:

{
    "metadata": {
        "name": "fast-acl-rule-white-list",
        "namespace": "system",
        "labels": {},
        "annotations": {},
        "description": "",
        "disable": false
    },
    "system_metadata": {
        "uid": "143d07c5-e09b-4af9-96ac-81cd5568c6a3",
        "creation_timestamp": "2022-09-23T13:12:09.109354360Z",
        "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": {
        "action": {
            "simple_action": "ALLOW"
        },
        "port": [],
        "ip_prefix_set": {
            "ref": [
                {
                    "kind": "ip_prefix_set",
                    "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
                    "tenant": "acmecorp",
                    "namespace": "system",
                    "name": "acmecorp-white-list"
                }
            ]
        }
    }
}

Request using curl:

curl -X 'POST' -d '{"metadata":{"name":"fast-acl-rule-white-list","namespace":"system"},"spec":{"action":{"simple_action":"ALLOW"},"ip_prefix_set":{"ref":[{"kind":"ip_prefix_set","tenant":"acmecorp","namespace":"system","name":"acmecorp-white-list"}]}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build243329498_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/fast_acl_rules'

curl response:

HTTP/1.1 200 OK
Content-Length: 968
Content-Type: application/json
Date: Fri, 23 Sep 2022 13:12:09 GMT
Vary: Accept-Encoding

{
  "metadata": {
    "name": "fast-acl-rule-white-list",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "143d07c5-e09b-4af9-96ac-81cd5568c6a3",
    "creation_timestamp": "2022-09-23T13:12:09.109354360Z",
    "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": {
    "action": {
      "simple_action": "ALLOW"
    },
    "port": [
    ],
    "ip_prefix_set": {
      "ref": [
        {
          "kind": "ip_prefix_set",
          "uid": "ffffffff-ffff-ffff-ffff-ffffffffffff",
          "tenant": "acmecorp",
          "namespace": "system",
          "name": "acmecorp-white-list"
        }
      ]
    }
  }
}