# Create UK8S Auto Scaling Group V2 - AddUK8SAutoScalingGroupV2

## Overview

Create an auto scaling group associated with an existing UK8S node pool. CPU, Mem, MachineType, and Zone must still be supplied for request validation.






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `AddUK8SAutoScalingGroupV2`.                      | **Yes** |
| **PublicKey**  | string  | AccessKey ID, obtained from [Console](https://console.nubexcloud.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 |
|:---|:---|:---|:---|
| **Zone** | string | Availability zone. |**Yes**|
| **ProjectId** | string | Project ID. |No|
| **Region** | string | Region. |**Yes**|
| **ClusterId** | string | UK8S cluster ID. |**Yes**|
| **Name** | string | Auto scaling group name. |**Yes**|
| **CPU** | int | CPU size of each node. |**Yes**|
| **Mem** | int | Memory size of each node. |**Yes**|
| **MachineType** | string | UHost instance type. This parameter must still be supplied; actual node specifications come from the associated node pool. |**Yes**|
| **Min** | int | Minimum node count, from 0 to 100 and no greater than Max. Must be supplied explicitly; 0 is allowed. |**Yes**|
| **Max** | int | Maximum node count, from 1 to 100 and no less than Min. |**Yes**|
| **NodeGroupId** | string | ID of the node pool associated with the auto scaling group. Required by the current implementation; node configuration comes from this pool. |**Yes**|
| **Password** | string | Base64-encoded node login password. Required when LoginMode is Password (the default); no random password is generated. May be omitted in KeyPair mode. |No|
| **BootDiskType** | string | Boot disk type. See [Disk Types](api/uhost-api/disk_type). Defaults to an SSD cloud disk. |No|
| **DataDiskType** | string | Data disk type. See [Disk Types](api/uhost-api/disk_type). Defaults to an SSD cloud disk. |No|
| **DataDiskSize** | int | Data disk size in GB. Defaults to 0. Supported size range: 20 to 1000. |No|
| **MinmalCpuPlatform** | string | Compatibility field for the minimum CPU platform. MinimalCpuPlatform takes precedence when both are supplied. |No|
| **GpuType** | string | GPU type. Actual node specifications come from the associated node pool. |No|
| **GPU** | int | Number of GPU cores. Supported only for GPU instance types. |No|
| **Labels** | string | Node labels in key=value format. Separate multiple labels with commas. Up to 5 labels are supported. |No|
| **MaxPods** | int | Maximum number of pods per node. Defaults to 110. Valid range: 16 to 512. |No|
| **BootDiskSize** | int | Boot disk size in GB. Defaults to 40. Valid range: 40 to 500. The size of a local SSD disk cannot be changed. |No|
| **ImageId** | string | Image ID. If omitted, an available image is selected automatically. Custom images are not supported; specifying a custom image ID returns an error. |No|
| **UserData** | string | Base64-encoded cloud-init user data. |No|
| **InitScript** | string | Base64-encoded user script executed after UK8S node initialization. |No|
| **ChargeType** | string | Billing mode: Year, Month, Dynamic, or Postpay. Defaults to Dynamic. This API does not accept Preemptive. |No|
| **IsolationGroup** | string | Hardware isolation group ID. Obtain it using DescribeIsolationGroup. |No|
| **Taints** | string | Node taints in key=value:effect format. Separate multiple taints with commas. Up to 5 taints are supported. |No|
| **Tag** | string | Business group. |No|
| **Priority** | int | Auto scaling group priority. Valid range: 1 to 100. A larger value indicates higher priority when scaling out. |No|
| **LoginMode** | string | Node login mode: Password or KeyPair. Defaults to Password. |No|
| **KeyPairId** | string | Login key pair ID. Required when LoginMode is KeyPair. |No|
| **MinimalCpuPlatform** | string | Minimum CPU platform. Takes precedence over the compatibility field MinmalCpuPlatform. |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|
| **AsgId** | string | ID of the created auto scaling group. |No|




## Example

### Request Example
    
```
https://api.nubexcloud.com/?Action=AddUK8SAutoScalingGroupV2
&Zone=vNFthxBl
&ProjectId=bvukNjaZ
&Region=KVccZqEg
&ClusterId=fIabqPCy
&CPU=9
&Count=8
&Password=urXocMHq
&Mem=1
&ChargeType=izxhCiKo
&BootDiskType=FxfDciLu
&DataDiskType=CiMXvwAm
&DataDiskSize=XBRksLzX
&Quantity=8
&MachineType=qkXyGuCU
&MinmalCpuPlatform=eQNDWrsb
&GpuType=qRAjUKWD
&GPU=3
&Labels=BbnsxaIO
&MaxPods=6
&IsolationGroup=RKVIlUII
&Min=uhQfZvVV
&Max=tFexHdvz
&Name=XaMCyArc
&ImageId=lNVOxsKn
&UserData=eSsxLuhI
&InitScript=VXJApjOH
&ChargeType=WQAZJFaZ
&IsolationGroup=qnQEekWT
&ChargeType=WULQCDuJ
&IsolationGroup=EKdDYzEZ
&Taints=ZvKOORev
&Tag=ZhXzQaMc
&BootDiskSize=8
&Priority=3
&NodeGroupId=ShEQvKMF
&LoginMode=wvTwlPWn
&KeyPairId=cDTkQwLg
&MinimalCpuPlatform=eiNmBuWe
```

### Response Example
    
```json
{
  "Action": "AddUK8SAutoScalingGroupV2Response",
  "Id": "yoeiVSWn",
  "Message": "LxKsbaPZ",
  "RetCode": 0
}
```





