Updated on 2024-11-06 GMT+08:00

Querying Alarm Notifications

Function

This API is used to query the alarm notifications in a specified period.

URI

  • URI format

    GET /v2/{project_id}/factory/alarm-info?start_time={start_time}&end_time={end_time}&limit={limit}&offset={offset}

  • Parameter description
    Table 1 URI parameters

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID. For details about how to obtain a project ID, see Project ID and Account ID.

    start_time

    No

    Long

    Start time of an alarm. The default value is one hour before the current time. The value is a 13-digit timestamp.

    end_time

    No

    Long

    End time of an alarm. The default value is the current time. The value is a 13-digit timestamp. The time range can be the last week.

    offset

    No

    Integer

    Start page of the paging list. The default value is 0. The value must be greater than or equal to 0.

    limit

    No

    Integer

    The maximum number of records on each page. The default value is 100 and the value ranges from 1 to 1000.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

workspace

No

String

Workspace ID

  • If this parameter is not set, data in the default workspace is queried by default.
  • To query data in other workspaces, this header must be carried.

X-Auth-Token

No

String

IAM token

Minimum length: 0

Maximum length: 4096

Response Parameters

Table 3 Parameter description

Parameter

Mandatory

Type

Description

alarm_info

No

List<AlarmInfo>

Notification information. For details, see Table 4.

total

No

Integer

Number of notifications

Table 4 AlarmInfo data structure

Parameter

Mandatory

Type

Description

alarm_time

No

Long

Alarm notification time

job_name

No

String

Job name

schedule_type

No

Integer

Job instance scheduling mode. Possible values are:

0: general scheduling

2: manual scheduling

5: PatchData

6: subjob scheduling

7: one-off scheduling

send_msg

No

String

Message sent

plan_time

No

Long

Planned time

remind_type

No

Integer

Alarm notification type. The following values are available:

0: successful execution

1: execution exception/failure

3: unfinished

4: busy resources

12: cycle not completed

13: cancellation

14: successful rerun of a failed job

15: job modification

send_status

No

Integer

Job sending status. Available values include:

0: The notification was sent successfully.

1: The notification failed to be sent.

job_id

No

Long

Job ID

Example Request

GET /v2/b384b9e9ab9b4ee8994c8633aabc9505/factory/alarm-info?start_time=1702378620000&end_time=1702710169595&limit=3&offset=0

Example Response

  • Success response

    HTTP status code 200

    {
      "alarm_info": [
        {
          "alarm_time": 1702710169460,
          "job_name": "job_0998",
          "schedule_type": 0,
          "send_msg": "success",
          "plan_time": 1702378440000,
          "remind_type": 0,
          "send_status": 0,
          "job_id": 911925
        },
        {
          "job_name": "job_0998",
          "schedule_type": 0,
          "send_msg": "success",
          "remind_type": 0,
          "send_status": 0,
          "alarm_time": 1702710169375,
          "plan_time": 1702378260000,
          "job_id": 911925
        }
      ],
      "total": 20
    }
  • Failure response

    HTTP status code 400

    {
      "error_code": "DLF.0810",
      "error_msg": "Task does not exist."
    }