GetRequestLog

Updated at:
Copy as MD

Queries the log details of a request by the request ID returned by an API. This operation can be used to troubleshoot issues.

Operation description

By using RAM authorization or role assumption, you can query call logs across RAM users or across Alibaba Cloud accounts. For more information about authorization, see Cross-account API error diagnostics authorization.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

openapiexplorer:GetRequestLog

get

*全部资源

*

None None

Request syntax

GET /getRequestLog HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

logRequestId

string

Yes

The request ID for which to query logs. The unique identifier of the API request (in UUID format and must be uppercase).

123E4567-E89B-12D3-A456-426614174000

Response elements

Element

Type

Description

Example

object

Schema of Response

logInfo

object

The detailed information about the API request log.

basicInfo

object

The basic information about the API request.

api

string

The API name of the queried request.

RunInstances

apiDoc

object

The API documentation information.

aliyunSite

string

The China site documentation link.

https://api.aliyun.com/document/Ecs/2014-05-26/RunInstances

alibabacloudSite

string

The international site documentation link.

https://api.alibabacloud.com/document/Ecs/2014-05-26/RunInstances

apiVersion

string

The API version information.

2014-05-26

product

string

The product code.

Ecs

productName

object

The product name information, including the Chinese name and English name.

cnName

string

The Chinese name of the product.

云服务器 ECS

enName

string

The English name of the product.

Elastic Compute Service

apiStyle

string

The API style. The value can be ROA or RPC.

roa

logRequestId

string

The request ID that was passed in.

123E4567-E89B-12D3-A456-426614174000

httpStatusCode

string

The HTTP status code in the queried log.

404

errorCode

string

The error code in the queried log. If the queried request did not return an error, this field is empty.

IncorrectStatus.TransitRouter

errorMessage

string

The error message in the queried log. If the queried request did not return an error, this field is empty.

The resource is not in a valid state for the operation.

accessDeniedDetail

object

The detailed information about the access denied error. This field is present only if the queried request ID has an authentication error.

policyType

string

The type of the policy that denied access.

AccountLevelIdentityBasedPolicy

authPrincipalOwnerId

string

The UID of the Alibaba Cloud account to which the current identity belongs.

1001234561234567

authPrincipalType

string

The identity type of the operator.

SubUser

authPrincipalDisplayName

string

The identity identifier.

205618123456123456

noPermissionType

string

The reason for the access denial.

ImplicitDeny

authAction

string

The specific action that caused the access denial.

openapiexplorer:GetRequestLog

encodedDiagnosticMessage

string

The encoded information for diagnostics. You can call the DecodeDiagnosticMessage operation of RAM to obtain more diagnostic information.

-

httpMethod

string

The HTTP request method, such as GET, PUT, or POST.

GET

requestDuration

string

The time from when the gateway receives the request to when it returns the response. Unit: milliseconds (ms).

188

sdkRequestTime

string

The time when the request was initiated. The time follows the ISO 8601 standard in UTC. Format: yyyy-MM-ddTHH:mm:ssZ.

2025-01-21T07:43:06Z

gatewayProcessTime

string

The time when the gateway received the request. The time follows the ISO 8601 standard in UTC. Format: yyyy-MM-ddTHH:mm:ssZ.

2025-01-21T07:43:06Z

regionId

string

The region ID of the service.

cn-hangzhou

endpoint

string

The endpoint corresponding to the service region.

ecs.cn-hangzhou.aliyuncs.com

throttlingResult

string

The rate limiting check result. Valid values:

  • FC.PASS: The request was not blocked by rate limiting.

  • FC.DENY: The request was blocked by rate limiting.

FC.PASS

callerInfo

object

The caller information.

callerType

string

The caller type. Valid values:

  • customer: Alibaba Cloud account.

  • sub: RAM user.

  • AssumedRoleUser: STS token-based temporary identity.

sub

callerIp

string

The IP address of the caller.

100.68.xxx.xxx

masterAccountId

string

The primary account ID.

1973374733454118

callerAccountId

string

The account ID of the caller.

241009849925897811

userAgent

string

The user agent information.

AlibabaCloud API Workbench

vpcId

string

来源 vpcId

vpc-abcd

authenticationInfo

object

The authentication information.

signatureVersion

string

The signature version.

unknown

signatureMethod

string

