Shares a data source to a specific DataWorks workspace or a specific user.
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 data source belongs. You can call the ListProjects operation to query the ID. |
10000 |
| DatasourceName |
string |
Yes |
The name of the data source that you want to share. |
mysql_name |
| EnvType |
string |
No |
The environment in which the data source is used. Valid values:
|
1 |
| ProjectPermissions |
string |
No |
The DataWorks workspace to which you want to share the data source. If you configure this parameter, all members of the specified DataWorks workspace can view and use the data source. The value of this parameter is a JSON array. 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 user to whom you want to share the data source. If you configure this parameter, the specified user can view or use the data source. The value of this parameter is a JSON array. Example: [{"projectId":10000,"users":[{"userId":"276184575345452131","permission":"WRITE"}],"sharedName":"PX_DATAHUB1.shared_name"}], Parameter description:
If the ProjectPermissions and UserPermissions parameters are both left empty, the specified data source is not shared to any DataWorks workspace or user. If neither of the parameters is left empty, both parameters 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 request ID. |
0000-ABCD-EFG |
| Data |
object |
The information about the sharing operation. |
|
| Status |
string |
Indicates whether the data source was shared. Valid values:
|
success |
| Message |
string |
The reason why the data source failed to be shared. If the data source is successfully shared, the value of this parameter is an empty string. |
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. | |
| 500 | InternalError.DI.Parameter | A DI internal error occurred. | |
| 403 | Forbidden.DI.NoPrivilege | No access. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.