CreateDataSource
Creates a data source 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 operation.
You must have at least one of the following roles in the DataWorks workspace:
tenant owner, workspace administrator, project owner, or operator.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dataworks:CreateDataSource |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ProjectId |
integer |
Yes |
The ID of the DataWorks workspace. You can log on to the DataWorks console and go to the Workspace Management page to obtain the ID. This parameter identifies the DataWorks workspace for the API call. |
2 |
| Name |
string |
Yes |
The name of the data source. The name can contain letters, digits, and underscores (_), and must start with a letter. It can be up to 60 characters in length. |
demo_holo_datasource |
| Type |
string |
Yes |
The type of the data source. More than 70 data source types are supported. For a list of data source types, see Data source types. |
hologres |
| ConnectionPropertiesMode |
string |
Yes |
The connection configuration mode. Valid values vary based on the Valid values:
|
InstanceMode |
| Description |
string |
No |
The description of the data source. The description can be up to 3,000 characters in length. |
this is a holo datasource |
| ConnectionProperties |
string |
Yes |
The connection configuration of the data source. Pass a JSON string. You must specify the lowercase field name |
{ "envType": "Dev", "regionId": "cn-beijing", "instanceId": "hgprecn-cn-x0r3oun4k001", "database": "testdb", "securityProtocol": "authTypeNone", "authType": "Executor" } |
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. |
B62EC203-B39E-5DC1-B5B8-EB3C6**** |
| Id |
integer |
The ID of the created data source, which identifies the data source created for the development or production environment. |
22130 |
Examples
Success response
JSON format
{
"RequestId": "B62EC203-B39E-5DC1-B5B8-EB3C6****",
"Id": 22130
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.