Adding v3 Permission Policies
Function
This API is used to add v3 permission policies to a specified stream.
Calling Method
For details, see Calling APIs.
URI
POST /v3/{project_id}/streams/{streamName}/policies
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID |
|
streamName |
Yes |
String |
Name of the stream to which you want to add policies |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
stream_id |
Yes |
String |
Unique ID of the stream |
|
principal_id |
Yes |
String |
Authorized user. If the permission is granted to a specified tenant, the format is domainId. If the permission is granted to a specified sub-user of a tenant, the format is domainId of the sub-user. You can add multiple accounts and separate them by commas (,), for example, domainId1,domainId2. |
|
action_type |
Yes |
String |
Authorization operation type. - putRecords: Upload data.
- getRecords: Download data.
|
|
effect |
No |
String |
Authorization impact type
|
Response Parameters
Status code: 200
The operation is successful.
None
Example Requests
-
Add permission policies for a tenant.
POST https://{Endpoint}/v3/{project_id}/streams/{streamName}/policies { "stream_id" : "CiFdELMr0401K9GGZlp", "principal_id" : "domainid1", "action_type" : "putRecords", "effect" : "accept" } -
Add permission policies for a sub-user.
POST https://{Endpoint}/v3/{project_id}/streams/{streamName}/policies { "stream_id" : "CiFdELMr0401K9GGZlp", "principal_id" : "domainid1", "action_type" : "putRecords", "effect" : "accept" }
Example Responses
None
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
The operation is successful. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot