Modifying Kafka Access Modes
Function
This API is used to modify private or public access for Kafka.
URI
POST /v2/{project_id}/{engine}/instances/{instance_id}/plain-ssl-switch
Parameter | Mandatory | Type | Description |
---|---|---|---|
project_id | Yes | String | Project ID. For details, see Obtaining a Project ID. |
engine | Yes | String | Message engine. |
instance_id | Yes | String | Instance ID. |
Request Parameters
Parameter | Mandatory | Type | Description |
---|---|---|---|
protocol | No | String | Access modes to be enabled or disabled. |
enable | No | Boolean |
|
user_name | No | String | Username is required when SASL is enabled for the first time. After an instance is created, disabling SASL does not delete the created user. Enabling SASL again does not require the username and an entered username will be invalid. |
pass_word | No | String | Password is required when SASL is enabled for the first time. |
sasl_enabled_mechanisms | No | Array of strings | Authentication mechanism used after SASL is enabled. Validated only when SASL is enabled for the first time. Reuses are invalid.
|
Response Parameters
Status code: 200
Parameter | Type | Description |
---|---|---|
job_id | String | Background task ID. |
protocol | String | Enabling or disabling the Kafka access mode. |
enable | Boolean | Enablement or disablement. |
Example Requests
Requiring the username and password when SASL_SSL is enabled for the first time
POST https://{endpoint}/v2/{project_id}/{engine}/instances/{instance_id}/plain-ssl-switch{"protocol" : "private_sasl_ssl_enable","enable" : true,"user_name" : "root","pass_word" : "password","sasl_enabled_mechanisms" : [ "SCRAM-SHA-512", "PLAIN" ]}
Example Responses
None
Status Codes
Status Code | Description |
---|---|
200 | Successful |
Error Codes
See Error Codes.
- URI