openapi: 3.0.0

info:
  title: SS_ADAE_Ue2UePerformanceAnalytics
  description: |
    API for SEAL VAL Service Area Configuration Service.  
    © 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC).  
    All rights reserved.
  version: "1.1.0-alpha.1"

externalDocs:
  description: >
    3GPP TS 29.549 V19.0.0 Service Enabler Architecture Layer for Verticals (SEAL);
    Application Programming Interface (API) specification; Stage 3.
  url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.549/

security:
  - {}
  - oAuth2ClientCredentials: []

servers:
  - url: '{apiRoot}/ss-adae-uupa/v1'
    variables:
      apiRoot:
        default: https://example.com
        description: apiRoot as defined in clause 6.5 of 3GPP TS 29.549

paths:
  /ue2ue-session-performance:
    post:
      summary: Create an individual UE-to-UE session performance analytics event subscription.
      operationId: SubscribeUe2UePerfAnalytics
      tags:
        - UE-to-UE Performance Subscriptions (Collection)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/U2UPerfSub'
      responses:
        '201':
          description: >
            Subscription to the UE-to-UE session performance analytics is created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/U2UPerfSub'
          headers:
            Location:
              description: Contains the URI of the newly created individual resource.
              required: true
              schema:
                type: string
        '400':
          $ref: 'TS29122_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29122_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29122_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29122_CommonData.yaml#/components/responses/404'
        '411':
          $ref: 'TS29122_CommonData.yaml#/components/responses/411'
        '413':
          $ref: 'TS29122_CommonData.yaml#/components/responses/413'
        '415':
          $ref: 'TS29122_CommonData.yaml#/components/responses/415'
        '429':
          $ref: 'TS29122_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29122_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29122_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29122_CommonData.yaml#/components/responses/default'
      callbacks:
        NotifyU2USessionEvent:
          '{$request.body#/notifUri}': 
            post:
              summary: Notify the UE-to-UE session performance analytics.
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/U2UPerfNotif'
              responses:
                '204':
                  description: The notification is successfully received.
                '307':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/307'
                '308':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/308'
                '400':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/400'
                '401':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/401'
                '403':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/403'
                '404':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/404'
                '411':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/411'
                '413':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/413'
                '415':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/415'
                '429':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/429'
                '500':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/500'
                '503':
                  $ref: 'TS29122_CommonData.yaml#/components/responses/503'
                default:
                  $ref: 'TS29122_CommonData.yaml#/components/responses/default'

  /ue2ue-session-performance/{u2uPerfId}:
    get:
      summary: Read the individual UE-to-UE session performance analytics event subscription.
      operationId: ReadU2UPerfSubscription
      tags:
        - Individual UE-to-UE Performance Subscription (Document)
      parameters:
        - name: u2uPerfId
          in: path
          description: >
            Represents the identifier of an individual UE-to-UE session performance 
            analytics subscription.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: >
            The requested individual UE-to-UE session performance event subscription is returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/U2UPerfSub'
        '400':
          $ref: 'TS29122_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29122_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29122_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29122_CommonData.yaml#/components/responses/404'
        '406':
          $ref: 'TS29122_CommonData.yaml#/components/responses/406'
        '429':
          $ref: 'TS29122_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29122_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29122_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29122_CommonData.yaml#/components/responses/default'

    delete:
      summary: Remove the individual UE-to-UE session performance analytics event subscription.
      operationId: RemoveU2UPerfSubscription
      tags:
        - Individual UE-to-UE Performance Subscription (Document)
      parameters:
        - name: u2uPerfId
          in: path
          description: >
            Represents the identifier of an individual UE-to-UE session performance 
            analytics subscription.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: >
            The individual UE-to-UE session performance event subscription matching
            the u2uPerfId is deleted.
        '307':
          $ref: 'TS29122_CommonData.yaml#/components/responses/307'
        '308':
          $ref: 'TS29122_CommonData.yaml#/components/responses/308'
        '400':
          $ref: 'TS29122_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29122_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29122_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29122_CommonData.yaml#/components/responses/404'
        '429':
          $ref: 'TS29122_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29122_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29122_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29122_CommonData.yaml#/components/responses/default'

