All Products
Search
Document Center

ApsaraMQ for Kafka:CreateSaslUser

Last Updated:Apr 12, 2024

Creates a Simple Authentication and Security Layer (SASL) user.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
alikafka:CreateSaslUserWrite
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID.

cn-hangzhou
InstanceIdstringYes

The instance ID.

alikafka_pre-cn-v0h1cng0****
UsernamestringYes

The name of the SASL user.

test***
PasswordstringYes

The password of the SASL user.

12***
TypestringNo

The SASL mechanism. Valid values:

  • plain: a simple mechanism that uses usernames and passwords to verify user identities. Message Queue for Apache Kafka provides an optimized PLAIN mechanism that allows you to dynamically create SASL users for an instance without the need to restart the instance.
  • scram: a mechanism that uses usernames and passwords to verify user identities. This mechanism provides better security protection than the PLAIN mechanism. Message Queue for Apache Kafka uses SCRAM-SHA-256.

Default value: plain.

plain
MechanismstringNo

The encryption method. Valid values:

  • SCRAM-SHA-512 (default)
  • SCRAM-SHA-256
Note
  • This parameter is available only for ApsaraMQ for Kafka V3 serverless instances.
SCRAM-SHA-256

Response parameters

ParameterTypeDescriptionExample
object
Codeinteger

The HTTP status code returned. The HTTP status code 200 indicates that the request is successful.

200
Messagestring

The returned message.

operation success.
RequestIdstring

The ID of the request.

C5CA600C-7D5A-45B5-B6DB-44FAC2C****
Successboolean

Indicates whether the request is successful.

true

Examples

Sample success responses

JSONformat

{
  "Code": 200,
  "Message": "operation success.",
  "RequestId": "C5CA600C-7D5A-45B5-B6DB-44FAC2C****",
  "Success": true
}

Error codes

HTTP status codeError codeError messageDescription
400Acl.AddSasl.ErrorFailed to add a user. Please refer to the document and try again. If in doubt, submit a work order.Failed to add a user. Please refer to the document and try again. If in doubt, submit a work order.
400BIZ_SASL_USER_NOT_EXIST%s. Please check and try again later.-
400BIZ_SASL_USER_NUM_EXCEED%s. Please check and try again later.-
400MissingParameterThe %s parameter is required.-
400InvalidParameterThe %s parameter is invalid.-
400Instance.StatusNotRunningThe instance is not running and cannot operate this function. Please try again later.The instance is not running and cannot operate this function. Please try again later.
400Acl.Disable.ErrorThe Acl function is disabled. Enable it by referring to the documentation and try again.The Acl function is disabled. Enable it by referring to the documentation and try again.
400Acl.DuplicatedAuth.ErrorThe authorization has already been granted, please do not repeat the authorization.The authorization has already been granted, please do not repeat the authorization.
400BIZ_ACL_NOT_ENABLED%s. Please check and try again later.-
400BIZ_CAN_NOT_ENABLE_ACL%s. Please check and try again later.-
400BIZ_UPDATE_ACL_FAILED%s. Please check and try again later.-
400Instance.CaclulateChange.timeExample Failed to obtain the expected change time. Please try again later.Example Failed to obtain the expected change time. Please try again later.
400Acl.DelSasl.ErrorFailed to delete the user. Check the request parameters and try again.Failed to delete the user. Check the request parameters and try again.
404Instance.NotFoundNo instance found for the %s parameter.-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-04-02The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Added Error Codes: 400
    Added Error Codes: 404
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: Mechanism