Domain name for API request: scf.intl.tencentcloudapi.com.
This API returns function running logs based on the specified log query conditions. This API is offline. To query the returned information of function request running, please use GetRequestStatus. To query function running logs, see Log Search Guide.
A maximum of 5 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: GetFunctionLogs. |
| Version | Yes | String | Common Params. The value used for this API: 2018-04-16. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| FunctionName | No | String | Function name. -To ensure compatibility of the retrieve function execution log API GetFunctionLogs, the input parameter FunctionName remains an optional field, but it is recommended to fill in this parameter. Otherwise, log acquisition failure may occur.- After associating a function with CLS, it is recommended to use the relevant CLS APIs (https://www.tencentcloud.com/document/product/614/16875?from_cn_redirect=1) to get the best log retrieval experience. |
| Offset | No | Integer | Offset of the data. Offset + Limit cannot be greater than 10000. |
| Limit | No | Integer | Length of the returned data. Offset + Limit cannot be greater than 10000. |
| Order | No | String | Whether to sort logs in descending or ascending order. Available values: desc and asc. |
| OrderBy | No | String | Sort logs by a certain field. The following fields are supported: function_name, duration, mem_usage, start_time |
| Filter | No | LogFilter | Log filter criteria. It can be used to distinguish correct and error logs. filter.RetCode=not0 means only return error logs, filter.RetCode=is0 means only return correct logs. If not passed, all logs are returned. |
| Namespace | No | String | Namespace of the function |
| Qualifier | No | String | Function version |
| FunctionRequestId | No | String | Request ID for executing the function |
| StartTime | No | Timestamp | Specific date of the query, for example: 2017-05-16 20:00:00. It must differ from endtime by no more than one day. |
| EndTime | No | Timestamp | Specific date of the query, for example: 2017-05-16 20:59:59. It must differ from startTime by no more than one day. |
| SearchContext | No | LogSearchContext | This field is offline. |
| Parameter Name | Type | Description |
|---|---|---|
| TotalCount | Integer | Total number of function logs |
| Data | Array of FunctionLog | Function log information |
| SearchContext | LogSearchContext | This field is offline. |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
Retrieve function execution log
https://scf.intl.tencentcloudapi.com/?Action=GetFunctionLogs
&FunctionName=<FunctionName>
&<Common request parameters>
{
"Response": {
"TotalCount": 1,
"Data": [
{
"MemUsage": 3174400,
"RetCode": 1,
"RetMsg": "Success",
"Log": "",
"BillDuration": 100,
"InvokeFinished": 1,
"RequestId": "bc309eaa-6d64-11e8-a7fe-5254000b4175",
"StartTime": "2018-06-11 18:46:45",
"Duration": 0.532,
"FunctionName": "APITest",
"Level": "",
"Source": "",
"RetryNum": 1
}
],
"SearchContext": {
"Offset": "",
"Limit": 0,
"Keyword": "",
"Type": ""
},
"RequestId": "e2571ff3-da04-4c53-8438-f58bf057ce4a"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| FailedOperation | Operation failed. |
| FailedOperation.AuthFailure | Login information verification failed. token verification failed. |
| FailedOperation.QueryError | Failed to query. |
| FailedOperation.TopicNotExist | Topic not found. |
| InternalError | Internal error. |
| InternalError.ES | ES error. |
| InternalError.Exception | Internal service exception. |
| InternalError.SearchFailed | Search failed |
| InternalError.System | Internal system error. |
| InvalidParameter.Cls | The log parameter is incorrect. |
| InvalidParameter.ParamError | Function creation parameter passing exception. |
| InvalidParameter.Payload | Invalid request parameters. |
| InvalidParameter.RoleCheck | RoleCheck parameter error. |
| InvalidParameterValue | Incorrect parameter value. |
| InvalidParameterValue.DateTime | Invalid DateTime input. |
| InvalidParameterValue.FunctionType | FunctionType parameter error. |
| InvalidParameterValue.ImageType | Invalid ImageType parameter value. |
| InvalidParameterValue.Offset | Invalid offset. |
| InvalidParameterValue.Order | Order input error. |
| InvalidParameterValue.OrderBy | The OrderBy value does not conform to the specification. Fix it and try again. For example values, see the corresponding API documentation: https://www.tencentcloud.com/document/product/583/17235?from_cn_redirect=1 |
| InvalidParameterValue.RetCode | Invalid RetCode. |
| InvalidParameterValue.StartTimeOrEndTime | Simultaneously specify the start date and end date. |
| LimitExceeded.Offset | Offset exceeds the limit. |
| ResourceNotFound.Function | Function does not exist. |
| ResourceNotFound.FunctionName | Function does not exist. |
| ResourceNotFound.RoleCheck | The Role does not exist. |
| UnauthorizedOperation.CAM | CAM authentication failed. |
| UnsupportedOperation | The operation is not supported. |
| UnsupportedOperation.NotSupportRegion | Unsupported region. |
フィードバック