You can call ListClusterTemplates operation to query the list of specified or all cluster templates.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. You can use OpenAPI Explorer to search for API operations, call API operations, and dynamically generate SDK sample code.

Request parameters

Parameter Type Required Example Description
Action String Yes ListClusterTemplates

The operation that you want to perform. This parameter is required for API requests that you create by piecing together HTTP or HTTPS URLs. Set the value to ListClusterTemplates.

PageNumber Integer Yes 1

The number of the page to return. Pages start from page 1.

PageSize Integer Yes 5

The number of entries returned per page.

RegionId String No cn-hangzhou

The region ID of the instance. You can call DescribeRegions Interface to view the latest list of Alibaba Cloud regions.

BizId String No CT-1422C105DE88****

The ID of the cluster template.

ProductType String No EMR

The edition of the product. static field EMR.

ResourceGroupId String No rg-bp67acfmxazb4p****

The ID of the resource group to which the snapshot belongs. You can call ListResourceGroups View the resource group ID.

Response parameters

Parameter Type Example Description
PageNumber Integer 1

The number of the returned page.

PageSize Integer 5

The number of automatic snapshot tasks returned per page.

RequestId String 2DAD3958-DB40-45AC-A08D-01D876AA6D04

The ID of the request.

TemplateInfoList Array of TemplateInfo

The list of cluster templates.

TemplateInfo
AllowNotebook Boolean true

A reserved parameter that you do not need to specify.

BootstrapActionList Array of BootstrapAction

The list of bootstrap actions.

BootstrapAction
Arg String ---a

parameter.

Name String create

The operation name.

Path String oss://bucket/path

The path where the script of bootstrap action N is stored.

ClusterType String HADOOP

The type of ACK cluster. Valid values:

ConfigList Array of Config

The list of custom configuration items.

Config
ConfigKey String fs.trash.interval

The key of the custom configuration items.

ConfigValue String 60

The value of custom configuration item N.

Encrypt String 0

A reserved parameter. You do not need to specify this parameter.

FileName String yarn-site

The name of the file that contains custom configuration item N.

Replace String 0

A reserved parameter. You do not need to specify this parameter.

ServiceName String YARN

The name of the service for which the custom configuration item is configured. Specify the entire name in uppercase.

Configurations String [{"classification": "core-site","properties": {"fs.trash.interval": "61"}},{"classification": "hadoop-log4j","properties": {"hadoop.log.file": "hadoop1.log","hadoop.root.logger": "INFO","a.b.c": "ABC"}}]

Custom software configurations. You can specify a JSON file to modify software configurations before you start a cluster.

CreateSource String 2

The method in which the cluster template was created.

DepositType String HALF_MANAGED

Hosting type:

  • HALF_MANAGED: Semi-managed
  • MANAGED: fully MANAGED
EasEnable Boolean false

Indicates whether the cluster is a high-security cluster template. Valid values:

  • true: high security.
  • false: not highly secure
GmtCreate Long 1601361773000

The time when the accelerated domain name was created.

GmtModified Long 1601361773000

The time when the cluster template was modified.

HighAvailabilityEnable Boolean false

Indicates whether the cluster is a high-availability cluster. Valid values:

  • true: the cluster is a high-availability cluster.
  • false: The cluster is not a high-availability cluster.
HostGroupList Array of HostGroup

The list of host groups.

HostGroup
ChargeType String PostPaid

The billing method. Valid values:

  • PostPaid: pay-as-you-go clusters
  • PrePaid: subscription cluster
DiskCapacity Integer 80

The data disk capacity of host group N. Unit: GB.

DiskCount Integer 1

The number of data disks in host group N.

DiskType String CLOUD_ESSD

The data disk type of host group N.

HostGroupId String 0

A reserved parameter. You do not need to specify this parameter.

HostGroupName String Master instance group

The name of host group N.

HostGroupType String MASTER

The type of host group N.

InstanceType String ecs.g6.xlarge

The type of instances in host group N.

MultiInstanceTypes String ecs.sn1.xlarge,ecs.sn2.xlarge

A list of machine models with multiple specifications, separated by commas (,).

NodeCount Integer 1

The number of nodes in host group N.

Period String 36

Subscription duration (months: 1,2,3,4,5,6,7,8,9,12,24,36).

Note This parameter is unavailable for pay-as-you-go clusters.
SysDiskCapacity Integer 120

The system disk capacity of host group N.

