openapi: 3.0.0

info:
  title: SS_ADAE_SlicePerformanceAnalytics
  description: |
    API for ADAE slice-specific application performance analytics service.  
    © 2025, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC).  
    All rights reserved.
  version: "1.1.0"

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:
  /slice-specific-application-performance:
    post:
      description: >
        Creates a new individual slice-specific application performance event subscription.
      operationId: SliceAppPerfSubs
      tags:
        - Slice-specific application performance event subscriptions (Collection)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SliceAppPerfSub'
      callbacks:
        sspaNotification:
          '{$request.body#/notifUri}':
            post:
              requestBody:  # contents of the callback message
                required: true
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/SliceAppPerfNotif'
              responses:
                '204':
                  description: No Content (successful notification)
                '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'
      responses:
        '201':
          description: Slice-specific performance event subscription resource created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SliceAppPerfSub'
          headers:
            Location:
              description: Contains the URI of the newly created 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'

  /slice-specific-application-performance/{ssAppPerfId}:
    get:
      description: >
        Retrieves an individual slice-specific application performance event subscription.
      operationId: ReadIndSliceAppPerfEventSubsc
      tags:
        - Individual slice-specific application performance event subscription (Document)
      parameters:
        - name: ssAppPerfId
          in: path
          description: >
            Identifier of an individual slice-specific application performance event subscription.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: >
            The individual slice-specific application performance
            subscription matching the ssAppPerfId is retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SliceAppPerfSub'
        '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'
        '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:
      description: Deletes an individual slice-specific application performance event subscription.
      operationId: DeleteIndSliceAppPerfEventSubsc
      tags:
        - Individual slice-specific application performance event subscription (Document)
      parameters:
        - name: ssAppPerfId
          in: path
          description: >
            Identifier of an individual slice-specific application performance event subscription.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: >
            The individual slice-specific application performance subscription matching 
            the ssAppPerfId 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:
    SliceAppPerfSub:
      description: >
        Represents an individual slice-specific application performance event subscription resource.
      type: object
      properties:
        notifUri:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri'
        analyticsType:
          $ref: 'TS29549_SS_ADAE_VALPerformanceAnalytics.yaml#/components/schemas/AnalyticsType'
        sliceId:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai'
        dnn:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn'
        valUeIds:
          type: array
          items:
            $ref: 'TS29549_SS_UserProfileRetrieval.yaml#/components/schemas/ValTargetUe'
          minItems: 1
          description: >
            One or more VAL UE IDs whose analytics are subject to subcription.
        valServerId:
          type: string
          description: >
            Identity of the VAL server if the consumer is different than the VAL server of interest.
        valServiceId:
          type: string
        confLevel:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger'
        area:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G'
        timeValidity:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow'
        timeHorizon:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow'
        repReq:
          $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation'
        suppFeat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
      required:
        - analyticsType
        - notifUri
        - sliceId

    SliceAppPerfNotif:
      description: Represents notification of the slice-specific application performance event.
      type: object
      properties:
        analyticsOutput:
          type: array
          items:
            $ref: '#/components/schemas/SliceAppPerfAnalytics'
          minItems: 1
        output:
          type: string
          description: Output data.
        confLevel:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger'
        timeHorizon:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/TimeWindow'
      oneOf:
        - required: [output]
        - required: [analyticsOutput]

    SliceAppPerfAnalytics:
      description: >
        Represents the analytics output for slice performance analytics.
      type: object
      properties:
        valServerId:
          type: string
        valServiceId:
          type: string
        sliceId:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai'
        area:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/LocationArea5G'
        minRtt:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger'
        avgRtt:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger'
        maxRtt:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger'
        minLat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger'
        avgLat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger'
        maxLat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger'
      allOf:
        - anyOf:
          - required: [valServerId]
          - required: [valServiceId]
          - required: [sliceId]
        - anyOf:
          - required: [minRtt]
          - required: [avgRtt]
          - required: [maxRtt]
          - required: [minLat]
          - required: [avgLat]
          - required: [maxLat]

