{
  "openapi" : "3.1.0",
  "info" : {
    "title" : "Optimizer Hub Gateway API",
    "description" : "<p style='margin-left:0;width:80%;'>\nHTTP endpoints served by the Optimizer Hub gateway. They are exposed through the gateway HTTP endpoint (the <code>gateway</code> Service, port 8080), <b>not</b> through the management gateway base URL.<br/>\nCheck the <a href='https://www.azul.com/products/components/azul-optimizer-hub/' target='_blank'>product page</a>\nand <a href='https://docs.azul.com/optimizer-hub/' target='_blank'>documentation</a>\nfor more info about Optimizer Hub.\n</p>\n",
    "termsOfService" : "https://www.azul.com/legal/terms-of-use/",
    "contact" : {
      "name" : "Azul Support",
      "url" : "https://www.azul.com/support/",
      "email" : "support@azul.com"
    },
    "version" : "V1"
  },
  "servers" : [ {
    "url" : "http://{GATEWAY_IP}:{SERVICE_PORT}",
    "description" : "Gateway HTTP endpoint (not the management gateway)",
    "variables" : {
      "GATEWAY_IP" : {
        "default" : "localhost",
        "description" : "Address of the gateway Service"
      },
      "SERVICE_PORT" : {
        "default" : "8080",
        "description" : "HTTP port of the gateway Service"
      }
    }
  } ],
  "tags" : [ {
    "name" : "Health",
    "description" : "Health of the Optimizer Hub cluster"
  } ],
  "paths" : {
    "/opthub-health" : {
      "get" : {
        "tags" : [ "Health" ],
        "summary" : "Get the health of the Optimizer Hub cluster",
        "description" : "Intended for external probes such as load balancers. Reports DOWN (HTTP 503) until the cluster has loaded its data and is ready to serve, and UP (HTTP 200) afterwards. The HTTP status code of the response is the same as the `code` field in the body.",
        "operationId" : "opthubHealth",
        "responses" : {
          "200" : {
            "description" : "Optimizer Hub is up and ready to serve",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/HealthValue"
                },
                "example" : {
                  "healthState" : "UP",
                  "code" : 200,
                  "message" : "is up",
                  "note" : ""
                }
              }
            }
          },
          "503" : {
            "description" : "Optimizer Hub is not ready to serve",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/HealthValue"
                },
                "example" : {
                  "healthState" : "DOWN",
                  "code" : 503,
                  "message" : "not ready",
                  "note" : ""
                }
              }
            }
          }
        }
      }
    }
  },
  "components" : {
    "schemas" : {
      "HealthState" : {
        "type" : "string",
        "enum" : [ "UP", "DOWN" ]
      },
      "HealthValue" : {
        "type" : "object",
        "properties" : {
          "healthState" : {
            "$ref" : "#/components/schemas/HealthState"
          },
          "code" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "HTTP status code of the response. 200-399 when UP, 400-599 when DOWN."
          },
          "message" : {
            "type" : "string",
            "description" : "Human-readable description of the state"
          },
          "note" : {
            "type" : "string"
          }
        }
      }
    }
  }
}
