{"openapi":"3.0.0","info":{"title":"5G DOS FIRE","description":"Documentation of the API used to connect all clients of the project","version":"0.0.1","contact":{"email":"chojetzki@tema.de"}},"servers":[{"url":"localhost:3000/api","description":"Local development env"},{"url":"https://app.5gdosfire.de/api","description":"Production server"}],"tags":[{"name":"Auth","description":"Authentication"},{"name":"Status","description":"Status messages"},{"name":"Resources","description":"Einsatzmittel"},{"name":"Missions","description":"All Operations carried out"},{"name":"POIs","description":"Points of interest"}],"paths":{"/oauth2/token":{"post":{"tags":["Auth"],"summary":"OAuth 2.0 Token Endpoint","description":"","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/oAuthTokenClientCredentialsRequest"}}}},"responses":{"200":{"description":"Authentication successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/oAuthTokenResponse"}}}}}}},"/status/types":{"get":{"tags":["Status"],"summary":"Return a List of all status value types","description":"","responses":{"200":{"description":"List of all status value types","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StatusValueType"}}}}}}}},"/resources/types":{"get":{"tags":["Resources"],"summary":"Return a List of all resource types","description":"","responses":{"200":{"description":"List of all resources","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ResourceType"}}}}}},"security":[{"oAuthServer":["resources:read"]}]}},"/resources":{"get":{"tags":["Resources"],"summary":"Return a list of all resources","description":"","responses":{"200":{"description":"List of all resources","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Resource"}}}}}},"security":[{"oAuthServer":["resources:read"]}]},"post":{"tags":["Resources"],"summary":"Create a new resource","description":"","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceBase"}}}},"responses":{"200":{"description":"Newly created resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resource"}}}}},"security":[{"oAuthServer":["resources:write"]}]}},"/resources/{resource_id}":{"get":{"tags":["Resources"],"summary":"Get resource","description":"","parameters":[{"in":"path","name":"resource_id","schema":{"type":"string","example":"uav-0001"},"required":true,"description":"Id of the resource"}],"responses":{"200":{"description":"Resource object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resource"}}}}},"security":[{"oAuthServer":["resources:read"]}]},"put":{"tags":["Resources"],"summary":"Update resource","description":"","parameters":[{"in":"path","name":"resource_id","schema":{"type":"string","example":"uav-0001"},"required":true,"description":"Id of the resource to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceBase"}}}},"responses":{"200":{"description":"Updated resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resource"}}}}},"security":[{"oAuthServer":["resources:write"]}]},"delete":{"tags":["Resources"],"summary":"Delete resource","description":"","parameters":[{"in":"path","name":"resource_id","schema":{"type":"string","example":"uav-0001"},"required":true,"description":"Id of the resource to delete"}],"responses":{"200":{"description":"Resource successfully deleted"}},"security":[{"oAuthServer":["resources:write"]}]}},"/resources/{resource_id}/status":{"get":{"tags":["Resources"],"summary":"Get all status values of the resource","description":"","parameters":[{"in":"path","name":"resource_id","schema":{"type":"string","example":"uav-0001"},"required":true,"description":"Id of the resource"}],"responses":{"200":{"description":"Resource object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceStatus"}}}}},"security":[{"oAuthServer":["resources:read"]}]},"post":{"tags":["Resources"],"summary":"Post status for resource","description":"","parameters":[{"in":"path","name":"resource_id","schema":{"type":"string","example":"uav-0001"},"required":true,"description":"Id of the resource to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceStatusUpdate"}}}},"responses":{"200":{"description":"Updated resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceStatusUpdateResponse"}}}}},"security":[{"oAuthServer":["resources:write"]}]}},"/resources/{resource_id}/stream":{"get":{"tags":["Resources"],"summary":"Get all streams a resource has available","description":"","parameters":[{"in":"path","name":"resource_id","schema":{"type":"string","example":"uav-0001"},"required":true,"description":"Id of the resource"}],"responses":{"200":{"description":"All streams","content":{"application/json":{"schema":{"title":"Array of streams","type":"array","items":{"$ref":"#/components/schemas/Stream"}}}}}},"security":[{"oAuthServer":["resources:read"]}]},"post":{"tags":["Resources"],"summary":"Get new stream token","description":"","parameters":[{"in":"path","name":"resource_id","schema":{"type":"string","example":"uav-0001"},"required":true,"description":"Id of the resource to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StreamBase"}}}},"responses":{"200":{"description":"Updated resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StreamResponse"}}}}},"security":[{"oAuthServer":["resources:write"]}]}},"/resources/{resource_id}/stream/{stream_id}":{"delete":{"tags":["Resources"],"summary":"End stream","description":"","parameters":[{"in":"path","name":"resource_id","schema":{"type":"string","example":"uav-0001"},"required":true,"description":"Id of the resource"},{"in":"path","name":"stream_id","schema":{"type":"string","example":"stream-0001"},"required":true,"description":"Id of the stream"}],"responses":{"200":{"description":"Stream successfully ended"}},"security":[{"oAuthServer":["resources:write"]}]}},"/resources/{resource_id}/missions":{"get":{"tags":["Resources"],"summary":"Get all missions of a resource","description":"","parameters":[{"in":"path","name":"resource_id","schema":{"type":"string","example":"uav-0001"},"required":true,"description":"Id of the resource"}],"responses":{"200":{"description":"All streams","content":{"application/json":{"schema":{"title":"Array of missions","type":"array","items":{"$ref":"#/components/schemas/Mission"}}}}}},"security":[{"oAuthServer":["resources:read"]}]}},"/missions/types":{"get":{"tags":["Missions"],"summary":"List of all objectives","description":"","responses":{"200":{"description":"List of all objectives","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MissionType"}}}}}},"security":[{"oAuthServer":["missions:read"]}]}},"/missions":{"get":{"tags":["Missions"],"summary":"Return a list of all missions","description":"","responses":{"200":{"description":"List of all missions","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Mission"}}}}}},"security":[{"oAuthServer":["missions:read"]}]},"post":{"tags":["Missions"],"summary":"Create a new mission","description":"","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissionBase"}}}},"responses":{"200":{"description":"Newly created mission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mission"}}}}},"security":[{"oAuthServer":["missions:write"]}]}},"/missions/{mission_id}":{"get":{"tags":["Missions"],"summary":"Get mission","description":"","parameters":[{"in":"path","name":"mission_id","schema":{"type":"string","example":"mission-0001"},"required":true,"description":"Id of the mission"}],"responses":{"200":{"description":"Mission object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mission"}}}}},"security":[{"oAuthServer":["missions:read"]}]},"put":{"tags":["Missions"],"summary":"Update mission","description":"","parameters":[{"in":"path","name":"mission_id","schema":{"type":"string","example":"mission-0001"},"required":true,"description":"Id of the mission to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissionBase"}}}},"responses":{"200":{"description":"Updated mission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mission"}}}}},"security":[{"oAuthServer":["missions:write"]}]},"delete":{"tags":["Missions"],"summary":"Delete mission","description":"","parameters":[{"in":"path","name":"mission_id","schema":{"type":"string","example":"mission-0001"},"required":true,"description":"Id of the mission to delete"}],"responses":{"200":{"description":"Mission successfully deleted"}},"security":[{"oAuthServer":["missions:write"]}]}},"/missions/{mission_id}/resources":{"post":{"tags":["Missions"],"summary":"Add resource to mission","description":"","parameters":[{"in":"path","name":"mission_id","schema":{"type":"string","example":"mission-0001"},"required":true,"description":"Id of the mission"}],"responses":{"200":{"description":"Stream successfully ended"}},"security":[{"oAuthServer":["missions:write"]}]}},"/missions/{mission_id}/resources/{resource_id}":{"delete":{"tags":["Missions"],"summary":"Remove resource from mission","description":"","parameters":[{"in":"path","name":"mission_id","schema":{"type":"string","example":"mission-0001"},"required":true,"description":"Id of the resource"},{"in":"path","name":"resource_id","schema":{"type":"string","example":"uav-0001"},"required":true,"description":"Id of the resource"}],"responses":{"200":{"description":"Resource successfully removed from mission"}},"security":[{"oAuthServer":["missions:write"]}]}},"/missions/{mission_id}/status":{"get":{"tags":["Missions"],"summary":"Get all status values of the mission","description":"","parameters":[{"in":"path","name":"mission_id","schema":{"type":"string","example":"mission-0001"},"required":true,"description":"Id of the mission"}],"responses":{"200":{"description":"Mission status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissionStatus"}}}}},"security":[{"oAuthServer":["missions:read"]}]},"post":{"tags":["Missions"],"summary":"Post status for mission","description":"","parameters":[{"in":"path","name":"mission_id","schema":{"type":"string","example":"mission-0001"},"required":true,"description":"Id of the mission to update"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissionStatusUpdate"}}}},"responses":{"200":{"description":"Updated mission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissionStatusUpdateResponse"}}}}},"security":[{"oAuthServer":["missions:write"]}]}}},"components":{"securitySchemes":{"oAuthServer":{"type":"oauth2","description":"The projects main auth server","flows":{"authorizationCode":{"authorizationUrl":"https://auth.5gdosfire.de/api/oauth2/authorize","tokenUrl":"https://auth.5gdosfire.de/api/oauth2/token","scopes":{"resources:read":"Read information about resources","resources:write":"Modify/create/delete resources","missions:read":"Read information about missions","missions:write":"Modify/create/delete missions","pois:read":"Read information about pois","pois:write":"Modify/create/delete pois"}},"clientCredentials":{"tokenUrl":"https://auth.5gdosfire.de/api/oauth2/token","scopes":{"resources:read":"Read information about resources","resources:write":"Modify/create/delete resources","missions:read":"Read information about missions","missions:write":"Modify/create/delete missions","pois:read":"Read information about pois","pois:write":"Modify/create/delete pois"}}}}},"schemas":{"$ref":"./schemas/_index.yaml","Schema":{"type":"object","properties":{"id":{"type":"integer","format":"int64"}},"description":"oAuthTokenClientCredentialsRequest:\n  title: \"OAuth 2.0 Token Request\"\n  type: object\n  properties:\n    audience:\n      type: string\n      description: API you want to authenticate for\n      example: <API_IDENTIFIER>\n    grant_type:\n      type: string\n      description: Specify you want to use the client credentials flow\n      example: client_credentials\n    client_id:\n      type: string\n      description: The (public) client-id you have been provided with\n      example: <YOUR_CLIENT_ID>\n    client_secret:\n      type: string\n      description: The secret you have been provided with\n      example: <YOUR_CLIENT_SECRET>\noAuthTokenResponse:\n  title: \"OAuth 2.0 Token Response\"\n  type: object\n  properties:\n    access_token:\n      type: string\n      description: A JWT Token to authenticate with\n      example: <ACCESS_TOKEN>\n    token_type:\n      type: string\n      description: Specify using the Bearer scheme\n      example: Bearer\n    expires_in:\n      type: integer\n      description: The amount of seconds the access_token is valid for\n      example: 86400\noAuthAccessToken:\n  title: \"JWT Access Token\"\n  type: object\n  properties:\n    sub:\n      type: string\n      description: Id of the resource\n      example: <resource_id>\n    exp:\n      type: integer\n      description: Expires at, Timestamp in seconds\n      example: 1516250022\n    iat:\n      type: integer\n      description: Issued at, Timestamp in seconds\n      example: 1516239022\nTerminal:\n  title: \"Terminal\"\n  type: object\n  properties:\n    email:\n      type: string\n      description: Email of the contact\n    password:\n      type: string\n      description: Password of the contact in plaintext\nResourceType:\n  title: \"Resource type\"\n  type: object\n  properties:\n    id:\n      type: string\n      description: Referenced as resource_type to classify the resources\n      example: uav\n    title:\n      type: string\n      description: The title displayed in the user interface\n      example: Drone\n    supported_status_value_types:\n      type: array\n      items:\n        $ref: \"#/StatusValueType\"\n    supported_streams:\n      type: integer\n      description: Amount of streams a resource can provide at maximum\n      example: 2\nResourceBase:\n  title: Base resource object\n  type: object\n  properties:\n    resource_type:\n      type: string\n      enum: [uav, ugv, elw, person]\n    parents:\n      type: array\n      items:\n        type: string\n        description: Ids of the parents\n        example: [elw-0001]\n    children:\n      type: array\n      items:\n        type: string\n        description: Ids of the children\n        example: [uav-0001, ugv-0001, person-0001]\nResource:\n  title: \"Resource\"\n  allOf:\n    - type: object\n      properties:\n        id:\n          type: string\n          description: Id of the resources\n          example: uav-00001\n    - $ref: \"#/ResourceBase\"\nResourceStatus:\n  title: \"Resource Status\"\n  type: object\n  properties:\n    last_update:\n      type: string\n      format: date-time\n      example: 2022-01-25T09:00:00+0100\n      description: Time the last update was received by the server\n    next_update_before:\n      type: string\n      format: date-time\n      example: 2022-01-25T09:00:00+0100\n      description: The timestamp before a new status message will be submitted. If there is no status update before this timestamp, the resource will be marked unavailable. If no value is submitted, this is ignored\n    values:\n      type: array\n      items:\n        allOf:\n          - type: object\n            properties:\n              id:\n                type: string\n                description: Id of the status\n                example: status-0001\n              timestamp:\n                type: string\n                format: date-time\n                example: 2022-01-25T09:00:00+0100\n                description: When the values where determined\n              timestamp_received:\n                type: string\n                format: date-time\n                example: 2022-01-25T09:00:00+0100\n                description: Time the update was received on the server\n          - $ref: \"#/StatusValue\"\nResourceStatusUpdate:\n  title: \"Resource Status Update\"\n  type: object\n  properties:\n    timestamp:\n      type: string\n      format: date-time\n      example: 2022-01-25T09:00:00+0100\n      description: When the values where determined\n    next_update_before:\n      type: string\n      format: date-time\n      example: 2022-01-25T09:00:00+0100\n      description: The timestamp before a new status message will be submitted. If there is no status update before this timestamp, the resource will be marked unavailable. If no value is submitted, this is ignored\n    values:\n      type: array\n      items:\n        $ref: \"#/StatusValue\"\nResourceStatusUpdateResponse:\n  title: \"Resource Status Update Response\"\n  allOf:\n    - type: object\n      properties:\n        id:\n          type: string\n          description: Id of the status\n          example: status-0001\n        resource_id:\n          type: string\n          description: Id of the resources\n          example: uav-00001\n        timestamp_received:\n          type: string\n          format: date-time\n          example: 2022-01-25T09:00:00+0100\n          description: Time the update was received on the server\n    - $ref: \"#/ResourceStatusUpdate\"\nStatusValue:\n  title: \"Status Value\"\n  type: object\n  properties:\n    id:\n      type: string\n      description: Id of the status value\n      example: status-value-0001\n    status_type:\n      type: string\n      enum: [gps-position, height, availability]\n    value:\n      type: string\n      description: The value submitted\n    valid_until:\n      type: string\n      format: date-time\n      example: 2022-01-25T09:00:00+0100\n      description: Value is valid until, can be empty\nStatusValueType:\n  title: \"Status Value Type\"\n  type: object\n  properties:\n    id:\n      type: string\n      description: status_type referenced in all statuses\n      example: gps-position\n    title:\n      type: string\n      description: The title displayed in the user interface\n      example: Position\n    unit:\n      type: string\n      description: The unit the value is in\n      example: EPSG:4326\n    type:\n      type: string\n      description: \n      enum: [gps, integer, float, string]\n    min:\n      type: number\n      format: float\n      description: Absolute minimum, empty if not relevant\n      example: 0.0\n    max:\n      type: number\n      format: float\n      description: Absolute maximum, empty if not relevant\n      example: 180.0\nStreamBase:\n  title: \"Stream Base\"\n  type: object\n  properties:\n    title:\n      type: string\n      description: The title displayed in the user interface\n      example: Main Camera\n    type:\n      type: string\n      description: The type of image presented by the stream\n      enum: [rgb, thermal]\n    codec:\n      type: string\n      description: The codec used for the video\n      enum: [h264, h265]\n    width:\n      type: number\n      description: The width of the stream in pixels\n      minimum: 1\n      maximum: 3840\n    height:\n      type: number\n      description: The height of the stream in pixels\n      minimum: 1\n      maximum: 2160\nStreamResponse:\n  title: \"Stream Response\"\n  type: object\n  properties:\n    id: \n      type: string\n      description: The id of the stream\n      example: stream-0001\n    key:\n      type: string\n      description: The streamkey to use\n      example: <STREAM_KEY>\n    url:\n      type: string\n      description: The streamkey to use\n      example: rtmp://streams.5g-dos-fire.de/api/streams/live_one\nStream:\n  title: \"Stream\"\n  allOf:\n    - type: object\n      properties:\n        id:\n          type: string\n          description: Unique id of the stream\n          example: stream-0001\n        resource_id:\n          type: string\n          description: Id of the resources\n          example: uav-00001\n        url:\n          type: string\n          description: HLS endpoint to view the stream\n          example: https://streams.5g-dos-fire.de/api/streams/hls_one/key.m3u8\n        start:\n          type: string\n          format: date-time\n          example: 2022-01-25T09:00:00+0100\n          description: Start of the stream\n        end:\n          type: string\n          format: date-time\n          example: 2022-01-25T09:00:00+0100\n          description: End of the stream, empty if running\n    - $ref: \"#/StreamBase\"\nMissionType:\n  title: \"Objective type\"\n  type: object\n  properties:\n    id:\n      type: string\n      description: Referenced as mission_type to classify the objectives\n      example: go-to-position\n    title:\n      type: string\n      description: The title displayed in the user interface\n      example: Go to position\n    required_resources:\n      type: array\n      description: One of the following resource groups is needed for this objective\n      items:\n        type: array\n        description: group of resources\n        example: [[uav], [ugv, ugv-operator]]\n        items:\n          type: string\n          description: id of the resource_type\n          example: [uav, operator]\n    required_pois:\n      type: array\n      items:\n        $ref: [injured-person]\n    supported_status_value_types:\n      type: array\n      items:\n        $ref: \"#/StatusValueType\"\nMissionBase:\n  title: Base mission object\n  type: object\n  properties:\n    mission_type:\n      type: string\n      enum: [go-to-position]\n    parents:\n      type: array\n      items:\n        type: string\n        description: Ids of the parents\n        example: [mission-0004]\n    children:\n      type: array\n      items:\n        type: string\n        description: Ids of the children\n        example: [mission-0001, mission-0002, mission-0005]\n    pois:\n      type: array\n      items:\n        type: string\n        description: Ids of the pois\n        example: [poi-0001, poi-0002, poi-0005]\nMission:\n  title: \"Mission\"\n  allOf:\n    - type: object\n      properties:\n        id:\n          type: string\n          description: Id of the mission\n          example: mission-00001\n    - $ref: \"#/MissionBase\"\nMissionStatus:\n  title: \"Mission Status\"\n  type: object\n  properties:\n    last_update:\n      type: string\n      format: date-time\n      example: 2022-01-25T09:00:00+0100\n      description: Time the last update was received by the server\n    next_update_before:\n      type: string\n      format: date-time\n      example: 2022-01-25T09:00:00+0100\n      description: The timestamp before a new status message will be submitted. If there is no status update before this timestamp, the mission will be marked as failed. If no value is submitted, this is ignored\n    values:\n      type: array\n      items:\n        allOf:\n          - type: object\n            properties:\n              id:\n                type: string\n                description: Id of the status\n                example: status-0001\n              timestamp:\n                type: string\n                format: date-time\n                example: 2022-01-25T09:00:00+0100\n                description: When the values where determined\n              timestamp_received:\n                type: string\n                format: date-time\n                example: 2022-01-25T09:00:00+0100\n                description: Time the update was received on the server\n          - $ref: \"#/StatusValue\"\nMissionStatusUpdate:\n  title: \"Mission Status Update\"\n  type: object\n  properties:\n    timestamp:\n      type: string\n      format: date-time\n      example: 2022-01-25T09:00:00+0100\n      description: When the values where determined\n    next_update_before:\n      type: string\n      format: date-time\n      example: 2022-01-25T09:00:00+0100\n      description: The timestamp before a new status message will be submitted. If there is no status update before this timestamp, the mission will be marked as failed. If no value is submitted, this is ignored\n    values:\n      type: array\n      items:\n        $ref: \"#/StatusValue\"\nMissionStatusUpdateResponse:\n  title: \"Mission Status Update Response\"\n  allOf:\n    - type: object\n      properties:\n        id:\n          type: string\n          description: Id of the status\n          example: status-0001\n        resource_id:\n          type: string\n          description: Id of the mission\n          example: uav-00001\n        timestamp_received:\n          type: string\n          format: date-time\n          example: 2022-01-25T09:00:00+0100\n          description: Time the update was received on the server\n    - $ref: \"#/MissionStatusUpdate\"\nPoiType:\n  title: \"Poi type\"\n  type: object\n  properties:\n    id:\n      type: string\n      description: Referenced as poi_type to classify points of interest\n      example: injured-person\n    title:\n      type: string\n      description: The title displayed in the user interface\n      example: Verletzte Person\n    supported_status_value_types:\n      type: array\n      items:\n        $ref: \"#/StatusValueType\"\nPoiBase:\n  title: Base poi object\n  type: object\n  properties:\n    poi_type:\n      type: string\n      enum: [injured-person, nice-view]\n    initial_position:\n      type: string\n      description: initial position of the poi\nPoi:\n  title: \"Poi\"\n  allOf:\n    - type: object\n      properties:\n        id:\n          type: string\n          description: Id of the poi\n          example: poi-00001\n    - $ref: \"#/PoiBase\""}}}}