openapi: 3.0.0

info:
  title: SS_ADAE_ServerToServerPerformanceAnalytics
  version: 1.0.0
  description: |
    API for ADAE Server to Server Performance Analytics service.  
    © 2025, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC).  
    All rights reserved.

externalDocs:
  description: >
    3GPP TS 29.549 V19.5.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-sspa/v1'
    variables:
      apiRoot:
        default: https://example.com
        description: apiRoot as defined in clause 6.5 of 3GPP TS 29.549

paths:
  /subscriptions:
    post:
      summary: Create an "Individual Server to Server Performance Analytics Subscription" resource.
      operationId: SubscribeServer2ServerPerformanceAnalytics
      tags:
        - Server to Server Performance Analytics Subscription (Collection)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/S2SPerfSubsc'
      responses:
        '201':
          description: >
            Subscription to the Server to Server Performance analytics is created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/S2SPerfSubsc'
          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:
        NotifyServerToServerPerformance:
          '{$request.body#/notifUri}': 
            post:
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/S2SPerfNotif'
              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'

  /subscriptions/{subscriptionId}:
    parameters:
      - name: subscriptionId
        in: path
        description: >
          Represents the identifier of an Individual Server to Server Performance Analytics
          Subscription.
        required: true
        schema:
          type: string
    get:
      summary: Read the "Individual Server to Server Performance Analytics Subscription" resource.
      operationId: ReadIndServer2ServerPerformanceSubscription
      tags:
        - Individual Server to Server Performance Analytics Subscription (Document)
      responses:
        '200':
          description: >
            The requested "Individual Server to Server Performance Analytics Subscription"
            resource is returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/S2SPerfSubsc'
        '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'

    put:
      description: >
        Update the "Individual Server to Server Performance Analytics Subscription" resource.
      operationId: UpdateIndServer2ServerPerformanceSubscription
      tags:
        - Individual Server to Server Performance Analytics Subscription (Document)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/S2SPerfSubsc'
      responses:
        '200':
          description: >
            OK. The Individual Server to Server Performance Analytics Subscription resource
            is successfully updated, and representation of updated resource is returned in
            the response body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/S2SPerfSubsc'
        '204':
          description: >
            No Content. The Individual Server to Server Performance Analytics Subscription resource
            is successfully updated and no content is returned in the response body.
        '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'

    patch:
      description: >
        Modify the "Individual Server to Server Performance Analytics Subscription" resource.
      operationId: ModifyIndServer2ServerPerformanceSubscription
      tags:
        - Individual Server to Server Performance Analytics Subscription (Document)
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/S2SPerfSubscPatch'
      responses:
        '200':
          description: >
            OK. The Individual Server to Server Performance Analytics Subscription resource is
            successfully modified, and representation of the modified resource is returned
            in the response body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/S2SPerfSubsc'
        '204':
          description: >
            No Content. The Individual Server to Server Performance Analytics Subscription resource
            is successfully modified and no content is returned in the response body.
        '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'

    delete:
      summary: Delete the "Individual Server to Server Performance Analytics Subscription" resource.
      operationId: DeleteIndServer2ServerPerformanceSubscription
      tags:
        - Individual Server to Server Performance Analytics Subscription (Document)
      responses:
        '204':
          description: >
            The "Individual Server to Server Performance Analytics Subscription" resource
            matching the subscriptionId 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:
    S2SPerfSubsc:
      description: >
        Represents the Server to Server Performance analytics subscription.
      type: object
      properties:
        analyticsIds:
          type: array
          items:
            $ref: '#/components/schemas/AnalyticsIdSspa'
          minItems: 1
        analyticsType:
          $ref: 'TS29549_SS_ADAE_VALPerformanceAnalytics.yaml#/components/schemas/AnalyticsType'
        serverInfoList:
          type: array
          items:
            $ref: '#/components/schemas/ServerInfo'
          minItems: 1
        valServId:
          type: string
        repReq:
          $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation'
        area:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G'
        confLevel:
          type: integer
          minimum: 0
          maximum: 100
        notifUri:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri'
        serverIdList:
          type: array
          items:
            type: string
          minItems: 1
        serverIpAddList:
          type: array
          items:
            $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr'
          minItems: 1
        timeVal:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow'
        suppFeat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
      required:
        - analyticsType
        - notifUri
        - serverInfoList

    S2SPerfSubscPatch:
      description: >
        Represents the Server to Server Performance analytics subscription modification request.
      type: object
      properties:
        serverInfoList:
          type: array
          items:
            $ref: '#/components/schemas/ServerInfo'
          minItems: 1
        valServId:
          type: string
        repReq:
          $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation'
        area:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G'
        confLevel:
          type: integer
          minimum: 0
          maximum: 100
        notifUri:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri'
        timeVal:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow'

    S2SPerfNotif:
      description: >
        Represents the Server to Server Performance analytics notification.
      type: object
      properties:
        analyticsIds:
          type: array
          items:
            $ref: '#/components/schemas/AnalyticsIdSspa'
          minItems: 1
        analyticsOutput:
          type: array
          items:
            $ref: '#/components/schemas/S2SPerfAnalyticsData'
          minItems: 1
        confLevel:
          type: integer
          minimum: 0
          maximum: 100
      required:
        - analyticsOutput

    S2SPerfAnalyticsData:
      description: >
        Represent the Server to Server Performance analytics data.
      type: object
      properties:
        performChgInd:
          type: boolean
          description: >
            Indicates whether a server-to-server session performance has changed.When present, it
            shall be set as follows:
            - true: the performance has changed.
            - false: the performance is not changed.
            - Default value when omitted is "false".
        timHorizOverInd:
          type: boolean
          description: >
            Indicates whether a server-to-server session performance sustainability has over a given
            time horizon.When present, it shall be set as follows:
            - true: the performance sustainability has over the given time horizon.
            - false: the performance sustainability has not over the given time horizon.
            - Default value when omitted is "false".
        areaOverInd:
          type: boolean
          description: >
            Indicates whether a server-to-server session performance sustainability has over a given
            area.When present, it shall be set as follows:
            - true: the performance sustainability has over the given area.
            - false: the performance sustainability has not over the given area.
            - Default value when omitted is "false".
        qosMeasureRslt:
          description: >
            Represents the QoS measurement result for the Server to Server Performance between any
            VAL UEs within the given area.
              $ref: 'TS29549_SS_Ue2UePerformanceAnalytics.yaml#/components/schemas/U2UAnalyticsData'
      anyOf:
        - required: [performChgInd]
        - required: [timHorizOverInd]
        - required: [areaOverInd]
        - required: [qosMeasureRslt]

    ServerInfo:
      description: >
        Represents the Server Information.
      type: object
      properties:
        serverId:
          type: string
        serverIpAddList:
          type: array
          items:
            $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr'
          minItems: 1
      anyOf:
        - required: [serverId]
        - required: [serverIpAddList]


# Simple data types and Enumerations

    AnalyticsIdSspa:
      anyOf:
      - type: string
        enum:
           - SERVER_TO_SERVER_PERFORMANCE
      - 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 analytic IDs for Server to Server Performance Analytics.  
        Possible values are:
        - SERVER_TO_SERVER_PERFORMANCE: Indicates that the requested analytics is Server to Server
          Performance analytics.

