SetDataSourceShare
Shares a target data source with a specified DataWorks workspace or specified users.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ProjectId |
integer |
Yes |
The ID of the DataWorks workspace to which the target data source belongs. You can call the ListProjects operation to obtain the workspace ID. |
10000 |
| DatasourceName |
string |
Yes |
The name of the target data source to be shared. |
mysql_name |
| EnvType |
string |
No |
The environment to which the target data source belongs. Valid values:
|
1 |
| ProjectPermissions |
string |
No |
The DataWorks workspace with which you want to share the target data source. After the data source is shared, all members of the workspace can view or use the target data source. Use the JSON array format. Example: [{"projectId":1000,"permission":"WRITE","sharedName":"PX_DATAHUB1.shared_name"}]. Parameter description:
|
[{"projectId":1000,"permission":"WRITE","sharedName":"PX_DATAHUB1.shared_name"}] |
| UserPermissions |
string |
No |
The users with whom you want to share the target data source. After the data source is shared, the specified users can view or use the target data source. Use the JSON array format. Example: [{"projectId":10000,"users":[{"userId":"276184575345452131","permission":"WRITE"}],"sharedName":"PX_DATAHUB1.shared_name"}]. Parameter description:
If both ProjectPermissions and UserPermissions are empty, this operation does not make any modifications. If neither is empty, both UserPermissions and ProjectPermissions take effect. |
[{"projectId":10000,"users":[{"userId":"276184575345452131","permission":"WRITE"}],"sharedName":"PX_DATAHUB1.shared_name"}] |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Success |
boolean |
Indicates whether the request was successful. Valid values:
|
true |
| RequestId |
string |
The unique ID of the request. You can use the ID to locate logs and troubleshoot issues when an error occurs. |
0000-ABCD-EFG |
| Data |
object |
The returned data for sharing the target data source. |
|
| Status |
string |
The result status of sharing the target data source. Valid values:
|
success |
| Message |
string |
The description of the cause for the failure to share the target data source. If the target data source is shared, the value of this parameter is empty. |
datasource is wrong |
Examples
Success response
JSON format
{
"Success": true,
"RequestId": "0000-ABCD-EFG\t",
"Data": {
"Status": "success",
"Message": "datasource is wrong"
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Invalid.DI.Parameter | The parameter is invalid. | The parameter is invalid. |
| 500 | InternalError.DI.Parameter | A DI internal error occurred. | A Data Integration internal business error occurred. |
| 403 | Forbidden.DI.NoPrivilege | No access. | Access denied. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.