GetServiceLastAccessedDetails
Queries the details of a permission audit report based on the job ID returned by the GenerateServiceLastAccessedDetails operation. The report includes the services accessible to Resource Access Management (RAM) entities and the time of the last access attempt to each service.
Operation description
Before you use the permission audit feature to change the permissions of a RAM identity, read Usage notes for the permission audit overview.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ram:GetServiceLastAccessedDetails |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Marker |
string |
No |
The token used to query the next page of results. The When you call the API for the first time, if the total number of returned entries exceeds the |
CgxMaXN0UmFtVXNlcnMSEDExNzkxNDgwMzgyMTQyNTUaATIgZA== |
| MaxItems |
integer |
No |
The maximum number of entries per page. Valid values: 1 to 100. Default value: 50. |
50 |
| JobId |
string |
Yes |
The ID of the permission audit task, which is generated by the |
ba536aab-84c6-43af-8bcb-aa2cae2a34eb |
Used to query the task result after a task is generated by GenerateServiceLastAccessedDetails.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The ID of the request. |
697852FB-50D7-44D9-9774-530C31EAC572 |
| Marker |
string |
This parameter is returned only when |
CgxMaXN0UmFtVXNlcnMSEDE5OTQ5NTMxMDYwOTAzNzkaAjQ0IGQ= |
| IsTruncated |
boolean |
Indicates whether the returned result is truncated. Valid values:
Valid values:
|
true |
| JobCompletionTime |
string |
The time when the task was completed. |
2024-06-08T02:24:48Z |
| JobCreationTime |
string |
The time when the task was created. |
2024-06-08T02:20:47Z |
| JobStatus |
string |
The status of the task. Valid values:
|
COMPLETED |
| JobType |
string |
The granularity of the permission audit report. Valid values:
Valid values:
|
SERVICE_LEVEL |
| JobError |
object |
The error message returned when the task fails. This parameter is not returned when the task is completed. |
|
| Message |
string |
The error message. |
InternalError |
| Code |
string |
The error code. |
InternalError |
| ServicesLastAccessed |
array<object> |
The list of last access information for cloud services. This list is empty if the RAM identity does not have access permissions for any cloud service. |
|
|
array<object> |
|||
| RAMCode |
string |
The RAM code of the cloud service. |
ecs |
| ServiceCodes |
array |
The list of cloud service codes. |
|
|
string |
The cloud service code. |
ECS |
|
| LastAuthenticated |
string |
The time when the analyzed RAM identity last attempted to access the service. |
2024-01-29T07:48:35Z |
| LastAuthenticatedEntity |
string |
The ARN of the analyzed RAM identity. |
acs:ram::123459***:role/TestRole |
| TotalAuthenticatedEntities |
integer |
The number of identities that attempted to access the service. |
1 |
| TrackedActionsLastAccessed |
array<object> |
The list of action-level access information. This information is returned when the granularity of the created permission audit task is |
|
|
object |
|||
| ActionName |
string |
The name of the action. |
ram:CreateAccessKey |
| ServiceCodes |
array |
The list of cloud service codes. |
|
|
string |
The cloud service code. |
ECS |
|
| LastAccessedTime |
string |
The time when the analyzed RAM identity last attempted to perform the action. |
2024-01-29T07:48:35Z |
| LastAccessedEntity |
string |
The ARN of the analyzed RAM identity. |
acs:ram::123459***:role/TestRole |
| GrantPolicies |
array<object> |
The list of access policies that grant permission to access the cloud service. |
|
|
object |
|||
| PolicyName |
string |
The name of the access policy. |
AdministratorAccess |
| PolicyType |
string |
The type of the access policy. Valid values:
Valid values:
|
System |
| AttachedScope |
string |
The authorization scope of the access policy. Valid values:
Valid values:
|
123459*** |
| AttachedEntity |
string |
The ARN of the entity to which the access policy grants permission. Valid values:
|
acs:ram::123459***:role/TestRole |
Examples
Success response
JSON format
{
"RequestId": "697852FB-50D7-44D9-9774-530C31EAC572",
"Marker": "CgxMaXN0UmFtVXNlcnMSEDE5OTQ5NTMxMDYwOTAzNzkaAjQ0IGQ=",
"IsTruncated": true,
"JobCompletionTime": "2024-06-08T02:24:48Z",
"JobCreationTime": "2024-06-08T02:20:47Z",
"JobStatus": "COMPLETED",
"JobType": "SERVICE_LEVEL",
"JobError": {
"Message": "InternalError",
"Code": "InternalError"
},
"ServicesLastAccessed": [
{
"RAMCode": "ecs",
"ServiceCodes": [
"ECS"
],
"LastAuthenticated": "2024-01-29T07:48:35Z",
"LastAuthenticatedEntity": "acs:ram::123459***:role/TestRole",
"TotalAuthenticatedEntities": 1,
"TrackedActionsLastAccessed": [
{
"ActionName": "ram:CreateAccessKey",
"ServiceCodes": [
"ECS"
],
"LastAccessedTime": "2024-01-29T07:48:35Z",
"LastAccessedEntity": "acs:ram::123459***:role/TestRole"
}
],
"GrantPolicies": [
{
"PolicyName": "AdministratorAccess",
"PolicyType": "System",
"AttachedScope": "123459***",
"AttachedEntity": "acs:ram::123459***:role/TestRole"
}
]
}
]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter.Marker | Marker is invalid. | The Marker parameter is invalid. may be due to expired, or invalid |
| 400 | NoSuchEntity.Job | No such job. | No corresponding task |
| 400 | NotSupport.Account.Site | This site not support the account. | This site does not support this account. |
| 500 | InternalError | Internal Error. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.