查询指定AccessKey的最后使用记录。
接口说明
本接口仅可查询自 2022 年 02 月 01 日起(最长 400 天),指定 AccessKey 的最后使用记录。因该数据存在一定的延迟(一般小时级),请您务必谨慎变更 AccessKey。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
actiontrail:GetAccessKeyLastUsedInfo |
get |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| AccessKey |
string |
是 |
AccessKey ID。 |
LTAI**************** |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| AccessKeyId |
string |
AccessKey ID。 |
LTAI**************** |
| AccountId |
string |
阿里云账号 ID。 |
104758519118**** |
| AccountType |
string |
AccessKey 所属账号身份类型。 枚举值:
|
ram-user |
| Detail |
string |
最后使用事件详情。 |
{ "eventId": "239EB588-CD24-522E-B0B5-174A1A58****", "eventVersion": 1, "eventSource": "ecs.cn-hangzhou.aliyuncs.com", "sourceIpAddress": "10.10.**.**", "eventType": "ApiCall", "userIdentity": { "accountId": "104758519118****", "principalId": "24549429003625****", "type": "ram-user", "userName": "alice" }, "serviceName": "Ecs", "apiVersion": "2016-01-20", "requestId": "239EB588-CD24-522E-B0B5-174A1A588BE0", "eventTime": "2021-08-05T09:21:32Z", "isGlobal": false, "acsRegion": "cn-hangzhou", "eventName": "DescribeInstances" } |
| OwnerId |
string |
AccessKey 所属账号 ID。 |
24549429003625**** |
| RequestId |
string |
请求 ID。 |
239EB588-CD24-522E-B0B5-174A1A588BE0 |
| ServiceName |
string |
最后使用的云服务。 |
Ecs |
| ServiceNameCn |
string |
最后使用的云服务中文名称。 |
云服务器ECS |
| ServiceNameEn |
string |
最后使用的云服务英文名称。 |
Elastic Compute Service |
| Source |
string |
最后使用记录来源。 枚举值:
|
ManagementEvent |
| UsedTimestamp |
integer |
最后使用时间戳。 |
1657247532000 |
| UserName |
string |
AccessKey 所属账号名称。 如果 AccountType 为 root-account,则 userName 记录为“root”;如果 AccountType 为 ram-user,则 userName 记录为 RAM 用户名。 |
alice |
示例
正常返回示例
JSON格式
{
"AccessKeyId": "LTAI****************",
"AccountId": "104758519118****",
"AccountType": "ram-user",
"Detail": "{\n \"eventId\": \"239EB588-CD24-522E-B0B5-174A1A58****\",\n \"eventVersion\": 1,\n \"eventSource\": \"ecs.cn-hangzhou.aliyuncs.com\",\n \"sourceIpAddress\": \"10.10.**.**\",\n \"eventType\": \"ApiCall\",\n \"userIdentity\": {\n \"accountId\": \"104758519118****\",\n \"principalId\": \"24549429003625****\",\n \"type\": \"ram-user\",\n \"userName\": \"alice\"\n },\n \"serviceName\": \"Ecs\",\n \"apiVersion\": \"2016-01-20\",\n \"requestId\": \"239EB588-CD24-522E-B0B5-174A1A588BE0\",\n \"eventTime\": \"2021-08-05T09:21:32Z\",\n \"isGlobal\": false,\n \"acsRegion\": \"cn-hangzhou\",\n \"eventName\": \"DescribeInstances\"\n}",
"OwnerId": "24549429003625****",
"RequestId": "239EB588-CD24-522E-B0B5-174A1A588BE0",
"ServiceName": "Ecs",
"ServiceNameCn": "云服务器ECS",
"ServiceNameEn": "Elastic Compute Service",
"Source": "ManagementEvent",
"UsedTimestamp": 1657247532000,
"UserName": "alice"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | IncompleteSignature | The request signature does not conform to Alibaba Cloud standards. | 签名不匹配。请检查AcceseKey ID和AccessKey Secret是否正确;检查签名方法是否正确。详细信息参见“签名机制”。 |
| 400 | InvalidQueryParameter | The specified query parameter is invalid. | 无效的查询参数。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。