Creates an access control list (ACL).

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateAcl

The operation that you want to perform. Set the value to

CreateAcl.

AclOperationType String Yes Read

The type of operation allowed by the ACL. Valid values:

  • Write: data writes.
  • Read: data reads.
  • Describe: reads of transaction IDs.
  • IdempotentWrite: idempotent data writes to clusters.
AclResourceName String Yes X***

The name or ID of the resource.

  • The value can be the name of a topic, consumer group, or cluster, or the ID of a transaction.
  • You can use an asterisk (*) to represent the names or IDs of all relevant resources.
AclResourcePatternType String Yes LITERAL

The mode used to match resources. Valid values:

  • LITERAL: full-name match.
  • PREFIXED: prefix match.
AclResourceType String Yes Group

The type of the resource. Valid values:

  • Topic: topic.
  • Group: consumer group.
  • Cluster: cluster.
  • TransactionalId: transaction.
InstanceId String Yes alikafka_pre-cn-v0h1cng00***

The ID of the Message Queue for Apache Kafka instance for which you want to create the ACL.

RegionId String Yes cn-hangzhou

The ID of the region where the instance resides.

Username String Yes test***

The name of the Simple Authentication and Security Layer (SASL) user.

You can use an asterisk (*) to represent all usernames.

Response parameters

Parameter Type Example Description
Code Integer 200

The HTTP status code returned. If 200 is returned, the request is successful.

Message String operation success

The response message.

RequestId String 56729737-C428-4E1B-AC68-7A8C2D5****

The ID of the request.

Success Boolean true

Indicates whether the request is successful.

Examples

Sample requests

http(s)://alikafka.cn-hangzhou.aliyuncs.com/?Action=CreateAcl
&AclOperationType=Read
&AclResourceName=X***
&AclResourcePatternType=LITERAL
&AclResourceType=Group
&InstanceId=alikafka_pre-cn-v0h1cng00***
&RegionId=cn-hangzhou
&Username=test***
&<Common request parameters>

Sample success responses

XML format

<CreateAclResponse>
      <RequestId>56729737-C428-4E1B-AC68-7A8C2D5****</RequestId>
      <Message>operation success</Message>
      <Code>200</Code>
      <Success>true</Success>
</CreateAclResponse>

JSON format

{
    "RequestId": "56729737-C428-4E1B-AC68-7A8C2D5****",
    "Message": "operation success",
    "Code": 200,
    "Success": true
}

Error codes

For a list of error codes, visit the API Error Center.