Obtaining Service Error Details
Function
This API is used to retrieve detailed error data for services to review failure information, such as error codes, occurrences, and error messages. Data is retained for 30 days only.
Constraints
- Region restrictions: Only the CN-Hong Kong region is supported.
- API rate limiting: The total number of requests for this API from all users cannot exceed 1,000 within one minute.
- User request limit: The number of requests for this API from a single user cannot exceed 200 within one minute.
- Rate-limiting response: When the rate limit is exceeded, the API returns the HTTP status code 429 "Too Many Requests".
- Retry suggestion: If the rate limit is exceeded, wait 60 seconds and try again.
URI
POST /v1/{project_id}/maas/monitoring/{service_id}/list-errors
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition: Project ID. For details about how to obtain the project ID, see Obtaining a Project ID and Name. Constraints: N/A Range: The value can contain 32 characters. Only lowercase letters and digits are allowed. Default Value: N/A |
| service_id | Yes | String | Definition: Service IDs to be queried. Services are filtered based on the input service ID list. If this parameter is not specified, all service names corresponding to the IDs are returned. You can obtain the service ID from the response body during service creation, or call the API for obtaining the service list. The service_id field indicates the service ID. Constraints: N/A Range: The value can contain 1 to 128 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. Default Value: N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition: User token. It can be obtained by calling the IAM API that is used to obtain a user token. The value of X-Subject-Token in the response header is the user token. For details, see Authentication. Constraints: N/A Range: N/A Default Value: N/A |
| Accept-Language | No | String | Definition: Specify the expected language of the response. The server returns information or data in the specified language. Constraints: The value is in the format of <language-code>-<region-code>, for example, zh (Chinese), en-US (English-US). Multiple language priorities are supported. Use commas (,) to separate them. You can use the q parameter (0 to 1, default value 1) to specify the weight. Example: Accept-Language: zh-CN,en-US;q=0.9. Range: N/A (The client only needs to transfer the standard language label, such as zh-CN and en-US.) Default Value: N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| service_type | Yes | Integer | Definition: Service type. Constraints: N/A Range:
Default Value: N/A |
| api_keys | No | Array of strings | Definition: API key tag list, which is used for filtering. MaaS services support API key calls. Go to the API key management page to get the API key tag. The Tag field in the API key list shows the API key tag.
Constraints: N/A Range:
Default Value: N/A |
| version_id | No | String | Definition: Service version ID. If this parameter is not specified, all service versions are queried. To query the service version ID, you can call the API for querying the service version. Constraints: N/A Range: The value can contain 1 to 128 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. Default Value: N/A |
| ips | No | Array of strings | Definition: IP address list, which indicates the source IP addresses of the clients that have been called. If this parameter is not specified, all IP addresses are queried. To query the IP address, you can call the API for obtaining the IP address list. Constraints: The value must be in the IP address format. Range: N/A Default Value: N/A |
| start_time | Yes | Long | Definition: Timestamp of the start time, in milliseconds. Constraints: The end time must be within 30 days from the start time. Range: The value must be greater than 0 and no greater than the value of end_time. Default Value: N/A |
| end_time | Yes | Long | Definition: Timestamp of the end time, in milliseconds. Constraints: The end time must be within 30 days from the start time. Range: The value must be greater than 0. Default Value: N/A |
| timezone | No | String | Definition: Time zone. Constraints: N/A Range: The value must comply with the IANA time zone specifications, such as Asia/Shanghai and UTC. Default Value: Asia/Shanghai (GMT+8) |
| infer_type | Yes | String | Definition: Service inference type. Range:
Constraints: N/A Default Value: N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| total | Integer | Definition: Error code type, which can be 4xx or 5xx. Range: The value is fixed to 2. |
| count | Integer | Definition: Error code type, which can be 4xx or 5xx. Range: The value is fixed to 2. |
| items | Array of ErrorsStatisticsItem objects | Definition: List of error code details. Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code. Range: 4xx or 5xx. |
| error_count | Integer | Definition: Number of errors. Range: N/A |
| ratio | Double | Definition: Number of errors of this code to the total number of errors. Range: 0 to 1 |
| error_desc | String | Definition: Error description. Range: N/A |
| details | Array of ErrorsStatisticsItem objects | Definition: Information about a specific 4xx/5xx error, including the error code, number of errors, error percentage, and error description. Range: The error codes and messages are as follows:
|
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition: Error code, which identifies the error type. For details, see MaaS Error Codes. Range: N/A |
| error_msg | String | Definition: Error description. For details, see MaaS Error Codes. Range: N/A |
Request Example
Query the error details of real-time inference for a user service within 14 days. The service ID is 69fefc89-7d71-4936-bf4d-c0c33616558d, and the version ID is 943cb312-2dac-4402-b9a9-d99de4861cb2.
/v1/{{project_id}}/maas/monitoring/69fefc89-7d71-4936-bf4d-c0c33616558d/list-errors
{
"service_type" : 2,
"start_time" : 1768320000000,
"end_time" : 1769523118705,
"timezone" : "Asia/Shanghai",
"version_id" : "943cb312-2dac-4402-b9a9-d99de4861cb2",
"infer_type" : "real_time"
} Response Example
Status code: 200
Success response
{
"total" : 2,
"count" : 2,
"items" : [ {
"error_code" : "4xx",
"error_count" : 0,
"ratio" : 0,
"error_desc" : "Client Errors: Invalid request (for example, incorrect format or insufficient permission). This error usually occurs on the client.",
"details" : [ ]
}, {
"error_code" : "5xx",
"error_count" : 20,
"ratio" : 1,
"error_desc" : "Server Errors: Internal error during request processing on the server.",
"details" : [ {
"error_code" : "500",
"error_count" : 20,
"ratio" : 1,
"error_desc" : "An unknown error occurred on the server.",
"details" : [ ]
} ]
} ]
} Status code: 400
Failure response
{
"error_code" : "ModelArts.0104",
"error_msg" : "Invalid parameter. Issue: The end time cannot be earlier than the start time."
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Success response |
| 400 | Failure response |
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
