{
  "openapi": "3.0.4",
  "info": {
    "title": "Vista Gateway Public API",
    "version": "v1"
  },
  "paths": {
    "/attachment/{packageId}": {
      "post": {
        "tags": [
          "Attachment API"
        ],
        "summary": "Upload attachment",
        "description": "Uploads a binary or large attachment associated with an existing ingested package. Supports any content type. Maximum size: 10 GB.",
        "parameters": [
          {
            "name": "packageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Attachment-Filename",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Package-External-Id",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Package-Correlation-Id",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "User-Agent",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Raw binary payload. Set Content-Type to match the file being uploaded.",
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "application/pdf": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "application/json": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "image/jpeg": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "image/png": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "image/tiff": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "text/plain": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "text/csv": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "video/mp4": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "video/quicktime": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "video/webm": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttachmentCreated"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "429": {
            "description": "Too Many Requests"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "description": "Content Too Large",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/experimental/{dataType}/{assetId}": {
      "post": {
        "tags": [
          "Experimental API"
        ],
        "summary": "Experimental data type ingest",
        "description": "Ingests data for an experimental data type. The data type must exist and be marked as experimental.",
        "parameters": [
          {
            "name": "dataType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "typeVersion",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Package-External-Id",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Package-Correlation-Id",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "User-Agent",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestAccepted"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "429": {
            "description": "Too Many Requests"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "413": {
            "description": "Content Too Large",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/ISO19848": {
      "post": {
        "tags": [
          "ISO19848 API"
        ],
        "summary": "ISO19848 protocol",
        "description": "Ingests ISO19848 encoded data",
        "parameters": [
          {
            "name": "X-Package-External-Id",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Package-Correlation-Id",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "User-Agent",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "externalDocs": {
                      "url": "https://mavista.azureedge.net/vis/DataChannelList.schema.json"
                    }
                  },
                  {
                    "type": "object",
                    "externalDocs": {
                      "url": "https://mavista.azureedge.net/vis/TimeSeriesData.schema.json"
                    }
                  }
                ]
              },
              "examples": {
                "DataChannelList": {
                  "value": {
                    "Package": {
                      "Header": {
                        "ShipID": "IMO1234567",
                        "DataChannelListID": {
                          "ID": "export-IMO1234567",
                          "Version": "1",
                          "TimeStamp": "2024-01-01T05:44:31Z"
                        },
                        "VersionInformation": {
                          "NamingRule": "dnv",
                          "NamingSchemeVersion": "v2",
                          "ReferenceURL": "https://docs.vista.dnv.com"
                        },
                        "Author": "DNV",
                        "DateCreated": "2024-01-01T05:44:31Z"
                      },
                      "DataChannelList": {
                        "DataChannel": [
                          {
                            "DataChannelID": {
                              "LocalID": "/dnv-v2/vis-3-4a/621.11i-S/H135/meta/qty-level/cnt-heavy.fuel.oil",
                              "ShortID": "55f24154-68f8-5a0e-801e-133c4bf2dc44"
                            },
                            "Property": {
                              "DataChannelType": {
                                "Type": "Inst",
                                "UpdateCycle": 1
                              },
                              "Format": {
                                "Type": "Decimal"
                              },
                              "Range": {
                                "High": 100,
                                "Low": 0
                              },
                              "Unit": {
                                "UnitSymbol": "% LEL",
                                "QuantityName": "level"
                              },
                              "QualityCoding": "IEC 61162-STATUS",
                              "Name": "Fuel oil engine room tank | % LEL level heavy.fuel.oil"
                            }
                          }
                        ]
                      }
                    }
                  }
                },
                "TimeSeriesData": {
                  "value": {
                    "Package": {
                      "Header": {
                        "ShipID": "IMO1234567",
                        "TimeSpan": {
                          "Start": "2024-01-01T06:00:00Z",
                          "End": "2024-01-01T12:00:00Z"
                        },
                        "DateCreated": "2024-01-01T12:00:00Z",
                        "DateModified": "2024-01-01T12:00:00Z",
                        "Author": "Shipboard data server"
                      },
                      "TimeSeriesData": [
                        {
                          "TabularData": [
                            {
                              "NumberOfDataSet": 7,
                              "NumberOfDataChannel": 1,
                              "DataChannelID": [
                                "55f24154-68f8-5a0e-801e-133c4bf2dc44"
                              ],
                              "DataSet": [
                                {
                                  "TimeStamp": "2024-01-01T06:00:00Z",
                                  "Value": [
                                    "100.0"
                                  ],
                                  "Quality": [
                                    "A"
                                  ]
                                },
                                {
                                  "TimeStamp": "2024-01-01T07:00:00Z",
                                  "Value": [
                                    "99.0"
                                  ],
                                  "Quality": [
                                    "A"
                                  ]
                                },
                                {
                                  "TimeStamp": "2024-01-01T08:00:00Z",
                                  "Value": [
                                    "98.0"
                                  ],
                                  "Quality": [
                                    "A"
                                  ]
                                },
                                {
                                  "TimeStamp": "2024-01-01T09:00:00Z",
                                  "Value": [
                                    "97.0"
                                  ],
                                  "Quality": [
                                    "A"
                                  ]
                                },
                                {
                                  "TimeStamp": "2024-01-01T10:00:00Z",
                                  "Value": [
                                    "96.0"
                                  ],
                                  "Quality": [
                                    "A"
                                  ]
                                },
                                {
                                  "TimeStamp": "2024-01-01T11:00:00Z",
                                  "Value": [
                                    "95.0"
                                  ],
                                  "Quality": [
                                    "A"
                                  ]
                                },
                                {
                                  "TimeStamp": "2024-01-01T12:00:00Z",
                                  "Value": [
                                    "94.0"
                                  ],
                                  "Quality": [
                                    "A"
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/ISO19848/DataChannelList/{assetId}": {
      "get": {
        "tags": [
          "ISO19848 API"
        ],
        "summary": "ISO19848 DataChannelLists",
        "description": "Unique ISO19848 DataChannelLists for an asset (Max 100 documents in a descending order by ingest date)",
        "parameters": [
          {
            "name": "assetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "IMO1234567"
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DataChannelListOk"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "tags": [
          "Vista.Gateway.Api"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/health+json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthReport"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/health+json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthReport"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AttachmentCreated": {
        "type": "object",
        "properties": {
          "attachmentPackageId": {
            "type": "string",
            "format": "uuid"
          },
          "parentPackageId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "ConfigurationReference": {
        "type": "object",
        "properties": {
          "ID": {
            "type": "string",
            "nullable": true
          },
          "Version": {
            "type": "string",
            "nullable": true
          },
          "TimeStamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "DataChannel": {
        "type": "object",
        "properties": {
          "DataChannelID": {
            "$ref": "#/components/schemas/DataChannelID"
          },
          "Property": {
            "$ref": "#/components/schemas/Property"
          }
        },
        "additionalProperties": false
      },
      "DataChannelID": {
        "type": "object",
        "properties": {
          "LocalID": {
            "type": "string",
            "nullable": true
          },
          "ShortID": {
            "type": "string",
            "nullable": true
          },
          "NameObject": {
            "$ref": "#/components/schemas/NameObject"
          }
        },
        "additionalProperties": false
      },
      "DataChannelList": {
        "type": "object",
        "properties": {
          "DataChannel": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DataChannel"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "DataChannelListOk": {
        "type": "object",
        "properties": {
          "recordedPackageId": {
            "type": "string",
            "format": "uuid"
          },
          "recordedAt": {
            "type": "string",
            "format": "date-time"
          },
          "dataChannelListPackage": {
            "$ref": "#/components/schemas/DataChannelListPackage"
          },
          "metadata": {
            "$ref": "#/components/schemas/DataChannelListOkMetadata"
          }
        },
        "additionalProperties": false
      },
      "DataChannelListOkMetadata": {
        "type": "object",
        "properties": {
          "X-Package-External-Id": {
            "type": "string",
            "nullable": true
          },
          "X-Package-Correlation-Id": {
            "type": "string",
            "nullable": true
          },
          "User-Agent": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "DataChannelListPackage": {
        "type": "object",
        "properties": {
          "Package": {
            "$ref": "#/components/schemas/Package"
          }
        },
        "additionalProperties": false
      },
      "DataChannelType": {
        "type": "object",
        "properties": {
          "Type": {
            "type": "string",
            "nullable": true
          },
          "UpdateCycle": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "CalculationPeriod": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Format": {
        "type": "object",
        "properties": {
          "Type": {
            "type": "string",
            "nullable": true
          },
          "Restriction": {
            "$ref": "#/components/schemas/Restriction"
          }
        },
        "additionalProperties": false
      },
      "Header": {
        "type": "object",
        "properties": {
          "ShipID": {
            "type": "string",
            "nullable": true
          },
          "DataChannelListID": {
            "$ref": "#/components/schemas/ConfigurationReference"
          },
          "VersionInformation": {
            "$ref": "#/components/schemas/VersionInformation"
          },
          "Author": {
            "type": "string",
            "nullable": true
          },
          "DateCreated": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": { }
      },
      "HealthCheckResult": {
        "type": "object",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/HealthStatus"
          },
          "componentType": {
            "type": "string",
            "nullable": true
          },
          "time": {
            "type": "string",
            "format": "date-time"
          },
          "componentId": {
            "type": "string",
            "nullable": true
          },
          "observedValue": {
            "enum": [
              null
            ],
            "nullable": true
          },
          "observedUnit": {
            "type": "string",
            "nullable": true
          },
          "output": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HealthReport": {
        "type": "object",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/HealthStatus"
          },
          "serviceId": {
            "type": "string",
            "nullable": true
          },
          "version": {
            "type": "string",
            "nullable": true
          },
          "releaseId": {
            "type": "string",
            "nullable": true
          },
          "output": {
            "type": "string",
            "nullable": true
          },
          "checks": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/HealthCheckResult"
              }
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HealthStatus": {
        "enum": [
          "Pass",
          "Warn",
          "Fail"
        ],
        "type": "string"
      },
      "HttpValidationProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "nullable": true
          }
        },
        "additionalProperties": { }
      },
      "IngestAccepted": {
        "type": "object",
        "properties": {
          "packageId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "NameObject": {
        "type": "object",
        "properties": {
          "NamingRule": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": { }
      },
      "Package": {
        "type": "object",
        "properties": {
          "Header": {
            "$ref": "#/components/schemas/Header"
          },
          "DataChannelList": {
            "$ref": "#/components/schemas/DataChannelList"
          }
        },
        "additionalProperties": false
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": { }
      },
      "Property": {
        "type": "object",
        "properties": {
          "DataChannelType": {
            "$ref": "#/components/schemas/DataChannelType"
          },
          "Format": {
            "$ref": "#/components/schemas/Format"
          },
          "Range": {
            "$ref": "#/components/schemas/Range"
          },
          "Unit": {
            "$ref": "#/components/schemas/Unit"
          },
          "QualityCoding": {
            "type": "string",
            "nullable": true
          },
          "AlertPriority": {
            "type": "string",
            "nullable": true
          },
          "Name": {
            "type": "string",
            "nullable": true
          },
          "Remarks": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": { }
      },
      "Range": {
        "type": "object",
        "properties": {
          "High": {
            "type": "number",
            "format": "double"
          },
          "Low": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "Restriction": {
        "type": "object",
        "properties": {
          "Enumeration": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "FractionDigits": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "Length": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "MaxExclusive": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "MaxInclusive": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "MaxLength": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "MinExclusive": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "MinInclusive": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "MinLength": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "Pattern": {
            "type": "string",
            "nullable": true
          },
          "TotalDigits": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "WhiteSpace": {
            "$ref": "#/components/schemas/RestrictionWhiteSpace"
          }
        },
        "additionalProperties": false
      },
      "RestrictionWhiteSpace": {
        "enum": [
          "Preserve",
          "Replace",
          "Collapse"
        ],
        "type": "string"
      },
      "Unit": {
        "type": "object",
        "properties": {
          "UnitSymbol": {
            "type": "string",
            "nullable": true
          },
          "QuantityName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": { }
      },
      "VersionInformation": {
        "type": "object",
        "properties": {
          "NamingRule": {
            "type": "string",
            "nullable": true
          },
          "NamingSchemeVersion": {
            "type": "string",
            "nullable": true
          },
          "ReferenceURL": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "description": "Enter the ApiKey in the format 'ApiKey {your_api_key}'",
        "name": "Authorization",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "ApiKey": [ ]
    }
  ],
  "tags": [
    {
      "name": "Attachment API"
    },
    {
      "name": "Experimental API"
    },
    {
      "name": "ISO19848 API"
    },
    {
      "name": "Vista.Gateway.Api"
    }
  ]
}