Event Gateway Virtual Cluster Policies

Create Cluster Policy for Virtual Cluster

Changed on

Creates a new cluster-level policy associated with the specified Event Gateway virtual cluster.

post/v1/event-gateways/{gatewayId}/virtual-clusters/{virtualClusterId}/cluster-policies

Request

  • Base URL: https://global.api.konghq.com
  • URL: https://global.api.konghq.com/v1/event-gateways/{gatewayId}/virtual-clusters/{virtualClusterId}/cluster-policies
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer
    • HTTP bearer
    • HTTP bearer

Query parameters

beforestring uuid

Determines the id of the existing policy the new policy should be inserted before. Either 'before' or 'after' can be provided, when both are omitted the new policy is added to the end of the chain. When both are provided, the request fails with a 400 Bad Request.

afterstring uuid

Determines the id of the existing policy the new policy should be inserted after. Either 'before' or 'after' can be provided, when both are omitted the new policy is added to the end of the chain. When both are provided, the request fails with a 400 Bad Request.

Request body

OR

Example request

{
  "labels": {
    "env": "test"
  },
  "config": {
    "rules": [
      {
        "resource_names": [
          {
            "match": "orders-*"
          },
          {
            "match": "payments-*"
          }
        ]
      }
    ]
  },
  "condition": "context.auth.principal.name == \"this-user\""
}

Response

Created

typestring required

The type name of the policy.

namestring

A unique user-defined name of the policy.

descriptionstring

A human-readable description of the policy.

enabledboolean

Whether the policy is enabled.

labelsLabels

Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types.

Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_".

idstring uuid required

The unique identifier of the policy.

configobject

The configuration of the policy.

created_atstring date-time required

An ISO-8601 timestamp representation of entity creation date.

parent_policy_idstring uuid nullable

The unique identifier of the parent policy, if any.

updated_atstring date-time required

An ISO-8601 timestamp representation of entity update date.

conditionstring

A string containing the boolean expression that determines whether the policy is applied.

Example response

{
  "labels": {
    "env": "test"
  },
  "created_at": "2022-11-04T20:10:06.927Z",
  "updated_at": "2022-11-04T20:10:06.927Z"
}

Changes

    • breaking

      added to the / response property oneOf list for the response status

    • warning

      added the new key_invalid enum value to the ////// response property for the response status

    • warning

      added the new unique enum value to the ////// response property for the response status

    • info

      added txn_offset_commit discriminator mapping keys to the /// request property

    • info

      added to the /// request property oneOf list