Skip to content

Commit

Permalink
Add TriggererStatus to OpenAPI spec (#31579)
Browse files Browse the repository at this point in the history
* Add TriggererStatus to OpenAPI spec to health endpoint

* Update spec

* Update description

(cherry picked from commit fc36d00)
  • Loading branch information
pierrejeambrun authored and Elad Kalif committed Jun 8, 2023
1 parent 0757e2b commit e8c9e6b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 10 deletions.
25 changes: 22 additions & 3 deletions airflow/api_connexion/openapi/v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1970,8 +1970,8 @@ paths:
get:
summary: Get instance status
description: |
Get the status of Airflow's metadatabase and scheduler. It includes info about
metadatabase and last heartbeat of scheduler.
Get the status of Airflow's metadatabase, triggerer and scheduler. It includes info about
metadatabase and last heartbeat of scheduler and triggerer.
x-openapi-router-controller: airflow.api_connexion.endpoints.health_endpoint
operationId: get_health
tags: [Monitoring]
Expand Down Expand Up @@ -3002,6 +3002,8 @@ components:
$ref: '#/components/schemas/MetadatabaseStatus'
scheduler:
$ref: '#/components/schemas/SchedulerStatus'
triggerer:
$ref: '#/components/schemas/TriggererStatus'

MetadatabaseStatus:
type: object
Expand All @@ -3017,7 +3019,23 @@ components:
status:
$ref: '#/components/schemas/HealthStatus'
latest_scheduler_heartbeat:
description: The time the scheduler last do a heartbeat.
description: The time the scheduler last did a heartbeat.
type: string
format: datetime
readOnly: true
nullable: true

TriggererStatus:
type: object
description: |
The status and the latest triggerer heartbeat.
*New in version 2.6.2*
properties:
status:
$ref: '#/components/schemas/HealthStatus'
latest_triggerer_heartbeat:
description: The time the triggerer last did a heartbeat.
type: string
format: datetime
readOnly: true
Expand Down Expand Up @@ -4578,6 +4596,7 @@ components:
HealthStatus:
description: Health status
type: string
nullable: true
enum:
- healthy
- unhealthy
Expand Down
31 changes: 24 additions & 7 deletions airflow/www/static/js/types/api-generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,8 @@ export interface paths {
};
"/health": {
/**
* Get the status of Airflow's metadatabase and scheduler. It includes info about
* metadatabase and last heartbeat of scheduler.
* Get the status of Airflow's metadatabase, triggerer and scheduler. It includes info about
* metadatabase and last heartbeat of scheduler and triggerer.
*/
get: operations["get_health"];
};
Expand Down Expand Up @@ -1160,6 +1160,7 @@ export interface components {
HealthInfo: {
metadatabase?: components["schemas"]["MetadatabaseStatus"];
scheduler?: components["schemas"]["SchedulerStatus"];
triggerer?: components["schemas"]["TriggererStatus"];
};
/** @description The status of the metadatabase. */
MetadatabaseStatus: {
Expand All @@ -1170,10 +1171,23 @@ export interface components {
status?: components["schemas"]["HealthStatus"];
/**
* Format: datetime
* @description The time the scheduler last do a heartbeat.
* @description The time the scheduler last did a heartbeat.
*/
latest_scheduler_heartbeat?: string | null;
};
/**
* @description The status and the latest triggerer heartbeat.
*
* *New in version 2.6.2*
*/
TriggererStatus: {
status?: components["schemas"]["HealthStatus"];
/**
* Format: datetime
* @description The time the triggerer last did a heartbeat.
*/
latest_triggerer_heartbeat?: string | null;
};
/** @description The pool */
Pool: {
/** @description The name of pool. */
Expand Down Expand Up @@ -2123,9 +2137,9 @@ export interface components {
WeightRule: "downstream" | "upstream" | "absolute";
/**
* @description Health status
* @enum {string}
* @enum {string|null}
*/
HealthStatus: "healthy" | "unhealthy";
HealthStatus: ("healthy" | "unhealthy") | null;
};
responses: {
/** Client specified an invalid argument. */
Expand Down Expand Up @@ -4135,8 +4149,8 @@ export interface operations {
};
};
/**
* Get the status of Airflow's metadatabase and scheduler. It includes info about
* metadatabase and last heartbeat of scheduler.
* Get the status of Airflow's metadatabase, triggerer and scheduler. It includes info about
* metadatabase and last heartbeat of scheduler and triggerer.
*/
get_health: {
responses: {
Expand Down Expand Up @@ -4564,6 +4578,9 @@ export type MetadatabaseStatus = CamelCasedPropertiesDeep<
export type SchedulerStatus = CamelCasedPropertiesDeep<
components["schemas"]["SchedulerStatus"]
>;
export type TriggererStatus = CamelCasedPropertiesDeep<
components["schemas"]["TriggererStatus"]
>;
export type Pool = CamelCasedPropertiesDeep<components["schemas"]["Pool"]>;
export type PoolCollection = CamelCasedPropertiesDeep<
components["schemas"]["PoolCollection"]
Expand Down

0 comments on commit e8c9e6b

Please sign in to comment.