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.

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

The ID of the Message Queue for Apache Kafka instance.

RegionId String Yes cn-hangzhou

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

VpcId String Yes vpc-bp1r4eg3yrxmygv****

The ID of the virtual private cloud (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.

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 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.

ZoneId String No cn-hangzhou-k

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-hangzhou-k.
IsEipInner Boolean No false

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

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

The value of this parameter must match the instance type. For example, if the instance allows access only from a VPC, set this parameter to false.

IsSetUserAndPassword Boolean No false

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

  • true: sets a new username and password.
  • false: does not set a new username or password.

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 a 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 {"kafka.log.retention.hours":"33"}

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: enables VPC transmission encryption. If you enable VPC transmission encryption, enable access control list (ACL).
    • false: disables VPC transmission encryption. By default, VPC transmission encryption is disabled.
  • enable.acl: specifies whether to enable ACL. Valid values:
    • true: enables ACL.
    • false: disables ACL. 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 they 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)://alikafka.cn-hangzhou.aliyuncs.com/?Action=StartInstance
&InstanceId=alikafka_post-cn-v0h1fgs2****
&RegionId=cn-hangzhou
&VpcId=vpc-bp1r4eg3yrxmygv****
&VSwitchId=vsw-bp1j3sg5979fstnpl****
&DeployModule=vpc
&ZoneId=cn-hangzhou-k
&IsEipInner=false
&IsSetUserAndPassword=false
&Username=username
&Password=password
&Name=newInstanceName
&SecurityGroup=sg-bp13wfx7kz9pkow***
&ServiceVersion= 0.10.2
&Config={"kafka.log.retention.hours":"33"}
&KMSKeyId=0d24xxxx-da7b-4786-b981-9a164dxxxxxx 
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

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

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

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