Creates a data source in a specified project workspace for the development or production environment.
Operation description
You must have purchased DataWorks Basic Edition or a higher edition.
You must have at least one of the following roles in the DataWorks project workspace:
Tenant Owner, Storage Management Administrator, Project Owner, or O&M
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 specifies the DataWorks workspace for this API call. |
2 |
| Name |
string |
Yes |
The name of the data source. The name can contain letters, digits, and underscores (_), and cannot start with a digit or underscore. The name can be up to 255 characters in length. |
demo_holo_datasource |
| Type |
string |
Yes |
The type of the data source. More than 70 data source types are supported. For more information about the enumerated data source types, refer to References: Data source type list. |
hologres |
| ConnectionPropertiesMode |
string |
Yes |
The connection mode of the data source. Different types have different subtypes with different parameter constraints. For example, a MySQL data source supports the following modes:
|
UrlMode |
| 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 properties of the data source, including the endpoint, access identity, and environment context. The envType property is a member of this object and specifies the data source environment. Valid values:
Different data source types have different property specifications under different connection patterns (ConnectionPropertiesMode). For more information, see Data source connection properties ConnectionProperties. |
{ "envType": "Prod", "regionId": "cn-beijing", "instanceId": "hgprecn-cn-x0r3oun4k001", "database": "testdb", "securityProtocol": "authTypeNone", "authType": "Executor", "authIdentity": "1107550004253538" } |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. You can use this ID to locate logs and troubleshoot issues. |
B62EC203-B39E-5DC1-B5B8-EB3C6**** |
| Id |
integer |
The ID of the created data source. This is the unique identifier of the data source. |
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.