CreateComputeResource

Updated at:

Creates a compute resource in a specified workspace for the development or production environment.

Operation description

You must purchase DataWorks Basic Edition or a higher edition to use this feature. You must have at least one of the following roles in the DataWorks workspace: Tenant Owner, Workspace Administrator, Project Owner, or O&M engineer.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dataworks:CreateComputeResource

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

ProjectId

integer

Yes

The ID of the DataWorks workspace.

2

Name

string

Yes

The name of the compute resource. The name can contain letters, digits, and underscores (_), and cannot start with a digit or an underscore. It can be up to 255 characters in length.

demo_holo_cs

Type

string

Yes

The type of the compute engine to bind. Common valid values include hologres for Hologres, odps for MaxCompute, and starrocks for StarRocks. The Type parameter determines the available ConnectionPropertiesMode and the corresponding connection properties.

hologres

ConnectionPropertiesMode

string

Yes

The connection configuration mode of the compute resource. Select a mode based on the Type parameter. Common combinations in Alibaba Cloud public cloud are InstanceMode for hologres, UrlMode for odps, and InstanceMode or UrlMode for starrocks. After selecting a mode, configure the ConnectionProperties parameter accordingly.

Valid values:

  • UrlMode :

    URL mode.

  • InstanceMode :

    Instance mode.

  • CdhMode :

    CDH mode.

InstanceMode

Description

string

No

The description of the compute resource. The description can be up to 3,000 characters in length.

demo_holo_cs

ConnectionProperties

string

Yes

The JSON string for connection configurations. JSON properties use lower camel case and correspond to the Type and ConnectionPropertiesMode parameters. The required envType property specifies the development environment Dev or the production environment Prod. Specify a valid instance or project identifier that the calling identity has permissions to access. The backend reads the configurations of the instance or project.

When using the Hologres instance mode in Alibaba Cloud public cloud, you must also specify regionId, instanceId, database, and authType. For example, if you use the same account, you can use Executor for the development environment and PrimaryAccount for the production environment. If you select SubAccount for the production environment, you must also specify authIdentity. If you enable securityProtocol=authTypeSsl, you must specify sslMode=require.

When using the MaxCompute URL mode, specify project, regionId, endpointMode, and authType. For StarRocks, the instance mode uses regionId, instanceId, and instanceType, while the URL mode uses the connection endpoint. For the complete list of fields, refer to the configuration requirements of the corresponding compute engine.

{ "envType": "Prod", "regionId": "cn-beijing", "instanceId": "hgprecn-cn-x0r3oun4k001", "database": "testdb", "authType": "PrimaryAccount", "securityProtocol": "authTypeNone" }

Response elements

Element

Type

Description

Example

object

The response.

RequestId

string

The request ID. You can use the ID to locate logs and troubleshoot issues.

22C97E95-F023-56B5-8852-B1A77A17XXXX

Id

integer

The ID of the created compute resource.

10001

Examples

Success response

JSON format

{
  "RequestId": "22C97E95-F023-56B5-8852-B1A77A17XXXX",
  "Id": 10001
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.