GetRequestLog
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
Test
RAM authorization
|
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 |
| callerInfo |
object |
The caller information. |
|
| callerType |
string |
The caller type. Valid values:
|
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-SHA256 |
| authenticationType |
string |
The authentication type. Valid values:
|
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.