Deploys a Message Queue for Apache Kafka instance.

Note You can send a maximum of two queries per second (QPS).

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 StartInstance

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

DeployModule String Yes vpc

The deployment mode of the Message Queue for Apache Kafka instance. Valid values:

  • vpc: deploys the instance that allows access only from a virtual private cloud (VPC).
  • eip: deploys the instance that allows access from the Internet and a VPC.

The deployment mode of the Message Queue for Apache Kafka instance must match its instance type. Set the value to vpc if the instance allows access only from a VPC. Set the value to eip if the instance allows access from the Internet and a VPC.

InstanceId String Yes alikafka_post-cn-v0h1fgs2****

The ID of the Message Queue for Apache Kafka instance.

RegionId String Yes cn-shanghai

The region ID of the Message Queue for Apache Kafka instance.

VpcId String Yes vpc-bp1r4eg3yrxmygv****

The ID of the VPC where you want to deploy the Message Queue for Apache Kafka instance.

VSwitchId String Yes vsw-bp1j3sg5979fstnpl****

The ID of the vSwitch where you want to deploy the Message Queue for Apache Kafka instance.

ZoneId String No cn-shanghai-a

The ID of the zone where you want to deploy the Message Queue for Apache Kafka instance.

  • The zone ID of the Message Queue for Apache Kafka instance must be the same as that of the vSwitch.
  • The value must be in the format of zoneX or Region ID-X. Examples: zonea and cn-shanghai-a.
IsEipInner Boolean No false

Specifies whether the Message Queue for Apache Kafka instance supports elastic IP addresses (EIPs). Valid values:

  • true: The instance allows access from the Internet and a VPC and supports EIPs.
  • false: The instance allows access only from a VPC and does not support EIPs.

This parameter must match the instance type.

IsSetUserAndPassword Boolean No false

Specifies whether to set a new username and password for the Message Queue for Apache Kafka instance. Valid values:

  • true: indicates that a new username and password are set for the instance.
  • false: indicates that no new username or password is set for the instance.

This parameter applies only to instances that allow access from the Internet and a VPC.

Username String No username

The username for the Message Queue for Apache Kafka instance.

This parameter applies only to instances that allow access from the Internet and a VPC.

Password String No password

The password for the Message Queue for Apache Kafka instance.

This parameter applies only to instances that allow access from the Internet and a VPC.

Name String No newInstanceName

The name of the Message Queue for Apache Kafka instance.

Note Make sure that the parameter value is unique in the region of the instance.
SecurityGroup String No sg-bp13wfx7kz9pkow***

The security group of the Message Queue for Apache Kafka instance.

If you do not specify this parameter, Message Queue for Apache Kafka automatically configures a security group for the instance. If you specify this parameter, you must create the specified security group in advance. For more information, see Create a security group.

ServiceVersion String No 0.10.2

The version of the Message Queue for Apache Kafka instance. Valid values: 0.10.2 and 2.2.0.

Config String No null

The initial configurations of the Message Queue for Apache Kafka instance. The value must be a valid JSON string.

If you do not specify this parameter, it is left empty.

The Config parameter supports the following parameters:

  • enable.vpc_sasl_ssl: specifies whether to enable VPC transmission encryption. Valid values:
    • true: indicates that VPC transmission encryption is enabled. If you enable VPC transmission encryption, enable access control list (ACL).
    • false: indicates that VPC transmission encryption is disabled. By default, VPC transmission encryption is disabled.
  • enable.acl: specifies whether to enable ACL. Valid values:
    • true: indicates that ACL is enabled.
    • false: indicates that ACL is disabled. By default, ACL is disabled.
  • kafka.log.retention.hours: the maximum message retention period when the disk capacity is sufficient. Unit: hours. Valid values: 24 to 480. Default value: 72. When the disk usage reaches 85%, the disk capacity is considered insufficient, and the system deletes messages in the order in which messages are stored, from the earliest to latest.
  • kafka.message.max.bytes: the maximum size of messages that Message Queue for Apache Kafka can send and receive. Unit: byte. Valid values: 1048576 to 10485760. Default value: 1048576. Before you modify the maximum message size, make sure that the new value is consistent with those on the producer and consumer.
KMSKeyId String No 0d24xxxx-da7b-4786-b981-9a164dxxxxxx

The ID of the key that is used to encrypt data on standard SSDs in the region of the instance. You can either obtain the ID of the key from the Key Management Service (KMS) console or create a key. For more information, see Manage CMKs.

If this parameter is specified, encryption is enabled for the instance. You cannot disable encryption after it is enabled. When you call this operation, the system checks whether the AliyunServiceRoleForAlikafkaInstanceEncryption service-linked role is created. If not, the system automatically creates it. For more information, see Service-linked roles.

Response parameters

Parameter Type Example Description
Code Integer 200

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

Message String operation success.

The returned message.

RequestId String ABA4A7FD-E10F-45C7-9774-A5236015A***

The ID of the request.

Success Boolean true

Indicates whether the request is successful.

Examples

Sample requests

http(s)://[Endpoint]/?Action=StartInstance
&DeployModule=vpc
&InstanceId=alikafka_post-cn-v0h1fgs2****
&RegionId=cn-shanghai
&VpcId=vpc-bp1r4eg3yrxmygv****
&VSwitchId=vsw-bp1j3sg5979fstnpl****
&ZoneId=cn-shanghai-a
&<Common request parameters>

Sample success responses

XML format

<StartInstanceResponse>
      <Message>operation success.</Message>
      <RequestId>ABA4A7FD-E10F-45C7-9774-A5236015A***</RequestId>
      <Success>true</Success>
      <Code>200</Code>
</StartInstanceResponse>

JSON format

{
    "RequestId":"ABA4A7FD-E10F-45C7-9774-A5236015A***",
    "Message":"operation success.",
    "Code":"200",
    "Success":"true"
}

Error codes

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