SysDiskType String CLOUD_ESSD

The system disk type of host group N.

Id String CT-53B394A1B559****

The ID of the cluster template.

InitCustomHiveMetaDb Boolean false

A reserved parameter. You do not need to specify this parameter.

InstanceGeneration String ecs-3

The instance family. A reserved parameter.

IoOptimized Boolean true

Whether I/O optimization:

  • true
  • false
IsOpenPublicIp Boolean true

Whether to open public network IP:

  • true: the public IP address is activated.
  • false: no public IP address is activated.
KeyPairName String test_kp

The name of the key pair.

LogEnable Boolean false

Indicates whether to enable OSS logging. Valid values:

  • true
  • false
LogPath String oss//bucketname/path

The path of logs that are stored in OSS buckets.

MachineType String ECS

The instance type.

MasterNodeTotal Integer 1

The number of master nodes.

MetaStoreConf String rdsxxx.com

The configuration information of Hive Metastore.

MetaStoreType String local

The type of unified metadata.

NetType String vpc

The type of the network.

SecurityGroupId String sg-bp1gldj1nzq5t3b8****

The ID of the security group.

SecurityGroupName String emr_sg

The name of the security group to be created.

SoftwareInfoList List ["ZOOKEEPER"]

The information of an optional service.

SshEnable Boolean true

Whether to enable SSH:

  • true
  • false
TemplateName String template_name_2

The name of the cluster template.

UseCustomHiveMetaDb Boolean false

A reserved parameter.

UseLocalMetaDb Boolean true

Indicates whether to use local Hive metadata. Valid values:

  • true
  • false
UserDefinedEmrEcsRole String AliyunEmrEcsDefaultRole

The RAM role that is assigned to EMR to access ECS resources.

UserId String 125046002175****

The ID of the user.

VSwitchId String vsw-bp1g6ftcv6p1w6h8x****

The ID of the vSwitch.

VpcId String pc-bp15pknn5td3mkc4g****

The ID of the VPC to which the instance belongs.

ZoneId String cn-hangzhou-i

The zone ID of the reserved instance.

TotalCount Integer 1

The total number of cluster templates.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListClusterTemplates
&PageNumber=1
&PageSize=5
&<common request parameters>

Sample success responses

XML format

<TotalCount>1</TotalCount>
<RequestId>2DAD3958-DB40-45AC-A08D-01D876AA6D04</RequestId>
<PageSize>5</PageSize>
<PageNumber>1</PageNumber>
<TemplateInfoList>
    <TemplateInfo>
        <SecurityGroupName>emr_sg</SecurityGroupName>
        <BootstrapActionList>
            <BootstrapAction>
                <Path>oss://bucket/path</Path>
                <Arg>---a</Arg>
                <Name>create</Name>
            </BootstrapAction>
        </BootstrapActionList>
        <CreateSource>2</CreateSource>
        <LogEnable>false</LogEnable>
        <GmtModified>1601361773000</GmtModified>
        <HighAvailabilityEnable>false</HighAvailabilityEnable>
        <SshEnable>true</SshEnable>
        <IsOpenPublicIp>true</IsOpenPublicIp>
        <TemplateName>template_name_2</TemplateName>
        <UserDefinedEmrEcsRole>AliyunEmrEcsDefaultRole</UserDefinedEmrEcsRole>
        <NetType>vpc</NetType>
        <SoftwareInfoList>
        </SoftwareInfoList>
        <UseLocalMetaDb>true</UseLocalMetaDb>
        <KeyPairName>test_kp</KeyPairName>
        <IoOptimized>true</IoOptimized>
        <ZoneId>cn-hangzhou-i</ZoneId>
        <VSwitchId>vsw-bp1g6ftcv6p1w6h8x****</VSwitchId>
        <SecurityGroupId>sg-bp1gldj1nzq5t3b8****</SecurityGroupId>
        <DepositType>HALF_MANAGED</DepositType>
        <MachineType>ECS</MachineType>
        <MetaStoreType>LOCAL</MetaStoreType>
        <MasterNodeTotal>1</MasterNodeTotal>
        <ClusterType>HADOOP</ClusterType>
        <EasEnable>false</EasEnable>
        <GmtCreate>1601361773000</GmtCreate>
        <VpcId>vpc-bp15pknn5td3mkc4g****</VpcId>
        <UserId>125046002175****</UserId>
        <HostGroupList>
            <HostGroup>
                <HostGroupType>MASTER</HostGroupType>
                <DiskType>CLOUD_ESSD</DiskType>
                <DiskCount>1</DiskCount>
                <DiskCapacity>80</DiskCapacity>
                <HostGroupId>0</HostGroupId>
                <NodeCount>1</NodeCount>
                <SysDiskType>CLOUD_ESSD</SysDiskType>
                <ChargeType>PostPaid</ChargeType>
                <HostGroupName>Master instance group</HostGroupName>
                <InstanceType>ecs.g6.xlarge</InstanceType>
                <SysDiskCapacity>120</SysDiskCapacity>
            </HostGroup>
            <HostGroup>
                <HostGroupType>CORE</HostGroupType>
                <DiskType>CLOUD_ESSD</DiskType>
                <DiskCount>4</DiskCount>
                <DiskCapacity>80</DiskCapacity>
                <HostGroupId>0</HostGroupId>
                <NodeCount>2</NodeCount>
                <SysDiskType>CLOUD_ESSD</SysDiskType>
                <ChargeType>PostPaid</ChargeType>
                <HostGroupName>Core instance group</HostGroupName>
                <InstanceType>ecs.g6.xlarge</InstanceType>
                <SysDiskCapacity>120</SysDiskCapacity>
            </HostGroup>
        </HostGroupList>
        <Id>CT-53B394A1B559****</Id>
        <ConfigList>
        </ConfigList>
    </TemplateInfo>
