Tool: create_acl
Create a new Google Cloud Managed Service for Apache Kafka ACL. Please provide the Project ID, Location, Cluster ID, and ACL ID.
A CreateAclRequest is used to create a new ACL.
parent(required): The parent cluster in which to create the ACL. Structured likeprojects/{project}/locations/{location}/clusters/{cluster}.acl_id(required): The ID to use for the ACL, which will become the final component of the ACL's name. The structure ofacl_iddefines the Resource Pattern (resource_type,resource_name,pattern_type) of the ACL.acl_idis structured like one of the following:- For ACLs on the cluster:
cluster - For ACLs on a single resource within the cluster:
topic/{resource_name},consumerGroup/{resource_name}, ortransactionalId/{resource_name} - For ACLs on all resources that match a prefix:
topicPrefixed/{resource_name},consumerGroupPrefixed/{resource_name}, ortransactionalIdPrefixed/{resource_name} - For ACLs on all resources of a given type (i.e. the wildcard literal "*"):
allTopics(representstopic/*),allConsumerGroups(representsconsumerGroup/*), orallTransactionalIds(representstransactionalId/*)
- For ACLs on the cluster:
acl(required): The ACL configuration. Itsnamefield is ignored.acl_entries(required): The list of ACL entries that apply to the resource pattern. The maximum number of allowed entries is 100. Cannot be empty. Allow the user to specify one or more ACL entries. Each ACL entry contains the following fields:principal(required): The principal. Specified as Google Cloud account, with the Kafka StandardAuthorizer prefix "User:". For example:"User:test-kafka-client@test-project.iam.gserviceaccount.com". Can be the wildcard "User:*" to refer to all users.permission_type(required): The permission type. Accepted values are (case insensitive): ALLOW, DENY.operation(required): The operation type. Allowed values are (case insensitive): ALL, READ, WRITE, CREATE, DELETE, ALTER, DESCRIBE, CLUSTER_ACTION, DESCRIBE_CONFIGS, ALTER_CONFIGS, and IDEMPOTENT_WRITE.host(required): The host. Must be set to "*" for Managed Service for Apache Kafka.
Important Notes:
- Certain resource types only allow certain operations.
- For the
clusterresource type, only CREATE, CLUSTER_ACTION, DESCRIBE_CONFIGS, ALTER_CONFIGS, IDEMPOTENT_WRITE, ALTER, DESCRIBE, and ALL are allowed. - For the
topicresource type, only READ, WRITE, CREATE, DESCRIBE, DELETE, ALTER, DESCRIBE_CONFIGS, ALTER_CONFIGS, and ALL are allowed. - For the
consumerGroupresource type, only READ, DESCRIBE, DELETE, and ALL are allowed. - For the
transactionalIdresource type only DESCRIBE, WRITE, and ALL are allowed.
- For the
The following sample demonstrate how to use curl to invoke the create_acl MCP tool.
| Curl Request |
|---|
curl --location 'https://managedkafka.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "create_acl", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Request for CreateAcl.
CreateAclRequest
| JSON representation |
|---|
{
"parent": string,
"aclId": string,
"acl": {
object ( |
| Fields | |
|---|---|
parent |
Required. The parent cluster in which to create the acl. Structured like |
aclId |
Required. The ID to use for the acl, which will become the final component of the acl's name. The structure of For acls on the cluster: For acls on a single resource within the cluster: For acls on all resources that match a prefix: For acls on all resources of a given type (i.e. the wildcard literal "*"): |
acl |
Required. Configuration of the acl to create. Its |
Acl
| JSON representation |
|---|
{
"name": string,
"aclEntries": [
{
object ( |
| Fields | |
|---|---|
name |
Identifier. The name for the acl. Represents a single Resource Pattern. Structured like: projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id} The structure of For acls on the cluster: For acls on a single resource within the cluster: For acls on all resources that match a prefix: For acls on all resources of a given type (i.e. the wildcard literal "*"): |
aclEntries[] |
Required. The ACL entries that apply to the resource pattern. The maximum number of allowed entries 100. |
etag |
Optional. A terminal 'T' character in the etag indicates that the AclEntries were truncated; more entries for the Acl exist on the Kafka Cluster, but can't be returned in the Acl due to repeated field limits. |
resourceType |
Output only. The ACL resource type derived from the name. One of: CLUSTER, TOPIC, GROUP, TRANSACTIONAL_ID. |
resourceName |
Output only. The ACL resource name derived from the name. For cluster resource_type, this is always "kafka-cluster". Can be the wildcard literal "*". |
patternType |
Output only. The ACL pattern type derived from the name. One of: LITERAL, PREFIXED. |
AclEntry
| JSON representation |
|---|
{ "principal": string, "permissionType": string, "operation": string, "host": string } |
| Fields | |
|---|---|
principal |
Required. The principal. Specified as Google Cloud account, with the Kafka StandardAuthorizer prefix "User:". For example: "User:test-kafka-client@test-project.iam.gserviceaccount.com". Can be the wildcard "User:*" to refer to all users. |
permissionType |
Required. The permission type. Accepted values are (case insensitive): ALLOW, DENY. |
operation |
Required. The operation type. Allowed values are (case insensitive): ALL, READ, WRITE, CREATE, DELETE, ALTER, DESCRIBE, CLUSTER_ACTION, DESCRIBE_CONFIGS, ALTER_CONFIGS, and IDEMPOTENT_WRITE. See https://kafka.apache.org/documentation/#operations_resources_and_protocols for valid combinations of resource_type and operation for different Kafka API requests. |
host |
Required. The host. Must be set to "*" for Managed Service for Apache Kafka. |
Output Schema
Represents the set of ACLs for a given Kafka Resource Pattern, which consists of resource_type, resource_name and pattern_type.
Acl
| JSON representation |
|---|
{
"name": string,
"aclEntries": [
{
object ( |
| Fields | |
|---|---|
name |
Identifier. The name for the acl. Represents a single Resource Pattern. Structured like: projects/{project}/locations/{location}/clusters/{cluster}/acls/{acl_id} The structure of For acls on the cluster: For acls on a single resource within the cluster: For acls on all resources that match a prefix: For acls on all resources of a given type (i.e. the wildcard literal "*"): |
aclEntries[] |
Required. The ACL entries that apply to the resource pattern. The maximum number of allowed entries 100. |
etag |
Optional. A terminal 'T' character in the etag indicates that the AclEntries were truncated; more entries for the Acl exist on the Kafka Cluster, but can't be returned in the Acl due to repeated field limits. |
resourceType |
Output only. The ACL resource type derived from the name. One of: CLUSTER, TOPIC, GROUP, TRANSACTIONAL_ID. |
resourceName |
Output only. The ACL resource name derived from the name. For cluster resource_type, this is always "kafka-cluster". Can be the wildcard literal "*". |
patternType |
Output only. The ACL pattern type derived from the name. One of: LITERAL, PREFIXED. |
AclEntry
| JSON representation |
|---|
{ "principal": string, "permissionType": string, "operation": string, "host": string } |
| Fields | |
|---|---|
principal |
Required. The principal. Specified as Google Cloud account, with the Kafka StandardAuthorizer prefix "User:". For example: "User:test-kafka-client@test-project.iam.gserviceaccount.com". Can be the wildcard "User:*" to refer to all users. |
permissionType |
Required. The permission type. Accepted values are (case insensitive): ALLOW, DENY. |
operation |
Required. The operation type. Allowed values are (case insensitive): ALL, READ, WRITE, CREATE, DELETE, ALTER, DESCRIBE, CLUSTER_ACTION, DESCRIBE_CONFIGS, ALTER_CONFIGS, and IDEMPOTENT_WRITE. See https://kafka.apache.org/documentation/#operations_resources_and_protocols for valid combinations of resource_type and operation for different Kafka API requests. |
host |
Required. The host. Must be set to "*" for Managed Service for Apache Kafka. |
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ❌ | Read Only Hint: ❌ | Open World Hint: ❌