tencent cloud

Feedback

ScaleOutCluster

Last updated: 2024-04-20 14:36:00

    1. API Description

    Domain name for API request: emr.tencentcloudapi.com.

    This API is used to scale out a cluster.

    A maximum of 20 requests can be initiated per second for this API.

    We recommend you to use API Explorer
    Try it
    API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

    2. Input Parameters

    The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

    Parameter Name Required Type Description
    Action Yes String Common Params. The value used for this API: ScaleOutCluster.
    Version Yes String Common Params. The value used for this API: 2019-01-03.
    Region No String Common Params. This parameter is not required for this API.
    InstanceChargeType Yes String The node billing mode. Valid values:
  • POSTPAID_BY_HOUR: The postpaid mode by hour.
  • SPOTPAID: The spot instance mode (for task nodes only).
  • InstanceId Yes String The cluster instance ID.
    ScaleOutNodeConfig Yes ScaleOutNodeConfig The type and number of nodes to be added.
    ClientToken No String A unique random token, which is valid for 5 minutes and needs to be specified by the caller to prevent the client from repeatedly creating resources. An example value is a9a90aa6-751a-41b6-aad6-fae36063280.
    InstanceChargePrepaid No InstanceChargePrepaid The details of the monthly subscription, including the instance period and auto-renewal. It is required if the InstanceChargeType is PREPAID.
    ScriptBootstrapActionConfig.N No Array of ScriptBootstrapActionConfig The Bootstrap action script settings.
    SoftDeployInfo.N No Array of Integer The services to be deployed for new nodes. By default, new nodes will inherit services deployed for the current node type, including default optional services. This parameter only supports the inclusion of optional services. For example, if HDFS, YARN, and Impala have been deployed for existing task nodes, when using the API for task node scale-out without deploying Impala, only HDFS and YARN are included in with this parameter.
    ServiceNodeInfo.N No Array of Integer The processes to be deployed. All processes for services to be added are deployed by default. Deployed processes can be changed. For example, HDFS, YARN, and Impala have been deployed for current task nodes, and default services are DataNode, NodeManager, and ImpalaServer; if you want to change deployed processes, you can set this parameter to DataNode,NodeManager,ImpalaServerCoordinator or DataNode,NodeManager,ImpalaServerExecutor.
    DisasterRecoverGroupIds.N No Array of String The list of spread placement group IDs. Only one can be specified.
    You can call the DescribeDisasterRecoverGroups API and obtain this parameter from the DisasterRecoverGroupId field in the response.
    Tags.N No Array of Tag The list of tags bound to added nodes.
    HardwareSourceType No String The type of resources to add. Valid values: host (general CVM resources) and pod (resources provided by a TKE or EKS cluster).
    PodSpecInfo No PodSpecInfo The pod resource information.
    ClickHouseClusterName No String The server group name selected for ClickHouse cluster scale-out.
    ClickHouseClusterType No String The server group type selected for ClickHouse cluster scale-out. Valid values: new (create a group) and old (select an existing group).
    YarnNodeLabel No String The YARN node label specified for scale-out.
    EnableStartServiceFlag No Boolean Whether to start services after scale-out.
  • true: Yes
  • false (default): No
  • ResourceSpec No NodeResourceSpec The spec settings.
    Zone No String The ID of the AZ where the instance resides, such as ap-guangzhou-1. You can call the DescribeZones API and obtain this ID from the Zone field in the response.
    SubnetId No String The subnet, which defaults to the subnet used when the cluster is created.
    ScaleOutServiceConfGroupsInfo.N No Array of ScaleOutServiceConfGroupsInfo

    3. Output Parameters

    Parameter Name Type Description
    InstanceId String The instance ID.
    ClientToken String The client token.
    Note: This field may return null, indicating that no valid values can be obtained.
    FlowId Integer The scale-out workflow ID.
    Note: This field may return null, indicating that no valid values can be obtained.
    RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

    4. Example

    Example1 Scaling Out a Cluster

    Input Example

    POST / HTTP/1.1
    Host: emr.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: ScaleOutCluster
    <Common request parameters>
    
    {
        "ClientToken": "",
        "InstanceChargeType": "SPOTPAID",
        "InstanceChargePrepaid": {
            "Period": 0,
            "RenewFlag": true
        },
        "ScriptBootstrapActionConfig": [
            {
                "CosFileURI": "https://devops-private-1251949819.cos.na-ashburn.myqcloud.com/emr/shell/emr_init.sh",
                "Args": [
                    "abc"
                ],
                "CosFileName": "emr_init",
                "ExecutionMoment": "resourceAfter"
            }
        ],
        "InstanceId": "emr-ge0vrqkl",
        "SoftDeployInfo": [
            1,
            2
        ],
        "ServiceNodeInfo": [
            7
        ],
        "DisasterRecoverGroupIds": [
            "abc"
        ],
        "Tags": [
            {
                "TagKey": "Team",
                "TagValue": "data"
            }
        ],
        "HardwareSourceType": "host",
        "PodSpecInfo": {
            "PodSpec": {
                "ResourceProviderIdentifier": "cls-a1cd23fa",
                "ResourceProviderType": "tke",
                "NodeFlag": "TASK",
                "Cpu": 1,
                "Memory": 1,
                "CpuType": "intel",
                "PodVolumes": [
                    {
                        "VolumeType": "abc",
                        "PVCVolume": {
                            "DiskSize": 1,
                            "DiskType": "abc",
                            "DiskNum": 0
                        },
                        "HostVolume": {
                            "VolumePath": "abc"
                        }
                    }
                ],
                "EnableDynamicSpecFlag": true,
                "DynamicPodSpec": {
                    "RequestCpu": 0,
                    "LimitCpu": 0,
                    "RequestMemory": 0,
                    "LimitMemory": 0
                },
                "VpcId": "vpc-d1c351hq",
                "SubnetId": "subnet-lnejfj4p",
                "PodName": "podeee"
            },
            "PodParameter": {
                "InstanceId": "abc",
                "Config": "abc",
                "Parameter": "abc"
            }
        },
        "ClickHouseClusterName": "abc",
        "ClickHouseClusterType": "new",
        "YarnNodeLabel": "abc",
        "EnableStartServiceFlag": true,
        "ResourceSpec": {
            "Tags": [
                {
                    "TagKey": "abc",
                    "TagValue": "abc"
                }
            ],
            "InstanceType": "SA2.4XLARGE64",
            "SystemDisk": [
                {
                    "Count": 1,
                    "DiskType": "CLOUD_PREMIUM",
                    "DiskSize": 70
                }
            ],
            "DataDisk": [
                {
                    "Count": 1,
                    "DiskType": "CLOUD_HSSD",
                    "DiskSize": 70
                }
            ],
            "LocalDataDisk": [
                {
                    "Count": 1,
                    "DiskType": "CLOUD_HSSD",
                    "DiskSize": 100
                }
            ]
        },
        "Zone": "ap-shanghai-5",
        "SubnetId": "subnet-lnejfj4p",
        "ScaleOutNodeConfig": {
            "NodeFlag": "CORE",
            "NodeCount": 1
        }
    }
    

    Output Example

    {
        "Response": {
            "InstanceId": "xx",
            "FlowId": 0,
            "RequestId": "xx",
            "ClientToken": "xx"
        }
    }
    

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    FailedOperation Operation failed.
    FailedOperation.GetCvmConfigQuotaFailed Failed to fetch the specifications of the CVM.
    InvalidParameter.InvalidInstanceChargeType Invalid instance billing mode.
    InvalidParameter.InvalidInstanceType Invalid model.
    InvalidParameter.InvalidNodeFlag Incorrect node type.
    InvalidParameter.InvalidSoftDeployInfo The InvalidSoftDeployInfo parameter is invalid or incorrect.
    ResourceInUse.InstanceInProcess The instance is under workflow.
    ResourceInsufficient.DiskInsufficient The disk specification is insufficient.
    ResourceInsufficient.InstanceInsufficient The node specification is unsupported or has been sold out.
    ResourceNotFound.InstanceNotFound The instance was not found.
    ResourceUnavailable.ResourceSpecNotDefaultSpec There is no default value of the current resource spec.