GetAccessKeyLastUsedInfo - 查询指定AccessKey的最后使用记录

更新时间:
复制为 MD 格式

查询指定AccessKey的最后使用记录。

接口说明

本接口仅可查询自 2022 年 02 月 01 日起(最长 400 天),指定 AccessKey 的最后使用记录。因该数据存在一定的延迟(一般小时级),请您务必谨慎变更 AccessKey。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

actiontrail:GetAccessKeyLastUsedInfo

get

*全部资源

*

请求参数

名称

类型

必填

描述

示例值

AccessKey

string

AccessKey ID。

LTAI****************

返回参数

名称

类型

描述

示例值

object

AccessKeyId

string

AccessKey ID。

LTAI****************

AccountId

string

阿里云账号 ID。

104758519118****

AccountType

string

AccessKey 所属账号身份类型。

枚举值:

  • root-account :

    阿里云账号

  • ram-user :

    RAM 用户

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

最后使用记录来源。

枚举值:

  • Internal :

    其他事件

  • ManagementEvent :

    管控事件

  • DataEvent :

    数据事件

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 IDAccessKey Secret是否正确;检查签名方法是否正确。详细信息参见“签名机制”。
400 InvalidQueryParameter The specified query parameter is invalid. 无效的查询参数。

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情