You can call this operation to create a YARN resource pool.

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 CreateResourcePool

The operation that you want to perform. Set the value to CreateResourcePool.

Active Boolean Yes true

Specifies whether to activate the resource pool.

ClusterId String Yes C-0E995C0EE7E5ECB3

The ID of the cluster.

Name String Yes default

The name of the resource pool.

PoolType String Yes CAPACITY_SCHEDULER

The scheduler type of the resource pool. Valid values: CAPACITY_SCHEDULER and FAIR_SCHEDULER.

RegionId String Yes cn-hangzhou

The ID of the region where your cluster resides.

AccessKeyId String No LTAI8ljWyu7y****

The AccessKey ID provided to you by Alibaba Cloud, which specifies the ID of the user.

Config.N.Category String No DEFAULT_SETTINGS

The name of the parameter. Valid values: DEFAULT_SETTINGS, ACCESS_CONTROL_SETTINGS, QUEUE_RESOURCE_LIMIT, QUEUE_SCHEDULING_POLICY, QUEUE_PREEMPTION, QUEUE_SUBMISSION_ACCESS_CONTROL, and QUEUE_ADMINISTRATION_ACCESS_CONTROL.

Config.N.ConfigKey String No capacity

The key of the parameter.

Config.N.ConfigValue String No 100

The value of the parameter.

Config.N.Note String No The capacity and weight of the queue

The description of the parameter.

Config. N. TargetId String No test

A parameter that no longer takes effect. You can specify any value for this parameter.

Config.N.ConfigValue String No RESOURCE_POOL_CONFIG

The type of the configuration. Set the value toRESOURCE_POOL_CONFIG.

Note String No The default resource pool.

The description of the resouce pool.

YarnSiteConfig String No ConfigList

The list of parameters that you specify in the yarn-site.xml configuration file.

Response parameters

Parameter Type Example Description 
RequestId String A544317F-4A60-4532-AC96-191B9D80420AF

The ID of the request.

Examples

Sample requests


http(s)://[Endpoint]/? Action=CreateResourcePool
&Active=true
&ClusterId=C-0E995C0EE7E5ECB3
&Config.1.Category=DEFAULT_SETTINGS
&Config.1.ConfigKey=capacity
&Config.1.configType=RESOURCE_POOL_CONFIG
&Config.1.ConfigValue=100
&Config.1.TargetId=test
&Name=default
&PoolType=CAPACITY_SCHEDULER
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

<CreateResourcePoolResponse>
	  <code>200</code>
	  <requestId>A544317F-4A60-4532-AC96-191B9D80420A</requestId>
	  <successResponse>true</successResponse>
</CreateResourcePoolResponse>

JSON format

{
	"successResponse":true,
	"requestId":"A544317F-4A60-4532-AC96-191B9D80420A",
	"code":"200"
}

Error codes

HTTP status code Error code Error message Description 
403 Params.Illegal The specified parameters are wrongly formed.. The error message returned because the format of the specified parameters is invalid.
403 User.OtherUserResource.NotAllow It is not allowed to operate other user's resource The error message returned because you are not allowed to manage resources of other users.
403 User.Account.Abnormal The User Account maybe is out of service! The error message returned because the Alibaba Cloud account is invalid.
400 AuthRealNameNotPass User real name authenticate failed! The error message returned because the Alibaba Cloud account has not passed real-name verification. Pass the verification and try again.
404 ClusterNotFound cluster not found The error message returned because the ID of the specified cluster does not exist. Check the ID of the cluster.
400 Cluster. NotRunning cluster not running The error message returned because the cluster is invalid. Select a valid cluster.
400 LimitClusterScript cluster script count limit The error message returned because the number of cluster scripts has reached the limit.
400 ClusterScriptRunning cluster has script running The error message returned because the specified cluster script has been running.
404 EcsNodeNotFound ecs node not found The error message returned because ECS instances cannot be found in the cluster. Submit a ticket.
500 InternalError The request processing has failed due to some unknown error. The error message returned because an internal error has occurred. Submit a ticket.

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