{
  "openapi": "3.1.0",
  "info": {
    "title": "Converge Infrastructure API",
    "version": "0.1.0",
    "description": "Contract API for desired and available Converge infrastructure described by the shared infrastructure root."
  },
  "servers": [
    {
      "url": "http://production-infrastructure.liminal.co"
    }
  ],
  "paths": {
    "/api/converge": {
      "get": {
        "description": "Return the full desired and available Converge infrastructure contract.",
        "operationId": "getConvergeInfrastructureContract",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Get infrastructure contract",
        "tags": [
          "Infrastructure"
        ]
      }
    },
    "/api/converge/products": {
      "get": {
        "description": "Return Converge product infrastructure contracts.",
        "operationId": "listConvergeInfrastructureProducts",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "products"
                  ],
                  "properties": {
                    "products": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "List infrastructure products",
        "tags": [
          "Infrastructure"
        ]
      }
    },
    "/api/converge/products/{productId}": {
      "get": {
        "description": "Return the infrastructure contract for one Converge product.",
        "parameters": [
          {
            "in": "path",
            "name": "productId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "getConvergeInfrastructureProduct",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "product"
                  ],
                  "properties": {
                    "product": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Product not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Get infrastructure product",
        "tags": [
          "Infrastructure"
        ]
      }
    },
    "/api/converge/environments/{environment}": {
      "get": {
        "description": "Return Converge infrastructure filtered to develop, staging, or production.",
        "parameters": [
          {
            "in": "path",
            "name": "environment",
            "required": true,
            "schema": {
              "enum": [
                "develop",
                "staging",
                "production"
              ],
              "type": "string"
            }
          }
        ],
        "operationId": "getConvergeInfrastructureEnvironment",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid environment",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Get infrastructure environment",
        "tags": [
          "Infrastructure"
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "InfrastructureContract": {
        "type": "object",
        "additionalProperties": true
      },
      "InfrastructureEnvironment": {
        "type": "object",
        "additionalProperties": true
      },
      "InfrastructureErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      },
      "InfrastructureProductEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "product"
        ],
        "properties": {
          "product": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "InfrastructureProducts": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "products"
        ],
        "properties": {
          "products": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      }
    }
  }
}