# Create instance - CreateUKafkaInstance

## Overview

Create an instance using the API. <br /><br /> Before creating an instance, prepare the necessary parameters as follows: <br /><br /> 1. Obtain the Region and Zone. Access the link: /docs/api/summary/regionlist to obtain all supported regions and availability zones; <br /><br /> 2. Obtain the FrameworkVersion. Access the link: https://docs.ucloud.cn/api/ukafka-api/list_ukafka_framework_version. The FrameworkVersions[N].Version field in the response indicates the supported Kafka versions; <br /><br /> 3. ChargeType: Payment type. Available values: Dynamic (hourly), Month (monthly), Year (yearly); <br /><br /> 4. Obtain the NodeType: Node model details. Access the link: https://docs.ucloud.cn/api/ukafka-api/get_ukafka_node_type. The NodeTypeSet[N].NodeTypeName field in the response indicates all supported node models; <br /><br /> 5. Obtain the DiskSize: Disk size range. Access link: https://docs.ucloud.cn/api/ukafka-api/get_ukafka_node_type. The NodeTypeSet[N].MinDiskSize and NodeTypeSet[N].MaxDiskSize fields in the response of this interface are the range of disk size values; <br /><br /> 6. InstanceName, a custom input instance name, which can only contain Chinese and English characters, numbers, and -_.






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `CreateUKafkaInstance`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.sigcalcloud.com/uaccount/api_manage)                                             | **Yes** |
| **Signature**  | string  | User signature generated based on public key and API command, see [Signature Algorithm](/docs/api/summary/signature.md)  | **Yes** |

### Request Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Region** | string | Region. See [List of Regions and Availability Zones](/docs/api/summary/regionlist) |**Yes**|
| **Zone** | string | Availability Zones. See [List of Availability Zones](/docs/api/summary/regionlist) |**Yes**|
| **ProjectId** | string | Project ID. Leaving this field blank will default to the project ID; it is required for sub-accounts. Please refer to the [GetProjectList API](/docs/api/summary/get_project_list) |No|
| **FrameworkVersion** | string | The supported Kafka versions can be obtained through the `FrameworkVersions` field returned by the `ListUKafkaFrameworkVersion` interface. |**Yes**|
| **ChargeType** | string | Payment methods |**Yes**|
| **NodeType** | string | The supported machine models can be found by checking the InstanceTypeSet[].InstanceTypeName returned by the GetUKafkaNodeType interface. |**Yes**|
| **DiskSize** | int | Data disk size. The supported range is obtained from the InstanceTypeSet[].MaxDiskSize and MinDiskSize returned by the GetUKafkaNodeType interface. |**Yes**|
| **InstanceName** | string | Instance name, can be customized。It can only contain Chinese and English characters, numbers, and hyphens - _ . |**Yes**|
| **VPCId** | string | VPC ID，If left blank, the default VPCID will be used. |No|
| **SubnetId** | string | Subnet ID，If left blank, the default subnet ID will be used. |No|
| **BusinessId** | string | Business group, default |No|
| **Quantity** | string | Number of instances, default 1 |No|
| **NodeCount** | int | Number of cluster nodes. Default: 3 nodes. |No|
| **LogRetentionHours** | string | Kafka log retention time, supported range [1, 240]. Default is 72 hours. |No|
| **DiskControllerType** | string | Disk management mode, supported values: NONE, CLEAN. Default value: NONE |No|
| **DiskThreshold** | string | Disk cleanup threshold, supported range [70, 90]. Required if DiskControllerType is CLEAN. Default value: 90. |No|
| **IsSecurityEnabled** | string | Whether to enable the security group, supporting "true" or "false", the default is false. |No|

### Response Field

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RetCode** | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. |**Yes**|
| **Action** | string | Operation command name. |**Yes**|
| **Message** | string | Returns an error message, providing detailed description when `RetCode` is non-zero. |No|
| **InstanceId** | string | Instance resource ID |**Yes**|




## Example

### Request Example
    
```
https://api.sigcalcloud.com/?Action=CreateUKafkaInstance
&Region=cn-zj
&Zone=cn-zj-01
&ProjectId=UTnNmyFz
&FrameworkVersion=NCaSSrbA
&VPCId=Xersagmc
&SubnetId=EbTTLPWW
&ChargeType=jHScnWTI
&NodeType=cjEAuPWT
&DiskSize=3
&InstanceName=VFRMQMkS
&BusinessId=ySLTzIEl
&Quantity=CIZwhKZG
&NodeCount=3
&LogRetentionHours=ZkwzUota
&DiskControllerType=pJPWwZjQ
&DiskThreshold=FTegxrIv
&IsSecurityEnabled=ZijHghwt
```

### Response Example
    
```json
{
  "Action": "CreateUKafkaInstanceResponse",
  "InstanceId": "VtVVhchC",
  "Message": "jvKmwNEU",
  "RetCode": 0
}
```





