openapi: 3.0.0
paths:
  /api/management/audit-logs:
    get:
      description: Fetches paginated audit log entries with optional filters.
      operationId: AuditLogController_list
      parameters:
        - name: order
          required: false
          in: query
          schema:
            default: DESC
            type: string
            enum:
              - ASC
              - DESC
        - name: order_by
          required: false
          in: query
          schema:
            default: modifiedDate
            type: string
        - name: page
          required: false
          in: query
          schema:
            minimum: 1
            default: 1
            type: number
        - name: per_page
          required: false
          in: query
          schema:
            minimum: 1
            maximum: 100
            default: 100
            type: number
        - name: callerSub
          required: false
          in: query
          schema:
            type: string
        - name: callerType
          required: false
          in: query
          schema:
            type: string
        - name: resultAllowed
          required: false
          in: query
          schema:
            type: boolean
        - name: correlationId
          required: false
          in: query
          schema:
            type: string
        - name: ipAddress
          required: false
          in: query
          schema:
            type: string
        - name: requestPath
          required: false
          in: query
          schema:
            type: string
        - name: from
          required: false
          in: query
          schema:
            type: string
        - name: to
          required: false
          in: query
          schema:
            type: string
        - name: resourceType
          required: false
          in: query
          schema:
            type: array
            items:
              type: string
        - name: action
          required: false
          in: query
          schema:
            type: array
            items:
              type: string
        - name: severity
          required: false
          in: query
          schema:
            type: array
            items:
              type: string
              enum:
                - debug
                - info
                - warning
                - error
                - critical
      responses:
        "200":
          description: Successful response
          headers:
            x-page:
              description: Index of the current page (starting at 1)
              schema:
                type: integer
            x-prev-page:
              description: Index of the previous page
              schema:
                type: integer
              required: false
            x-next-page:
              description: Index of the next page
              schema:
                type: integer
              required: false
            x-per-page:
              description: Number of items per page
              schema:
                type: integer
            x-total-pages:
              description: Total number of pages
              schema:
                type: integer
            x-total:
              description: Total number of items
              schema:
                type: integer
            link:
              description: Web Linking to other pages of this resource
              schema:
                type: string
      security:
        - oauth2:
            - read:adp.audit_log
      summary: List audit log entries
      tags: &a1
        - Audit Logs
  /api/management/audit-logs/{id}:
    get:
      description: Fetches a single audit log entry by its ID.
      operationId: AuditLogController_getById
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        "200":
          description: ""
      security:
        - oauth2:
            - read:adp.audit_log
      summary: Get audit log entry by ID
      tags: *a1
  /api/settings:
    get:
      description: Retrieves the settings of the control plane.
      operationId: ConfigController_getSettings
      parameters: []
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RuntimeConfigDto"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security: &a2
        - oauth2:
            - update:adp.config
      summary: Retrieve settings
      tags: &a3
        - Settings
  /api/settings/mode:
    get:
      description: Retrieves the analytics data plane runtime mode
        (standalone/client/server).
      operationId: ConfigController_getMode
      parameters: []
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  mode:
                    type: string
                    example: standalone
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security: *a2
      summary: Retrieve runtime mode
      tags: *a3
  /api/settings/update:
    post:
      description: Updates runtime settings for the control plane.
      operationId: ConfigController_updateSettings
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RuntimeConfigDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RuntimeConfigDto"
        "400":
          description: Malformed request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security: *a2
      summary: Update settings
      tags: *a3
  /api/settings/upload:
    post:
      description: Uploads logo for the control plane, receive a base64 encoded url.
      operationId: ConfigController_uploadFile
      parameters: []
      responses:
        "200":
          description: ""
      security: *a2
      summary: Upload logo
      tags: *a3
  /api/catalog:
    get:
      description: Get catalog, currently not implemented.
      operationId: DataPlaneController_getCatalog
      parameters: []
      responses:
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
        "501":
          description: ""
      security: &a4
        - oauth2:
            - read:adp.dataplane
      summary: Get catalog
      tags: &a5
        - Data Plane
  /health:
    get:
      description: Retrieves the current health of the control plane. If the control
        plane is running it always returns an empty 200 OK
      operationId: DataPlaneController_healthCheck
      parameters: []
      responses:
        "200":
          description: ""
        "502":
          description: ""
      security: *a4
      summary: Health check
      tags: *a5
  /api/management/state:
    get:
      description: Get the registration state of the data plane.
      operationId: DataPlaneManagementController_getState
      parameters: []
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DataPlaneStateDto"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - read:adp.dataplane
      summary: Get Data Plane state
      tags: &a6
        - Data Plane Management
  /api/management/catalog:
    get:
      description: Get the current catalog from the Control Plane.
      operationId: DataPlaneManagementController_getCatalog
      parameters: []
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CatalogSchema"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - read:adp.dataplane
      summary: Get catalog
      tags: *a6
  /api/management/registry/addresses:
    get:
      description: Get all participant addresses from the Control Plane registry.
      operationId: DataPlaneManagementController_getRegistryAddresses
      parameters: []
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - read:adp.dataplane
      summary: Get registry addresses
      tags: *a6
  /api/management/registry/catalog/{participantId}:
    get:
      description: Fetches a specific catalog by its participant ID.
      operationId: DataPlaneManagementController_getCatalogByParticipantId
      parameters:
        - name: participantId
          required: true
          in: path
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CatalogSchema"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
        "404":
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - read:adp.dataplane
      summary: Get catalog by participant ID
      tags: *a6
  /api/management/registry/refresh:
    post:
      description: Force refresh the registry by triggering a re-crawl of all
        participant addresses and catalogs on the Control Plane.
      operationId: DataPlaneManagementController_refreshRegistry
      parameters: []
      responses:
        "200":
          description: Registry refresh initiated successfully
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - read:adp.dataplane
      summary: Refresh registry
      tags: *a6
  /api/management/participant-id:
    get:
      description: Get the ID of the current participant from the Control Plane catalog.
      operationId: DataPlaneManagementController_getParticipantId
      parameters: []
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: string
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - read:adp.dataplane
      summary: Get current participant ID
      tags: *a6
  /api/management/refresh:
    post:
      description: Use this endpoint to (re)register your data plane. Currently it
        will register with defaults from the config.
      operationId: DataPlaneManagementController_refreshRegistration
      parameters: []
      responses:
        "202":
          description: ""
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - update:adp.dataplane
      summary: (Re)register data plane
      tags: *a6
  /api/auth/user:
    get:
      description: Retrieves current user state, whether someone is logged in or not a
        200 result is provided. This is used in the frontend to determine
        whether certain aspects should be shown.
      operationId: AuthController_getUser
      parameters: []
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/AuthenticatedUser"
                  - $ref: "#/components/schemas/UnauthenticatedUser"
      summary: Retrieve current user status
      tags: &a7
        - Authentication
  /api/auth/login:
    get:
      description: Redirects user to the correct authorization server
      operationId: AuthController_login
      parameters: []
      responses:
        "302":
          description: ""
      summary: Login redirect
      tags: *a7
  /api/auth/logout:
    get:
      description: Removes session information and redirects user the root of the
        frontend (`auth.redirectURL`)
      operationId: AuthController_logout
      parameters: []
      responses:
        "302":
          description: ""
      summary: Logout redirect
      tags: *a7
  /api/auth/callback:
    get:
      description: Users are redirected from the authorization server to this endpoint
        which will redirect them to the frontend (`auth.redirectURL`)
      operationId: AuthController_callback
      parameters:
        - name: state
          required: false
          in: query
          description: The state parameter
          schema:
            example: randomState
            type: string
        - name: code
          required: false
          in: query
          description: The authorization code
          schema:
            example: code
            type: string
        - name: access_token
          required: false
          in: query
          description: The access token
          schema:
            type: string
        - name: token_type
          required: false
          in: query
          description: The token type
          schema:
            example: Bearer
            type: string
        - name: expires_in
          required: false
          in: query
          description: The token expiration in seconds
          schema:
            example: 3600
            type: string
        - name: id_token
          required: false
          in: query
          description: The ID token
          schema:
            type: string
        - name: code_verifier
          required: false
          in: query
          description: The code verifier
          schema:
            example: randomChallengeVerifier
            type: string
      responses:
        "302":
          description: ""
      summary: Login callback
      tags: *a7
  /api/management/k8s/jobs/algorithm-instance/{algorithmInstanceId}:
    get:
      operationId: OrchestrationManagementController_getJobsForAlgorithmInstance
      parameters:
        - name: algorithmInstanceId
          required: true
          in: path
          description: The algorithm instance ID
          schema:
            example: urn:uuid:12345678-1234-5678-1234-567812345678
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/JobDto"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - read:adp.orchestration
      summary: Get jobs for algorithm instance
      tags: &a8
        - Data Plane Management
  /api/management/k8s/jobs/{jobName}/pods:
    get:
      operationId: OrchestrationManagementController_getJobPods
      parameters:
        - name: jobName
          required: true
          in: path
          description: The job name
          schema:
            example: 12345678-1234-5678-1234-567812345678
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PodListDto"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - read:adp.orchestration
      summary: Get job pods
      tags: *a8
  /api/management/k8s/pods/{podName}/logs:
    get:
      operationId: OrchestrationManagementController_getJobLogs
      parameters:
        - name: podName
          required: true
          in: path
          description: The pod name
          schema:
            example: 12345678-1234-5678-1234-567812345678
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: string
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - read:adp.orchestration
      summary: Get job logs
      tags: *a8
  /api/management/k8s/pods/{podName}/streamLogs:
    get:
      operationId: OrchestrationManagementController_streamJobLogs
      parameters:
        - name: podName
          required: true
          in: path
          description: The pod name
          schema:
            example: 12345678-1234-5678-1234-567812345678
            type: string
        - name: tail
          required: true
          in: query
          schema:
            type: number
        - name: tail
          required: false
          in: path
          description: Number of lines to include from the end of the logs
          schema:
            example: 100
            type: number
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - read:adp.orchestration
      summary: Stream job logs
      tags: *a8
  /api/management/k8s/spawn-job:
    post:
      operationId: OrchestrationManagementController_spawnJob
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                imageName:
                  type: string
                algorithmInstanceId:
                  type: string
                command:
                  type: array
                  items:
                    type: string
                fileId:
                  type: string
              example:
                imageName: busybox
                algorithmInstanceId: urn:uuid:12345678-1234-5678-1234-567812345678
                command:
                  - echo
                  - Hello, World!
      responses:
        "200":
          description: ""
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - execute:adp.orchestration
      summary: Spawn a job
      tags: *a8
  /api/data/{algorithmInstanceId}/{datasetId}:
    get:
      operationId: DataSourceController_read
      parameters:
        - name: algorithmInstanceId
          required: true
          in: path
          schema:
            type: string
        - name: datasetId
          required: true
          in: path
          schema:
            type: string
      responses:
        "200":
          description: ""
      summary: Stream an HTTP dataset to its authorised job
      tags:
        - Analytics Data Sources
  /api/management/algorithm-instances:
    get:
      description: Retrieve all algorithm instances
      operationId: AlgorithmInstancesManagementController_findAll
      parameters: []
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/AlgorithmInstanceDto"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - read:adp.algorithm
      summary: Get all algorithm instances
      tags: &a9
        - Algorithm Instances
  /api/management/algorithm-instances/{id}:
    get:
      description: Retrieve an algorithm instance by its ID
      operationId: AlgorithmInstancesManagementController_findOne
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AlgorithmInstanceDto"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - read:adp.algorithm
      summary: Get an algorithm instance by ID
      tags: *a9
    delete:
      description: Delete an algorithm instance by its ID. Use hard=true for permanent
        deletion.
      operationId: AlgorithmInstancesManagementController_remove
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: hard
          required: false
          in: query
          description: When true, permanently deletes the algorithm instance instead of
            soft-deleting it.
          schema:
            type: boolean
      responses:
        "200":
          description: The algorithm instance has been successfully deleted
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - delete:adp.algorithm
      summary: Delete an algorithm instance by ID
      tags: *a9
  /api/management/algorithm-instances/prune:
    post:
      description: "Hard-delete algorithm instances that were soft-deleted. Use
        olderThanDays to only prune instances deleted more than N days ago
        (default: 0 = all)."
      operationId: AlgorithmInstancesManagementController_prune
      parameters:
        - name: olderThanDays
          required: false
          in: query
          description: "Only prune instances soft-deleted more than this many days ago.
            Default: 0 (prune all)."
          schema:
            type: number
      responses:
        "200":
          description: The number of pruned algorithm instances
          content:
            application/json:
              schema:
                type: object
                properties:
                  pruned:
                    type: number
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - delete:adp.algorithm
      summary: Prune soft-deleted algorithm instances
      tags: *a9
  /api/events/{algorithmInstanceId}/internal-event:
    post:
      operationId: EventsController_createInternalEvent
      parameters:
        - name: algorithmInstanceId
          required: true
          in: path
          schema:
            type: string
        - name: Authorization
          required: true
          in: header
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateInternalEventDto"
      responses:
        "201":
          description: ""
      tags: &a10
        - Events
  /api/events/{algorithmInstanceId}/algorithm-event:
    post:
      description: Creates an algorithm event for the specified algorithm instance.
      operationId: EventsController_createAlgorithmEvent
      parameters:
        - name: algorithmInstanceId
          required: true
          in: path
          schema:
            type: string
        - name: Authorization
          required: true
          in: header
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateAlgorithmEventDto"
      responses:
        "200":
          description: The algorithm event has been successfully created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateAlgorithmEventDto"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      summary: Create an algorithm event
      tags: *a10
  /api/events/{algorithmInstanceId}/upload/{eventId}:
    post:
      description: Uploads binary algorithm event data.
      operationId: EventsController_uploadEventData
      parameters:
        - name: algorithmInstanceId
          required: true
          in: path
          schema:
            type: string
        - name: eventId
          required: true
          in: path
          schema:
            type: string
        - name: Authorization
          required: true
          in: header
          schema:
            type: string
      responses:
        "200":
          description: The binary algorithm event data has been successfully uploaded.
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      summary: Upload algorithm event data
      tags: *a10
  /api/events/{algorithmInstanceId}/data/{eventId}:
    get:
      operationId: EventsController_getEventData
      parameters:
        - name: algorithmInstanceId
          required: true
          in: path
          schema:
            type: string
        - name: eventId
          required: true
          in: path
          schema:
            type: string
        - name: Authorization
          required: true
          in: header
          schema:
            type: string
      responses:
        "200":
          description: ""
      tags: *a10
  /api/events/{algorithmInstanceId}/poll:
    get:
      description: Long polling endpoint that returns the next available algorithm
        event for this specific algorithm instance. Supports 'since' query
        parameter with ISO date format to filter events after that timestamp.
        Only returns external events (excludes own events).
      operationId: EventsController_pollForAlgorithmEvent
      parameters:
        - name: algorithmInstanceId
          required: true
          in: path
          schema:
            type: string
        - name: since
          required: true
          in: query
          schema:
            type: string
        - name: Authorization
          required: true
          in: header
          schema:
            type: string
      responses:
        "200":
          description: The next algorithm event has been found
        "204":
          description: No event within longpolling window
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      summary: Poll for the next available algorithm event for this algorithm instance
      tags: *a10
  /api/events/{algorithmInstanceId}:
    get:
      description: Retrieves all algorithm and internal events for the specified
        algorithm instance.
      operationId: EventsController_getEventsForAlgorithmInstance
      parameters:
        - name: algorithmInstanceId
          required: true
          in: path
          schema:
            type: string
        - name: Authorization
          required: true
          in: header
          schema:
            type: string
      responses:
        "200":
          description: The events have been successfully retrieved.
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      summary: Get all events for an algorithm instance
      tags: *a10
  /api/management/algorithm-instances/{algorithmInstanceId}/events:
    get:
      description: Retrieves the algorithm and internal events for the specified
        algorithm instance. Pass sinceSequence and sinceTimestamp to read only
        what is new since an earlier call; sinceTimestamp is inclusive, so
        de-duplicate internal events on id. Requires management access role.
      operationId: EventsManagementController_getEventsForAlgorithmInstance
      parameters:
        - name: algorithmInstanceId
          required: true
          in: path
          schema:
            type: string
        - name: sinceSequence
          required: false
          in: query
          description: Return algorithm events after this sequence number
          schema:
            type: string
        - name: sinceTimestamp
          required: false
          in: query
          description: Return internal events at or after this ISO timestamp
          schema:
            type: string
      responses:
        "200":
          description: The events have been successfully retrieved.
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security: &a11
        - oauth2:
            - read:adp.orchestration
      summary: Get the events for an algorithm instance (management)
      tags: &a12
        - Algorithm Instances
  /api/management/algorithm-instances/{algorithmInstanceId}/events/{eventId}/data:
    get:
      description: Returns the raw binary data for the specified algorithm event.
        Requires management access role.
      operationId: EventsManagementController_getEventDataForManagement
      parameters:
        - name: algorithmInstanceId
          required: true
          in: path
          schema:
            type: string
        - name: eventId
          required: true
          in: path
          schema:
            type: string
      responses:
        "200":
          description: Binary event data returned
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
        "404":
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security: *a11
      summary: Download algorithm event data (management)
      tags: *a12
  /api/event-channels/{channelId}/events:
    post:
      operationId: EventChannelController_receiveEvent
      parameters:
        - name: channelId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DeliverAlgorithmEventDto"
      responses:
        "204":
          description: ""
      summary: Deliver event metadata over a provisioned channel
      tags: &a13
        - Analytics Event Channels
  /api/event-channels/{channelId}/events/{eventId}/data:
    post:
      operationId: EventChannelController_receivePayload
      parameters:
        - name: channelId
          required: true
          in: path
          schema:
            type: string
        - name: eventId
          required: true
          in: path
          schema:
            type: string
      responses:
        "204":
          description: ""
      summary: Stream an event payload over a provisioned channel
      tags: *a13
  /api/dataflows/prepare:
    post:
      description: Ask the data plane to prepare the resources for a transfer.
      operationId: DataflowController_prepare
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DataflowPrepareMessageDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DataflowResponseDto"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - create:dp.transfer
      summary: Prepare a dataflow
      tags: &a14
        - Dataflow Signaling
  /api/dataflows/start:
    post:
      description: Ask the data plane to begin a prepared dataflow. An orchestration
        dataflow returns the execution endpoint used to submit algorithm
        instances.
      operationId: DataflowController_start
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DataflowStartMessageDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DataflowResponseDto"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - execute:dp.transfer
      summary: Start a dataflow
      tags: *a14
  /api/dataflows/{id}/started:
    post:
      description: Consumer-side notification that a dataflow has begun.
      operationId: DataflowController_started
      parameters:
        - name: id
          required: true
          in: path
          description: Dataflow identifier
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DataflowStartedNotificationMessageDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DataflowResponseDto"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - execute:dp.transfer
      summary: Notify a dataflow has started
      tags: *a14
  /api/dataflows/{id}/suspend:
    post:
      operationId: DataflowController_suspend
      parameters:
        - name: id
          required: true
          in: path
          description: Dataflow identifier
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DataflowSuspendMessageDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DataflowResponseDto"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - execute:dp.transfer
      summary: Suspend a dataflow
      tags: *a14
  /api/dataflows/{id}/resume:
    post:
      operationId: DataflowController_resume
      parameters:
        - name: id
          required: true
          in: path
          description: Dataflow identifier
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DataflowResumeMessageDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DataflowResponseDto"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - execute:dp.transfer
      summary: Resume a dataflow
      tags: *a14
  /api/dataflows/{id}/terminate:
    post:
      description: Stops the algorithm instances submitted over this dataflow and
        drops the execution secret and dataset source reference it carried.
      operationId: DataflowController_terminate
      parameters:
        - name: id
          required: true
          in: path
          description: Dataflow identifier
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DataflowTerminateMessageDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DataflowResponseDto"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - execute:dp.transfer
      summary: Terminate a dataflow
      tags: *a14
  /api/dataflows/{id}/completed:
    post:
      operationId: DataflowController_completed
      parameters:
        - name: id
          required: true
          in: path
          description: Dataflow identifier
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DataflowResponseDto"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - execute:dp.transfer
      summary: Complete a dataflow
      tags: *a14
  /api/dataflows/{id}/status:
    get:
      operationId: DataflowController_status
      parameters:
        - name: id
          required: true
          in: path
          description: Dataflow identifier
          schema:
            type: string
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DataflowResponseDto"
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - read:dp.transfer
      summary: Get dataflow status
      tags: *a14
  /api/management/dataflows:
    get:
      operationId: DataflowManagementController_getDataflows
      parameters: []
      responses:
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
      security:
        - oauth2:
            - read:dp.transfer
      summary: List dataflows executed by this data plane
      tags:
        - Dataflow Management
  /api/flows/{dataflowId}/algorithm-instances:
    post:
      description: Creates a local algorithm instance for this dataflow. Every dataset
        it refers to must be bound by a started dataflow on this plane.
      operationId: ExecutionController_create
      parameters:
        - name: dataflowId
          required: true
          in: path
          description: Dataflow identifier from the execution endpoint
          schema: {}
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SubmitAlgorithmInstanceDto"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AlgorithmInstanceDto"
      summary: Submit an algorithm instance
      tags: &a15
        - Analytics Execution
  /api/flows/{dataflowId}/algorithm-instances/{algorithmInstanceId}:
    get:
      description: Returns the instance and its current status; the submitter polls
        this alongside the events to observe a terminal status.
      operationId: ExecutionController_get
      parameters:
        - name: algorithmInstanceId
          required: true
          in: path
          schema:
            type: string
        - name: dataflowId
          required: true
          in: path
          description: Dataflow identifier from the execution endpoint
          schema: {}
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AlgorithmInstanceDto"
      summary: Get an algorithm instance
      tags: *a15
  /api/flows/{dataflowId}/algorithm-instances/{algorithmInstanceId}/start:
    post:
      operationId: ExecutionController_start
      parameters:
        - name: algorithmInstanceId
          required: true
          in: path
          schema:
            type: string
        - name: dataflowId
          required: true
          in: path
          description: Dataflow identifier from the execution endpoint
          schema: {}
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AlgorithmInstanceDto"
      summary: Start a submitted algorithm instance
      tags: *a15
  /api/flows/{dataflowId}/algorithm-instances/{algorithmInstanceId}/terminate:
    post:
      operationId: ExecutionController_terminate
      parameters:
        - name: algorithmInstanceId
          required: true
          in: path
          schema:
            type: string
        - name: dataflowId
          required: true
          in: path
          description: Dataflow identifier from the execution endpoint
          schema: {}
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AlgorithmInstanceDto"
      summary: Terminate a submitted algorithm instance
      tags: *a15
  /api/flows/{dataflowId}/algorithm-instances/{algorithmInstanceId}/events:
    get:
      description: Long poll returning a page of event metadata after the given
        cursor. An empty window answers 200 with the caller's cursor echoed
        back, so the cursor is stable across empty polls. Payloads are fetched
        per event.
      operationId: ExecutionController_events
      parameters:
        - name: algorithmInstanceId
          required: true
          in: path
          schema:
            type: string
        - name: after
          required: false
          in: query
          schema:
            type: number
        - name: limit
          required: false
          in: query
          schema:
            maximum: 500
            type: number
        - name: wait
          required: false
          in: query
          schema:
            maximum: 60000
            type: number
        - name: dataflowId
          required: true
          in: path
          description: Dataflow identifier from the execution endpoint
          schema: {}
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AlgorithmEventPageDto"
      summary: Read the event backlog of an algorithm instance
      tags: *a15
  /api/flows/{dataflowId}/algorithm-instances/{algorithmInstanceId}/events/{eventId}/data:
    get:
      description: Streams the payload, or redirects to a presigned URL when it lives
        in an object store, in which case the bytes never transit this plane.
      operationId: ExecutionController_eventData
      parameters:
        - name: algorithmInstanceId
          required: true
          in: path
          schema:
            type: string
        - name: eventId
          required: true
          in: path
          schema:
            type: string
        - name: dataflowId
          required: true
          in: path
          description: Dataflow identifier from the execution endpoint
          schema: {}
      responses:
        "200":
          description: Binary event payload
      summary: Download the payload of one algorithm event
      tags: *a15
  /api/flows/{dataflowId}/algorithm-instances/{algorithmInstanceId}/event-channels:
    post:
      operationId: ExecutionController_createEventChannel
      parameters:
        - name: algorithmInstanceId
          required: true
          in: path
          schema:
            type: string
        - name: dataflowId
          required: true
          in: path
          description: Dataflow identifier from the execution endpoint
          schema: {}
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateEventChannelDto"
      responses:
        "201":
          description: ""
      summary: Mint an event-write capability for one sender
      tags: *a15
  /api/flows/{dataflowId}/algorithm-instances/{algorithmInstanceId}/event-channels/{recipientId}:
    post:
      operationId: ExecutionController_provisionEventChannel
      parameters:
        - name: algorithmInstanceId
          required: true
          in: path
          schema:
            type: string
        - name: recipientId
          required: true
          in: path
          schema:
            type: string
        - name: dataflowId
          required: true
          in: path
          description: Dataflow identifier from the execution endpoint
          schema: {}
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ProvisionEventChannelDto"
      responses:
        "204":
          description: ""
      summary: Provision an outbound event channel
      tags: *a15