The signature method. Valid values:

  • HMAC-SHA1: Uses the HMAC-SHA1 algorithm for signing.

  • HMAC-SHA256: Uses the HMAC-SHA256 algorithm for signing.

HMAC-SHA256

authenticationType

string

The authentication type. Valid values:

  • AK: Includes permanent AccessKey pairs, temporary AccessKey pairs, and STS tokens.

  • PRIVATEKEY: An asymmetric encryption type of AccessKey pair.

  • BEARERTOKEN: An authenticate mechanism widely used in the OAuth 2.0 framework and cloud services.

  • CUSTOM_SPI: An efficient and secure authentication method for the delivery and management of SaaS products in Alibaba Cloud Marketplace.

  • Anonymous: Anonymous access.

  • DPS: Similar to AK, but uses a different signature algorithm. This type is exclusive to specific products.

AK

ak

string

requestId 对应的发起调用的 AK

LTAI1234abcd

parameters

array<object>

The request parameter information.

object

name

string

The name of the request parameter.

InstanceType

value

any

The value of the request parameter.

ecs.g6.large

required

boolean

Indicates whether the request parameter is required.

false

type

string

The type of the request parameter.

string

responses

object

The response information for the request.

responseBody

string

The response body.

-

responseBodyFormat

string

The response body format. Valid values: JSON, XML, and HTML.

JSON

requestId

string

The request ID of this call.

9BFC4AC1-6BE4-5405-BDEC-CA288D404812

Examples

Success response

JSON format

{
  "logInfo": {
    "basicInfo": {
      "api": "RunInstances",
      "apiDoc": {
        "aliyunSite": "https://api.aliyun.com/document/Ecs/2014-05-26/RunInstances",
        "alibabacloudSite": "https://api.alibabacloud.com/document/Ecs/2014-05-26/RunInstances"
      },
      "apiVersion": "2014-05-26",
      "product": "Ecs",
      "productName": {
        "cnName": "云服务器 ECS",
        "enName": "Elastic Compute Service"
      },
      "apiStyle": "roa",
      "logRequestId": "123E4567-E89B-12D3-A456-426614174000",
      "httpStatusCode": "404",
      "errorCode": "IncorrectStatus.TransitRouter",
      "errorMessage": "The resource is not in a valid state for the operation.",
      "accessDeniedDetail": {
        "policyType": "AccountLevelIdentityBasedPolicy",
        "authPrincipalOwnerId": "1001234561234567",
        "authPrincipalType": "SubUser",
        "authPrincipalDisplayName": "205618123456123456",
        "noPermissionType": "ImplicitDeny",
        "authAction": "openapiexplorer:GetRequestLog",
        "encodedDiagnosticMessage": "-"
      },
      "httpMethod": "GET",
      "requestDuration": "188",
      "sdkRequestTime": "2025-01-21T07:43:06Z",
      "gatewayProcessTime": "2025-01-21T07:43:06Z",
      "regionId": "cn-hangzhou",
      "endpoint": "ecs.cn-hangzhou.aliyuncs.com",
      "throttlingResult": "FC.PASS"
    },
    "callerInfo": {
      "callerType": "sub",
      "callerIp": "100.68.xxx.xxx",
      "masterAccountId": "1973374733454118",
      "callerAccountId": "241009849925897811",
      "userAgent": "AlibabaCloud API Workbench",
      "vpcId": "vpc-abcd"
    },
    "authenticationInfo": {
      "signatureVersion": "unknown",
      "signatureMethod": "HMAC-SHA256",
      "authenticationType": "AK",
      "ak": "LTAI1234abcd"
    },
    "parameters": [
      {
        "name": "InstanceType",
        "value": "ecs.g6.large\n",
        "required": false,
        "type": "string"
      }
    ],
    "responses": {
      "responseBody": "-",
      "responseBodyFormat": "JSON"
    }
  },
  "requestId": "9BFC4AC1-6BE4-5405-BDEC-CA288D404812"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParam.LogRequestId Please ensure that the request ID you provided originates from a request you made to a certain OpenAPI. 参数logRequestId无效。你请确保您提供的请求ID源自您向某个OpenAPI发出的请求。
404 NotFound.RequestLog The log related to this logRequestId does not exist, has expired, or you do not have permission to view it. 与此logRequestId相关的日志不存在、已过期或您没有查看它的权限。

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.