Viewing an Authorization List
Function
This API is used to view the authorization information.
This API applies to the following scenarios: When you need to know the current authorization status, review permission assignment, or manage permissions, you can use this API to view the authorization list. Before using this API, ensure that you have the permission to view authorization. After the query is complete, the authorization list is returned, including the authorized resources, authorization type, and authorization content. If you do not have the permission to view the authorization list or the authorization list does not exist, the API will return an error message.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
URI
GET /v2/{project_id}/authorizations
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Definition: Project ID. For details, see Obtaining a Project ID and Name. Constraints: N/A Range: N/A Default Value: N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
sort_by |
No |
String |
Definition: Sorting field Constraints: N/A Range: Enums:
Default Value: user_name |
order |
No |
String |
Definition: Sorting mode Constraints: N/A Range: Enums:
Default Value: ASC |
limit |
No |
Integer |
Definition: Maximum number of records returned on each page Constraints: N/A Range: [1, 1000] Default Value: 1000 |
offset |
No |
Integer |
Definition: Start page for pagination display Constraints: N/A Range: Non-negative integers Default Value: 0 |
Request Parameters
None
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
total_count |
Number |
Definition: Total number of authorizations. Range: N/A |
auth |
Array of AuthorizationResponse objects |
Definition: Authorization information list. |
Parameter |
Type |
Description |
---|---|---|
user_id |
String |
Definition: user ID. For details, see Obtaining a Username and ID. If user_id is set to all, all IAM users are authorized. If some IAM users have been authorized, the authorization setting will be updated. This parameter is mandatory only if the authorization method is set to Agency. Constraints: N/A Range: The value must contain 3 to 32 characters. Letters, digits, and hyphens (-) are allowed. Default Value: N/A |
type |
String |
Definition: Authorization type. Agency is recommended. Constraints: N/A Range:
Default Value: N/A |
content |
String |
Definition: Authorization content. Constraints:
Range: 0 to 64 Default Value: N/A |
secret_key |
String |
Definition: Secret access key (SK). Constraints: This field is required only when the authorization type is access key. Range: The value must contain 40 characters. Letters and digits are allowed. Default Value: N/A |
user_name |
String |
Definition: Username. Constraints: If user_id is set to all-users, all users will be displayed. Range: N/A Default Value: N/A |
user_type |
String |
Definition: User type. Constraints: N/A Range:
Default Value: IAM. |
create_time |
Long |
Definition: Creation timestamp. Range: N/A |
Example Requests
View an authorization list.
GET https://{endpoint}/v2/{project_id}/authorizations
Example Responses
Status code: 200
OK
{ "total_count" : 1, "auth" : [ { "user_id" : "****d80fb058844ae8b82aa66d9fe****", "user_name" : "iam-user01", "type" : "agency", "content" : "modelarts_agency", "create_time" : 15657747821288 } ] }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad request |
401 |
Unauthorized |
403 |
Forbidden |
404 |
Not found |
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