tencent cloud

Feedback

CreateComputeEnv

Last updated: 2024-11-28 16:41:45

    1. API Description

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

    This API is used to create a compute environment.

    A maximum of 2 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: CreateComputeEnv.
    Version Yes String Common Params. The value used for this API: 2017-03-12.
    Region Yes String Common Params. For more information, please see the list of regions supported by the product. This API only supports: ap-beijing, ap-chengdu, ap-chongqing, ap-guangzhou, ap-hongkong, ap-nanjing, ap-seoul, ap-shanghai, ap-singapore, ap-tokyo, na-ashburn, na-siliconvalley.
    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, 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 Creating a compute environment

    Input Example

    https://batch.intl.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 parameters>
    

    Output Example

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

    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
    InternalError Internal error.
    InternalError.CallCam
    InternalError.CallCvm An error is returned for the CVM API call.
    InternalError.CallTagAPI Error while obtaining the Tag component.
    InvalidParameter.CvmParameters Invalid CVM parameter.
    InvalidParameter.EnvDescriptionTooLong The compute environment description is too long.
    InvalidParameter.EnvNameTooLong The compute environment name is too long.
    InvalidParameter.ImageIdMalformed Incorrect image ID.
    InvalidParameter.InvalidParameterCombination Invalid parameter combination.
    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.InvalidDataTypeAny The value of DataTypeAny is invalid.
    InvalidParameterValue.InvalidZoneMismatchRegion The availability zone and the region do not match.
    InvalidParameterValue.LocalPath Invalid local storage path.
    InvalidParameterValue.Negative Invalid negative parameter.
    InvalidParameterValue.RemoteStoragePath Invalid storage path format.
    InvalidParameterValue.RemoteStorageSchemeType Invalid storage type.
    InvalidParameterValue.UnavailableZone The availability zone is unavailable.
    InvalidZone.MismatchRegion The specified zone does not exist.
    LimitExceeded.ComputeEnvQuota Insufficient compute environment quota.
    LimitExceeded.CpuQuota Insufficient CPU quota.
    UnauthorizedOperation.UserNotAllowedToUseBatch It is prohibited to use the BatchCompute service.