CreateComputeResource
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
Test
RAM authorization
|
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:
|
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.