</TemplateInfoList>

JSON Syntax

{
    "TotalCount": 1,
    "RequestId": "2DAD3958-DB40-45AC-A08D-01D876AA6D04",
    "PageSize": 5,
    "PageNumber": 1,
    "TemplateInfoList": {
        "TemplateInfo": [
            {
                "SecurityGroupName": "emr_sg",
                "BootstrapActionList": {
                    "BootstrapAction": [
                        {
                            "Path": "oss://bucket/path",
                            "Arg": "---a",
                            "Name": "create"
                        }
                    ]
                },
                "CreateSource": 2,
                "LogEnable": false,
                "GmtModified": 1601361773000,
                "HighAvailabilityEnable": false,
                "SshEnable": true,
                "IsOpenPublicIp": true,
                "TemplateName": "template_name_2",
                "UserDefinedEmrEcsRole": "AliyunEmrEcsDefaultRole",
                "NetType": "vpc",
                "SoftwareInfoList": {
                    "SoftwareInfo": []
                },
                "UseLocalMetaDb": true,
                "KeyPairName": "test_kp",
                "IoOptimized": true,
                "ZoneId": "cn-hangzhou-i",
                "VSwitchId": "vsw-bp1g6ftcv6p1w6h8x****",
                "SecurityGroupId": "sg-bp1gldj1nzq5t3b8****",
                "DepositType": "HALF_MANAGED",
                "MachineType": "ECS",
                "MetaStoreType": "LOCAL",
                "MasterNodeTotal": 1,
                "ClusterType": "HADOOP",
                "EasEnable": false,
                "GmtCreate": 1601361773000,
                "VpcId": "vpc-bp15pknn5td3mkc4g****",
                "UserId": "125046002175****",
                "HostGroupList": {
                    "HostGroup": [
                        {
                            "HostGroupType": "MASTER",
                            "DiskType": "CLOUD_ESSD",
                            "DiskCount": 1,
                            "DiskCapacity": 80,
                            "HostGroupId": "0",
                            "NodeCount": 1,
                            "SysDiskType": "CLOUD_ESSD",
                            "ChargeType": "PostPaid",
                            "HostGroupName": "Master instance group",
                            "InstanceType": "ecs.g6.xlarge",
                            "SysDiskCapacity": 120
                        },
                        {
                            "HostGroupType": "CORE",
                            "DiskType": "CLOUD_ESSD",
                            "DiskCount": 4,
                            "DiskCapacity": 80,
                            "HostGroupId": "0",
                            "NodeCount": 2,
                            "SysDiskType": "CLOUD_ESSD",
                            "ChargeType": "PostPaid",
                            "HostGroupName": "Core instance group",
                            "InstanceType": "ecs.g6.xlarge",
                            "SysDiskCapacity": 120
                        }
                    ]
                },
                "Id": "CT-53B394A1B559****",
                "ConfigList": {
                    "Config": []
                }
            }
        ]
    }
}