CreateComputeEnv

Last updated: 2019-12-05 17:07:35

1. API Description

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

This API is used to create a compute environment.

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

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 parameter. The value used for this API: CreateComputeEnv
Version Yes String Common parameter. The value used for this API: 2017-03-12
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
ComputeEnv Yes NamedComputeEnv Compute environment information
Placement Yes Placement Location information
ClientToken No String The string used to guarantee the idempotency of the request, which is generated by the user and must be unique for different requests. The maximum length is 64 ASCII characters. If this parameter is not specified, the idempotency of the request cannot be guaranteed.

3. Output Parameters

Parameter Name Type Description
EnvId String Compute environment ID
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Creating a Compute Environment

Input Example

https://batch.tencentcloudapi.com/?Action=CreateComputeEnv
&Placement.Zone=ap-guangzhou-2
&ComputeEnv.EnvName=test compute env
&ComputeEnv.EnvDescription=test compute env
&ComputeEnv.EnvType=MANAGED
&ComputeEnv.EnvData.InstanceType=S1.SMALL2
&ComputeEnv.EnvData.ImageId=img-bd78fy2t
&ComputeEnv.DesiredComputeNodeCount=1
&<Common request parameter>

Output Example

{
  "Response": {
    "EnvId": "env-3dhmblr3",
    "RequestId": "b2ac2379-6453-4eab-8f63-7ade00cb67b0"
  }
}

5. Developer Resources

API Explorer

This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

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
InternalError Internal error
InvalidParameter.CvmParameters Invalid CVM parameter.
InvalidParameter.EnvDescriptionTooLong The compute environment description is too long.
InvalidParameter.EnvNameTooLong The compute environment name is too long.
InvalidParameter.NotificationEventNameDuplicate Duplicate message notification event name.
InvalidParameter.NotificationTopicName Invalid topic name.
InvalidParameter.NotificationTopicNameTooLong The topic name is too long.
InvalidParameterValue.ComputeEnv Compute environment parameter validation failed.
InvalidParameterValue.InstanceType The specified instance type is not supported.
InvalidParameterValue.LocalPath Invalid local storage path.
InvalidParameterValue.Negative Invalid negative parameter.
InvalidParameterValue.RemoteStoragePath Invalid storage path format.
InvalidParameterValue.RemoteStorageSchemeType Invalid storage type.
LimitExceeded.ComputeEnvQuota Insufficient compute environment quota.
LimitExceeded.CpuQuota Insufficient CPU quota.
UnauthorizedOperation.UserNotAllowedToUseBatch It is prohibited to use the BatchCompute service.