info:
  title: TSG Analytics Data Plane
  description: This OpenAPI specification shows the endpoints of the Analytics Data Plane.
  version: ""
  contact: {}
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
tags:
  - name: Health
    description: Health Controller
  - name: Settings
    description: Settings Controller
  - name: Authentication
    description: Authentication Controller
  - name: Data Plane
    description: Data Plane Controller
  - name: Data Plane Management
    description: Data Plane Management Controller
  - name: Logging
    description: Logging Controller
servers: []
components:
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          scopes: &a16
            create:adp.algorithm: create:adp.algorithm
            read:adp.algorithm: read:adp.algorithm
            update:adp.algorithm: update:adp.algorithm
            delete:adp.algorithm: delete:adp.algorithm
            execute:adp.algorithm: execute:adp.algorithm
            manage:adp.algorithm: manage:adp.algorithm
            create:adp.config: create:adp.config
            read:adp.config: read:adp.config
            update:adp.config: update:adp.config
            delete:adp.config: delete:adp.config
            execute:adp.config: execute:adp.config
            manage:adp.config: manage:adp.config
            create:adp.dataplane: create:adp.dataplane
            read:adp.dataplane: read:adp.dataplane
            update:adp.dataplane: update:adp.dataplane
            delete:adp.dataplane: delete:adp.dataplane
            execute:adp.dataplane: execute:adp.dataplane
            manage:adp.dataplane: manage:adp.dataplane
            create:adp.orchestration: create:adp.orchestration
            read:adp.orchestration: read:adp.orchestration
            update:adp.orchestration: update:adp.orchestration
            delete:adp.orchestration: delete:adp.orchestration
            execute:adp.orchestration: execute:adp.orchestration
            manage:adp.orchestration: manage:adp.orchestration
            create:dp.transfer: create:dp.transfer
            read:dp.transfer: read:dp.transfer
            update:dp.transfer: update:dp.transfer
            delete:dp.transfer: delete:dp.transfer
            execute:dp.transfer: execute:dp.transfer
            manage:dp.transfer: manage:dp.transfer
        clientCredentials:
          scopes: *a16
  schemas:
    RuntimeConfigDto:
      type: object
      properties:
        color:
          type: string
          example: "#3B8BF6"
        darkThemeUrl:
          type: string
          example: https://example.com/darktheme.png
        lightThemeUrl:
          type: string
          example: https://example.com/lighttheme.png
        jobRefreshIntervalMs:
          type: number
          description: Interval in milliseconds for auto-refreshing the jobs table in the
            UI (0 to disable)
          example: 10000
      required:
        - color
    ErrorDto:
      type: object
      properties:
        name:
          type: string
          example: ResourceNotFound
        status:
          type: string
          example: 404 Not Found
        code:
          type: number
          example: 404
        message:
          type: object
          example: The requested resource does not exist.
        error:
          type: string
          example: Not Found
      required:
        - name
        - status
        - code
    DataPlaneDetailsDto:
      type: object
      properties:
        dataplaneType:
          type: string
          example: exampleType
        title:
          type: string
          example: Dataplane Titel
        endpointPrefix:
          type: string
          example: /api/v1/dataplane
        callbackAddress:
          type: string
          example: http://localhost/callback
        managementAddress:
          type: string
          example: http://localhost/manage
          description: Base management/signaling address the control plane sends data
            plane signaling (dataflows/*) to.
        role:
          type: string
          enum:
            - consumer
            - provider
            - both
          example: consumer
        profiles:
          description: Transfer profiles this data plane can execute, advertised at
            registration and used by the control plane to select a data plane
            for a transfer.
          example:
            - tsg:http-PULL
          type: array
          items:
            type: string
        id:
          type: string
          example: dp-12345
      required:
        - dataplaneType
        - title
        - endpointPrefix
        - callbackAddress
        - managementAddress
        - role
        - id
    DataPlaneStateDto:
      type: object
      properties:
        id:
          type: string
          example: 44d1f3d6-f65d-4a7c-84db-f92ba826305e
        details:
          $ref: "#/components/schemas/DataPlaneDetailsDto"
      required:
        - id
        - details
    ConstraintSchema:
      type: object
      properties:
        "@type":
          type: string
          example: Constraint
        leftOperand:
          type: string
          example: leftOperandExample
        operator:
          type: string
          example: operatorExample
        rightOperand:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
          example: rightOperandExample
        rightOperandReference:
          type: string
          example: rightOperandReferenceExample
      required:
        - "@type"
        - leftOperand
        - operator
    PermissionSchema:
      type: object
      properties:
        "@type":
          type: string
          example: Permission
        assigner:
          type: string
          example: assignerExample
        assignee:
          type: string
          example: assigneeExample
        action:
          type: string
          example: actionExample
        target:
          type: string
          example: targetExample
        constraint:
          example: &a17 []
          type: array
          items:
            $ref: "#/components/schemas/ConstraintSchema"
        Duty:
          example: []
          type: array
          items:
            type: string
      required:
        - "@type"
        - action
    ProhibitionSchema:
      type: object
      properties:
        "@type":
          type: string
          example: Prohibition
        assigner:
          type: string
          example: assignerExample
        assignee:
          type: string
          example: assigneeExample
        action:
          type: string
          example: actionExample
        target:
          type: string
          example: targetExample
        constraint:
          example: *a17
          type: array
          items:
            $ref: "#/components/schemas/ConstraintSchema"
      required:
        - "@type"
        - action
    DutySchema:
      type: object
      properties:
        "@type":
          type: string
          example: Duty
        assigner:
          type: string
          example: assignerExample
        assignee:
          type: string
          example: assigneeExample
        action:
          type: string
          example: actionExample
        target:
          type: string
          example: targetExample
        constraint:
          example: *a17
          type: array
          items:
            $ref: "#/components/schemas/ConstraintSchema"
      required:
        - "@type"
        - action
    PolicySchema:
      type: object
      properties:
        "@id":
          type: string
          example: 3f2592da-ffc9-40cb-a336-a9daa9343ce8
        "@type":
          type: string
          example: Offer
        assigner:
          type: string
          example: assignerExample
        assignee:
          type: string
          example: assigneeExample
        profile:
          type: string
          example: profileExample
        permission:
          example: []
          type: array
          items:
            $ref: "#/components/schemas/PermissionSchema"
        prohibition:
          example: []
          type: array
          items:
            $ref: "#/components/schemas/ProhibitionSchema"
        obligation:
          example: []
          type: array
          items:
            $ref: "#/components/schemas/DutySchema"
        target:
          type: string
          example: targetExample
      required:
        - "@id"
        - "@type"
    DurationSchema:
      type: object
      properties:
        "@value":
          type: string
          example: P3Y6M4DT12H30M5S
        "@type":
          type: string
          example: xsd:duration
      required:
        - "@value"
        - "@type"
    DatasetSchema:
      type: object
      properties:
        "@id":
          type: string
          example: 3f2592da-ffc9-40cb-a336-a9daa9343ce8
        contactPoint:
          type: string
          example: contactPointExample
        keyword:
          example: &a18
            - keyword1
            - keyword2
          type: array
          items:
            type: string
        landingPage:
          type: string
          example: landingPageExample
        theme:
          example: &a19
            - theme1
            - theme2
          type: array
          items:
            type: string
        conformsTo:
          example: &a20
            - conformsToExample
          type: array
          items:
            type: string
        creator:
          type: string
          example: creatorExample
        description:
          example: &a21
            - description1
            - description2
          type: array
          items:
            type: string
        identifier:
          type: string
          example: identifierExample
        isReferencedBy:
          type: string
          example: isReferencedByExample
        issued:
          type: string
          example: 2020-01-01
        language:
          type: string
          example: en
        license:
          type: string
          example: licenseExample
        modified:
          type: string
          example: 2020-01-02
        publisher:
          type: string
          example: publisherExample
        relation:
          type: string
          example: relationExample
        title:
          type: string
          example: titleExample
        type:
          type: string
          example: typeExample
        hasPolicy:
          example: &a22 []
          type: array
          items:
            $ref: "#/components/schemas/PolicySchema"
        hasVersion:
          example: &a23
            - version1
            - version2
          type: array
          items:
            type: string
        isVersionOf:
          type: string
          example: isVersionOfExample
        version:
          type: string
          example: versionExample
        hasCurrentVersion:
          type: string
          example: hasCurrentVersionExample
        previousVersion:
          type: string
          example: previousVersionExample
        "@type":
          type: string
          example: Dataset
        distribution:
          type: array
          items:
            type: string
        spatialResolutionInMeters:
          type: string
          example: "100"
        temporalResolution:
          example: P1Y
          allOf:
            - $ref: "#/components/schemas/DurationSchema"
        accrualPeriodicity:
          type: string
          example: accrualPeriodicityExample
        spatial:
          type: string
          example: spatialExample
        temporal:
          type: string
          example: temporalExample
        wasGeneratedBy:
          type: string
          example: wasGeneratedByExample
      required:
        - "@id"
        - "@type"
    ResourceSchema:
      type: object
      properties:
        "@id":
          type: string
          example: 3f2592da-ffc9-40cb-a336-a9daa9343ce8
        "@type":
          type: string
          example: Resource
        contactPoint:
          type: string
          example: contactPointExample
        keyword:
          example: *a18
          type: array
          items:
            type: string
        landingPage:
          type: string
          example: landingPageExample
        theme:
          example: *a19
          type: array
          items:
            type: string
        conformsTo:
          example: *a20
          type: array
          items:
            type: string
        creator:
          type: string
          example: creatorExample
        description:
          example: *a21
          type: array
          items:
            type: string
        identifier:
          type: string
          example: identifierExample
        isReferencedBy:
          type: string
          example: isReferencedByExample
        issued:
          type: string
          example: 2020-01-01
        language:
          type: string
          example: en
        license:
          type: string
          example: licenseExample
        modified:
          type: string
          example: 2020-01-02
        publisher:
          type: string
          example: publisherExample
        relation:
          type: string
          example: relationExample
        title:
          type: string
          example: titleExample
        type:
          type: string
          example: typeExample
        hasPolicy:
          example: *a22
          type: array
          items:
            $ref: "#/components/schemas/PolicySchema"
        hasVersion:
          example: *a23
          type: array
          items:
            type: string
        isVersionOf:
          type: string
          example: isVersionOfExample
        version:
          type: string
          example: versionExample
        hasCurrentVersion:
          type: string
          example: hasCurrentVersionExample
        previousVersion:
          type: string
          example: previousVersionExample
      required:
        - "@id"
        - "@type"
    CatalogRecordSchema:
      type: object
      properties:
        "@id":
          type: string
          example: 3f2592da-ffc9-40cb-a336-a9daa9343ce8
        "@type":
          type: string
          example: CatalogRecord
        conformsTo:
          example:
            - conformsToExample
          type: array
          items:
            type: string
        description:
          example:
            - Record description
          type: array
          items:
            type: string
        issued:
          format: date-time
          type: string
          example: 2020-03-01T00:00:00Z
        modified:
          format: date-time
          type: string
          example: 2020-03-02T00:00:00Z
        title:
          type: string
          example: Catalog title example
        primaryTopic:
          example: {}
          allOf:
            - $ref: "#/components/schemas/ResourceSchema"
      required:
        - "@id"
        - "@type"
    DataServiceSchema:
      type: object
      properties:
        "@id":
          type: string
          example: 3f2592da-ffc9-40cb-a336-a9daa9343ce8
        contactPoint:
          type: string
          example: contactPointExample
        keyword:
          example: *a18
          type: array
          items:
            type: string
        landingPage:
          type: string
          example: landingPageExample
        theme:
          example: *a19
          type: array
          items:
            type: string
        conformsTo:
          example: *a20
          type: array
          items:
            type: string
        creator:
          type: string
          example: creatorExample
        description:
          example: *a21
          type: array
          items:
            type: string
        identifier:
          type: string
          example: identifierExample
        isReferencedBy:
          type: string
          example: isReferencedByExample
        issued:
          type: string
          example: 2020-01-01
        language:
          type: string
          example: en
        license:
          type: string
          example: licenseExample
        modified:
          type: string
          example: 2020-01-02
        publisher:
          type: string
          example: publisherExample
        relation:
          type: string
          example: relationExample
        title:
          type: string
          example: titleExample
        type:
          type: string
          example: typeExample
        hasPolicy:
          example: *a22
          type: array
          items:
            $ref: "#/components/schemas/PolicySchema"
        hasVersion:
          example: *a23
          type: array
          items:
            type: string
        isVersionOf:
          type: string
          example: isVersionOfExample
        version:
          type: string
          example: versionExample
        hasCurrentVersion:
          type: string
          example: hasCurrentVersionExample
        previousVersion:
          type: string
          example: previousVersionExample
        "@type":
          type: string
          example: DataService
        endpointDescription:
          type: string
          example: endpointDescriptionExample
        endpointURL:
          type: string
          example: https://example.com/api
        servesDataset:
          example: []
          type: array
          items:
            $ref: "#/components/schemas/DatasetSchema"
      required:
        - "@id"
        - "@type"
    CatalogSchema:
      type: object
      properties:
        "@id":
          type: string
          example: 3f2592da-ffc9-40cb-a336-a9daa9343ce8
        contactPoint:
          type: string
          example: contactPointExample
        keyword:
          example: *a18
          type: array
          items:
            type: string
        landingPage:
          type: string
          example: landingPageExample
        theme:
          example: *a19
          type: array
          items:
            type: string
        conformsTo:
          example: *a20
          type: array
          items:
            type: string
        creator:
          type: string
          example: creatorExample
        description:
          example: *a21
          type: array
          items:
            type: string
        identifier:
          type: string
          example: identifierExample
        isReferencedBy:
          type: string
          example: isReferencedByExample
        issued:
          type: string
          example: 2020-01-01
        language:
          type: string
          example: en
        license:
          type: string
          example: licenseExample
        modified:
          type: string
          example: 2020-01-02
        publisher:
          type: string
          example: publisherExample
        relation:
          type: string
          example: relationExample
        title:
          type: string
          example: titleExample
        type:
          type: string
          example: typeExample
        hasPolicy:
          example: *a22
          type: array
          items:
            $ref: "#/components/schemas/PolicySchema"
        hasVersion:
          example: *a23
          type: array
          items:
            type: string
        isVersionOf:
          type: string
          example: isVersionOfExample
        version:
          type: string
          example: versionExample
        hasCurrentVersion:
          type: string
          example: hasCurrentVersionExample
        previousVersion:
          type: string
          example: previousVersionExample
        distribution:
          type: array
          items:
            type: string
        spatialResolutionInMeters:
          type: string
          example: "100"
        temporalResolution:
          example: P1Y
          allOf:
            - $ref: "#/components/schemas/DurationSchema"
        accrualPeriodicity:
          type: string
          example: accrualPeriodicityExample
        spatial:
          type: string
          example: spatialExample
        temporal:
          type: string
          example: temporalExample
        wasGeneratedBy:
          type: string
          example: wasGeneratedByExample
        "@type":
          type: string
          example: Catalog
        participantId:
          type: string
          example: did:web:example
        dataset:
          example: []
          type: array
          items:
            $ref: "#/components/schemas/DatasetSchema"
        record:
          example: {}
          type: array
          items:
            $ref: "#/components/schemas/CatalogRecordSchema"
        service:
          example: []
          type: array
          items:
            $ref: "#/components/schemas/DataServiceSchema"
        themeTaxonomy:
          type: string
          example: themeTaxonomyExample
        hasPart:
          example: []
          type: array
          items:
            $ref: "#/components/schemas/ResourceSchema"
        homepage:
          type: string
          example: https://example.com/homepage
      required:
        - "@id"
        - "@type"
        - participantId
    ClientInfo:
      type: object
      properties:
        sub:
          type: string
          example: user-id-123
        name:
          type: string
          example: John Doe
        email:
          type: string
          example: john.doe@example.com
        didId:
          type: string
          example: did:example:123456789
        permissions:
          example:
            - read:credential:own
            - manage:key
          description: ABAC permissions
          type: array
          items:
            type: string
        refreshToken:
          type: string
          example: refresh-token-abc123
      required:
        - sub
        - name
        - email
        - permissions
    AuthenticatedUser:
      type: object
      properties:
        state:
          type: object
          example: authenticated
        user:
          example:
            sub: user-id-123
            name: John Doe
            email: john.doe@example.com
            permissions:
              - read:credential:own
              - manage:key
            didId: did:example:123456789
            refreshToken: refresh-token-abc123
          allOf:
            - $ref: "#/components/schemas/ClientInfo"
      required:
        - state
        - user
    UnauthenticatedUser:
      type: object
      properties:
        state:
          type: object
          example: unauthenticated
      required:
        - state
    TimeDto:
      type: object
      properties:
        format:
          type: string
          description: Time is a wrapper around time.Time which supports correct
            marshaling to YAML and JSON.
      required:
        - format
    ManagedFieldsEntryDto:
      type: object
      properties:
        apiVersion:
          type: string
        fieldsType:
          type: string
        fieldsV1:
          type: object
        manager:
          type: string
        operation:
          type: string
        subresource:
          type: string
        time:
          $ref: "#/components/schemas/TimeDto"
    OwnerReferenceDto:
      type: object
      properties:
        apiVersion:
          type: string
        blockOwnerDeletion:
          type: boolean
        controller:
          type: boolean
        kind:
          type: string
        name:
          type: string
        uid:
          type: string
      required:
        - apiVersion
        - blockOwnerDeletion
        - controller
        - kind
        - name
        - uid
    ObjectMetaDto:
      type: object
      properties:
        annotations:
          type: object
        creationTimestamp:
          $ref: "#/components/schemas/TimeDto"
        deletionGracePeriodSeconds:
          type: number
        deletionTimestamp:
          $ref: "#/components/schemas/TimeDto"
        finalizers:
          type: array
          items:
            type: string
        generateName:
          type: string
        generation:
          type: number
        labels:
          type: object
        managedFields:
          type: array
          items:
            $ref: "#/components/schemas/ManagedFieldsEntryDto"
        name:
          type: string
        namespace:
          type: string
        ownerReferences:
          type: array
          items:
            $ref: "#/components/schemas/OwnerReferenceDto"
        resourceVersion:
          type: string
        selfLink:
          type: string
        uid:
          type: string
    JobDto:
      type: object
      properties:
        apiVersion:
          type: string
        kind:
          type: string
        metadata:
          $ref: "#/components/schemas/ObjectMetaDto"
        spec:
          type: object
        status:
          type: object
    PodSpecDto:
      type: object
      properties:
        activeDeadlineSeconds:
          type: number
        affinity:
          type: object
        automountServiceAccountToken:
          type: boolean
        containers:
          type: array
          items:
            type: object
        dnsConfig:
          type: object
        dnsPolicy:
          type: string
        enableServiceLinks:
          type: boolean
        ephemeralContainers:
          type: array
          items:
            type: string
        hostAliases:
          type: array
          items:
            type: string
        hostIPC:
          type: boolean
        hostNetwork:
          type: boolean
        hostPID:
          type: boolean
        hostUsers:
          type: boolean
        hostname:
          type: string
        imagePullSecrets:
          type: array
          items:
            type: string
        initContainers:
          type: array
          items:
            type: string
        nodeName:
          type: string
        nodeSelector:
          type: object
        os:
          type: object
        overhead:
          type: object
        preemptionPolicy:
          type: string
        priority:
          type: number
        priorityClassName:
          type: string
        readinessGates:
          type: array
          items:
            type: string
        resourceClaims:
          type: array
          items:
            type: string
        resources:
          type: object
        restartPolicy:
          type: string
        runtimeClassName:
          type: string
        schedulerName:
          type: string
        schedulingGates:
          type: array
          items:
            type: string
        securityContext:
          type: object
        serviceAccount:
          type: string
        serviceAccountName:
          type: string
        setHostnameAsFQDN:
          type: boolean
        shareProcessNamespace:
          type: boolean
        subdomain:
          type: string
        terminationGracePeriodSeconds:
          type: number
        tolerations:
          type: array
          items:
            type: string
        topologySpreadConstraints:
          type: array
          items:
            type: string
        volumes:
          type: array
          items:
            type: string
      required:
        - containers
    PodStatusDto:
      type: object
      properties:
        conditions:
          type: array
          items:
            type: string
        containerStatuses:
          type: array
          items:
            type: string
        ephemeralContainerStatuses:
          type: array
          items:
            type: string
        hostIP:
          type: string
        hostIPs:
          type: array
          items:
            type: string
        initContainerStatuses:
          type: array
          items:
            type: string
        message:
          type: string
        nominatedNodeName:
          type: string
        observedGeneration:
          type: number
        phase:
          type: string
        podIP:
          type: string
        podIPs:
          type: array
          items:
            type: string
        qosClass:
          type: string
        reason:
          type: string
        resize:
          type: string
        resourceClaimStatuses:
          type: array
          items:
            type: string
        startTime:
          format: date-time
          type: string
    PodDto:
      type: object
      properties:
        apiVersion:
          type: string
        kind:
          type: string
        metadata:
          $ref: "#/components/schemas/ObjectMetaDto"
        spec:
          $ref: "#/components/schemas/PodSpecDto"
        status:
          $ref: "#/components/schemas/PodStatusDto"
    PodListDto:
      type: object
      properties:
        apiVersion:
          type: string
        kind:
          type: string
        metadata:
          type: object
        items:
          type: array
          items:
            $ref: "#/components/schemas/PodDto"
      required:
        - items
    AlgorithmImageCredentialsDto:
      type: object
      properties:
        registry:
          type: string
          description: Registry hostname for pulling the algorithm image
        username:
          type: string
          description: Username used to authenticate against the registry
        password:
          type: string
          description: Password used to authenticate against the registry
      required:
        - registry
        - username
        - password
    AlgorithmDefinitionDto:
      type: object
      properties:
        title:
          type: string
          description: Title of the algorithm
        description:
          type: string
          description: Description of the algorithm
        keywords:
          description: Keywords associated with the algorithm
          type: array
          items:
            type: string
        image:
          type: string
          description: Public image URL of the algorithm
        imageCredentials:
          description: Optional credentials for pulling the algorithm image
          allOf:
            - $ref: "#/components/schemas/AlgorithmImageCredentialsDto"
        algorithmEvents:
          description: Algorithm event structure of the algorithm
          type: array
          items:
            type: string
        roleDefinitions:
          description: Role definitions for the algorithm
          type: array
          items:
            type: string
        internalEvents:
          description: Internal event structure of the algorithm
          type: array
          items:
            type: string
        uiTemplate:
          description: UI template for visualizing internal events
          type: array
          items:
            type: string
      required:
        - title
        - description
        - keywords
        - image
        - algorithmEvents
        - roleDefinitions
        - internalEvents
        - uiTemplate
    AlgorithmEventDto:
      type: object
      properties:
        id:
          type: string
        eventId:
          type: string
        algorithmInstanceId:
          type: string
        name:
          type: string
        number:
          type: number
        timestamp:
          format: date-time
          type: string
        sequence:
          type: number
        size:
          type: number
        checksum:
          type: string
        createdBy:
          type: string
        recipients:
          type: array
          items:
            type: string
      required:
        - id
        - eventId
        - algorithmInstanceId
        - name
        - number
        - timestamp
        - sequence
        - createdBy
    InternalEventDto:
      type: object
      properties:
        id:
          type: string
        algorithmInstanceId:
          type: string
        name:
          type: string
        number:
          type: number
        timestamp:
          format: date-time
          type: string
        data:
          type: object
          additionalProperties: true
      required:
        - id
        - algorithmInstanceId
        - name
        - number
        - timestamp
    AlgorithmInstanceDto:
      type: object
      properties:
        id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
        algorithmDefinition:
          description: The definition for the algorithm
          allOf:
            - $ref: "#/components/schemas/AlgorithmDefinitionDto"
        participants:
          description: Participants for this algorithm
          type: array
          items:
            type: string
        createdDate:
          format: date-time
          type: string
          example: 2023-01-01T00:00:00.000Z
        status:
          type: string
          description: The current status of the algorithm instance
        startedAt:
          format: date-time
          type: string
        finishedAt:
          format: date-time
          type: string
        algorithmEvents:
          type: array
          items:
            $ref: "#/components/schemas/AlgorithmEventDto"
        internalEvents:
          type: array
          items:
            $ref: "#/components/schemas/InternalEventDto"
      required:
        - id
        - algorithmDefinition
        - participants
        - createdDate
        - status
        - startedAt
    CreateInternalEventDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        number:
          type: number
        timestamp:
          type: string
        data:
          type: object
          additionalProperties: true
      required:
        - id
        - name
        - number
        - timestamp
    CreateAlgorithmEventDto:
      type: object
      properties:
        eventId:
          type: string
        name:
          type: string
        number:
          type: number
        timestamp:
          type: string
        recipients:
          description: List of participant IDs to forward this event to
          type: array
          items:
            type: string
      required:
        - eventId
        - name
        - number
        - timestamp
    DeliverAlgorithmEventDto:
      type: object
      properties:
        event:
          $ref: "#/components/schemas/CreateAlgorithmEventDto"
      required:
        - event
    AssetConfigDto:
      type: object
      properties:
        type:
          type: string
          description: Data-plane specific discriminator, e.g. 'http' (HTTP data plane),
            'file' or 'orchestration' (analytics data plane).
          example: http
        backendUrl:
          type: string
          example: http://backend.internal/api
        authorization:
          type: string
          example: Bearer some-token
        mediaType:
          type: string
          example: application/json
        properties:
          type: object
          description: Data-plane specific configuration, validated by that plane.
    DataflowPrepareMessageDto:
      type: object
      properties:
        messageId:
          type: string
          example: b1d5f9e2-3c4b-4f7a-9c3e-2f1e5d6c7b8a
        participantId:
          type: string
          example: provider-participant-id
          description: The participant ID of the sender.
        counterPartyId:
          type: string
          example: consumer-participant-id
          description: The participant ID of the counterparty.
        dataspaceContext:
          type: string
          example: test-dataspace-context
          description: Identifier for the dataspace context when a data plane is used in
            multiple dataspaces.
        processId:
          type: string
          example: urn:uuid:provider:transfer-1
          description: The transfer process ID assigned by the control plane.
        agreementId:
          type: string
          example: urn:uuid:agreement-1
        datasetId:
          type: string
          example: urn:uuid:dataset-1
        profile:
          type: string
          example: https://w3id.org/dspace-sig/profile/http-pull
          description: The flow transfer profile. See the DPS Transfer Profile Registry.
        claims:
          type: object
          description: The DSP claims of the counterparty as verified by the control plane.
          example: &a24
            membership: active
            sub: subject
        labels:
          description: Labels representing different flavours of data flow.
          type: array
          items:
            type: string
        metadata:
          type: object
          description: Information used by the data plane during preparation/startup.
        role:
          type: string
          enum:
            - provider
            - consumer
          example: provider
        assetConfig:
          $ref: "#/components/schemas/AssetConfigDto"
      required:
        - messageId
        - participantId
        - counterPartyId
        - dataspaceContext
        - processId
        - agreementId
        - datasetId
        - profile
        - claims
        - role
    DataPlaneProperty:
      type: object
      properties:
        name:
          type: string
          example: propertyName
        value:
          type: string
          example: propertyValue
      required:
        - name
        - value
    DataPlaneAddressDto:
      type: object
      properties:
        endpoint:
          type: string
          example: http://data-plane-endpoint
        properties:
          example:
            - name: propertyName
              value: propertyValue
          type: array
          items:
            $ref: "#/components/schemas/DataPlaneProperty"
      required:
        - endpoint
        - properties
    DataflowResponseDto:
      type: object
      properties:
        messageId:
          type: string
          example: b1d5f9e2-3c4b-4f7a-9c3e-2f1e5d6c7b8a
        dataFlowId:
          type: string
          example: urn:uuid:dataflow-1
        state:
          type: string
          enum:
            - INITIALIZED
            - PREPARING
            - PREPARED
            - STARTING
            - STARTED
            - SUSPENDED
            - COMPLETED
            - TERMINATED
          example: PREPARED
        dataAddress:
          $ref: "#/components/schemas/DataPlaneAddressDto"
        error:
          type: string
          example: Backend unreachable
      required:
        - messageId
        - dataFlowId
        - state
    DataflowStartMessageDto:
      type: object
      properties:
        messageId:
          type: string
          example: b1d5f9e2-3c4b-4f7a-9c3e-2f1e5d6c7b8a
        participantId:
          type: string
          example: provider-participant-id
          description: The participant ID of the sender.
        counterPartyId:
          type: string
          example: consumer-participant-id
          description: The participant ID of the counterparty.
        dataspaceContext:
          type: string
          example: test-dataspace-context
          description: Identifier for the dataspace context when a data plane is used in
            multiple dataspaces.
        processId:
          type: string
          example: urn:uuid:provider:transfer-1
          description: The transfer process ID assigned by the control plane.
        agreementId:
          type: string
          example: urn:uuid:agreement-1
        datasetId:
          type: string
          example: urn:uuid:dataset-1
        profile:
          type: string
          example: https://w3id.org/dspace-sig/profile/http-pull
          description: The flow transfer profile. See the DPS Transfer Profile Registry.
        claims:
          type: object
          description: The DSP claims of the counterparty as verified by the control plane.
          example: *a24
        labels:
          description: Labels representing different flavours of data flow.
          type: array
          items:
            type: string
        metadata:
          type: object
          description: Information used by the data plane during preparation/startup.
        dataAddress:
          $ref: "#/components/schemas/DataPlaneAddressDto"
      required:
        - messageId
        - participantId
        - counterPartyId
        - dataspaceContext
        - processId
        - agreementId
        - datasetId
        - profile
        - claims
    DataflowStartedNotificationMessageDto:
      type: object
      properties:
        messageId:
          type: string
          example: b1d5f9e2-3c4b-4f7a-9c3e-2f1e5d6c7b8a
        dataAddress:
          $ref: "#/components/schemas/DataPlaneAddressDto"
      required:
        - messageId
    DataflowSuspendMessageDto:
      type: object
      properties:
        messageId:
          type: string
          example: b1d5f9e2-3c4b-4f7a-9c3e-2f1e5d6c7b8a
        reason:
          type: string
          example: Suspending due to scheduled maintenance.
      required:
        - messageId
    DataflowResumeMessageDto:
      type: object
      properties:
        messageId:
          type: string
          example: b1d5f9e2-3c4b-4f7a-9c3e-2f1e5d6c7b8a
        dataAddress:
          $ref: "#/components/schemas/DataPlaneAddressDto"
      required:
        - messageId
    DataflowTerminateMessageDto:
      type: object
      properties:
        messageId:
          type: string
          example: b1d5f9e2-3c4b-4f7a-9c3e-2f1e5d6c7b8a
        reason:
          type: string
          example: Terminating due to an unrecoverable error.
      required:
        - messageId
    SubmitAlgorithmInstanceDto:
      type: object
      properties:
        id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
        algorithmDefinition:
          description: The definition for the algorithm
          allOf:
            - $ref: "#/components/schemas/AlgorithmDefinitionDto"
        datasetIds:
          description: Datasets this job may read. Each must be bound by a started
            dataflow on this plane.
          type: array
          items:
            type: string
        role:
          type: string
          description: Opaque role label from the orchestrating application, passed to the
            job.
        participants:
          description: The run topology used by algorithms to resolve roles and event
            recipients.
          type: array
          items:
            type: string
      required:
        - id
        - algorithmDefinition
    AlgorithmEventPageDto:
      type: object
      properties:
        events:
          type: array
          items:
            $ref: "#/components/schemas/AlgorithmEventDto"
        nextCursor:
          type: number
        hasMore:
          type: boolean
      required:
        - events
        - nextCursor
        - hasMore
    CreateEventChannelDto:
      type: object
      properties:
        senderId:
          type: string
          description: Participant allowed to send on this channel
      required:
        - senderId
    EventChannelAddressDto:
      type: object
      properties:
        endpoint:
          type: string
        authorization:
          type: string
      required:
        - endpoint
    ProvisionEventChannelDto:
      type: object
      properties:
        address:
          $ref: "#/components/schemas/EventChannelAddressDto"
      required:
        - address
externalDocs:
  description: Git Repository
  url: https://gitlab.com/tno-tsg/dataspace-protocol/tno-security-gateway
