Updating a Workspace Resource Permission Policy
Function
Updating a Workspace Resource Permission Policy
Calling Method
For details, see Calling APIs.
URI
PUT /v1/{project_id}/security/permission-resource/{policy_id}
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Project ID and Account ID. |
|
policy_id |
Yes |
String |
ID of the workspace resource permission policy |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
workspace |
Yes |
String |
Workspace ID. For details about how to obtain the workspace ID, see Instance ID and Workspace ID. |
|
X-Auth-Token |
Yes |
String |
IAM token, which is obtained by calling the IAM API for obtaining a user token (value of X-Subject-Token in the response header). This parameter is mandatory for token authentication. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
policy_name |
Yes |
String |
Policy name. It must start with a letter and can contain 2 to 64 characters, including letters, digits, and underscores (_). |
|
resources |
Yes |
Array of ResourcePolicyItem objects |
Resources, which include data connections. For details about how to obtain data connections, see Querying a Data Connection List. |
|
members |
Yes |
Array of MemberPolicyItem objects |
Members, including workspace users, user groups, and roles. For details about how to obtain workspace users and user groups, see Obtaining Users in a Workspace. For details about how to obtain workspace roles, see Obtaining Roles of a Workspace. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
policy_id |
String |
Policy ID. |
|
policy_name |
String |
Policy name |
|
resources |
Array of ResourcePolicyItem objects |
Resources |
|
members |
Array of MemberPolicyItem objects |
Member list. |
|
create_time |
Long |
Creation time. |
|
create_user |
String |
Creating a User |
|
update_time |
Long |
Released On |
|
Parameter |
Type |
Description |
|---|---|---|
|
resource_id |
String |
Resource ID. |
|
resource_name |
String |
Resource name |
|
resource_type |
String |
Resource type. The value can be DATA_CONNECTION or AGENCY. |
|
Parameter |
Type |
Description |
|---|---|---|
|
member_id |
String |
Member ID |
|
member_name |
String |
Member name |
|
member_type |
String |
Member type. The value can be USER, USER_GROUP, or WORKSPACE_ROLE. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error message. |
Example Requests
/v1/0833a5737480d53b2f25c010dc1a7b88/security/permission-resource/578f83559cdb4cebb0ff4527b59a2fda
{
"policy_name" : "test_resource_permission_policy",
"members" : [ {
"member_id" : "fea96c90024711b8bf8d6886407b814b",
"member_name" : "common_user",
"member_type" : "USER"
}, {
"member_id" : "0833a5736980d53b0f22c0102ffcbfc0",
"member_name" : "ei_dayu_test_usergroup_01",
"member_type" : "USER_GROUP"
} ],
"resources" : [ {
"resource_id" : "7c8a2d85d917492bb3195377cd9c36be",
"resource_name" : "hive",
"resource_type" : "DATA_CONNECTION"
} ]
}
Example Responses
Status code: 200
OK
{
"policy_id" : "b43927a45a514e93ba70524b28923500",
"policy_name" : "test_dataconnection_permission_policy",
"create_time" : 1698202688247,
"update_time" : 1698202688247,
"create_user" : "ei_dayu_test_01",
"members" : [ {
"member_id" : "fea96c90024711b8bf8d6886407b814b",
"member_name" : "common_user",
"member_type" : "USER"
}, {
"member_id" : "0833a5736980d53b0f22c0102ffcbfc0",
"member_name" : "ei_dayu_test_usergroup_01",
"member_type" : "USER_GROUP"
} ],
"resources" : [ {
"resource_id" : "7c8a2d85d917492bb3195377cd9c36be",
"resource_name" : "hive",
"resource_type" : "DATA_CONNECTION"
} ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
OK |
|
400 |
Bad Request |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.