components:
  securitySchemes:
    oAuth2ClientCredentials:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: '{tokenUrl}'
          scopes: {}

  schemas:
    U2UPerfSub:
      description: >
        Represents the UE-to-UE session performance analytics subscription.
      type: object
      properties:
        analyticsType:
          $ref: 'TS29549_SS_ADAE_VALPerformanceAnalytics.yaml#/components/schemas/AnalyticsType'
        valUeIds:
          type: array
          description: >
            Represent the list of VAL UEs, whose UE-to-UE session analytics are subscribed to.
          items:
            $ref: 'TS29549_SS_UserProfileRetrieval.yaml#/components/schemas/ValTargetUe'
          minItems: 1
        valServiceId:
          description: Represents the VAL service for which the subscription applies.
          type: string
        confLevel:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger'
        area:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G'
        repReq:
          $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation'
        reportingInds:
          type: array
          description: Indicates the list of the requested analytics.
          items:
            $ref: '#/components/schemas/U2UAnalytics'
          minItems: 1
        reportingThrs:
          type: array
          description: >
            Identifies reporting threshold corresponding to the application QoS index(es).
          items:
            $ref: '#/components/schemas/U2UThreshold'
          minItems: 1
        reportingGrn:
          $ref: '#/components/schemas/U2UReportingGranularity'
        notifUri:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri'
        timeInterval:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow'
        suppFeat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
      required:
        - analyticsType
        - valUeIds
        - notifUri

    U2UPerfNotif:
      description: >
        Represents the threshold for UE-to-UE session performance analytics.
      type: object
      properties:
        analyticsOutput:
          type: array
          description: >
            Represents the exposure level requirements for the analytics to be exposed.
          items:
            $ref: '#/components/schemas/U2UAnalyticsData'
          minItems: 1
        confLevel:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger'
      required:
        - analyticsOutput

    U2UThreshold:
      description: >
        Represents the threshold for UE-to-UE session performance analytics.
      type: object
      properties:
        value:
          $ref: '#/components/schemas/U2UAnalyticsData'
        thrDirect:
          $ref: 'TS29520_Nnwdaf_EventsSubscription.yaml#/components/schemas/MatchingDirection'
      required:
        - value
        - thrDirect

    U2UAnalyticsData:
      description: >
        Represents the UE-to-UE analytics data.
      type: object
      properties:
        valUes:
          $ref: '#/components/schemas/U2UPair'
        avgLatency:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger'
        avgPer:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/PacketErrRate'
        avgDataRate:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/BitRate'
        jitter:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Float'

    U2UPair:
      description: >
        Represents the UE-to-UE pair.
      type: object
      properties:
        valUeA:
          $ref: 'TS29549_SS_UserProfileRetrieval.yaml#/components/schemas/ValTargetUe'
        valUeB:
          $ref: 'TS29549_SS_UserProfileRetrieval.yaml#/components/schemas/ValTargetUe'
      required:
        - valUeA
        - valUeB

# Simple data types and Enumerations

    U2UAnalytics:
      anyOf:
      - type: string
        enum:
          - AVG_LATENCY
          - AVG_PER
          - AVG_DATA_RATE
          - JITTER
      - type: string
        description: >
          This string provides forward-compatibility with future
          extensions to the enumeration and is not used to encode
          content defined in the present version of this API.
      description: |
        Represents the UE-to-UE analytics types.  
        Possible values are:
        - AVG_LATENCY: The indication for requesting the average latency analytics.
        - AVG_PER: The indication for requesting the average packet error rate analytics.
        - AVG_DATA_RATE: The indication for requesting the average data rate analytics.
        - JITTER: The indication for requesting the jitter analytics.

    U2UReportingGranularity:
      anyOf:
      - type: string
        enum:
          - GROUP
          - INDIVIDUAL
      - type: string
        description: >
          This string provides forward-compatibility with future
          extensions to the enumeration and is not used to encode
          content defined in the present version of this API.
      description: |
        Represents the UE-to-UE reporting granularity.  
        Possible values are:
        - GROUP: The indication for requesting the analytics for all
          VAL UE-to-UE application sessions.
        - INDIVIDUAL: The indication for requesting the analytics for individual
          VAL UE-to-UE application sessions.
