openapi: 3.0.0

info:
  title: 3gpp-dnai-mapping
  version: 1.0.0
  description: |
    API for DNAI Mapping.  
    © 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC).  
    All rights reserved.

externalDocs:
  description: >
    3GPP TS 29.522 V18.6.0; 5G System; Network Exposure Function Northbound APIs.
  url: 'https://www.3gpp.org/ftp/Specs/archive/29_series/29.522/'

security:
  - {}
  - oAuth2ClientCredentials: []

servers:
  - url: '{apiRoot}/3gpp-dnai-mapping/v1'
    variables:
      apiRoot:
        default: https://example.com
        description: apiRoot as defined in clause 5.2.4 of 3GPP TS 29.122.

paths:
  /{afId}/subscriptions:
    parameters:
      - name: afId
        in: path
        description: Represents the identifier of the AF.
        required: true
        schema:
          type: string

    get:
      summary: Read all the active DNAI Mapping Subscriptions managed by the NEF.
      operationId: ReadDNAIMapSubscs
      tags:
        - DNAI Mapping Subscriptions (Collection)
      responses:
        '200':
          description: >
            OK. All the Individual DNAI Mapping Subscription resource(s) managed by the NEF are
            returned.
            If there are no active Individual DNAI Mapping Subscription resources at the NEF, an
            empty array is returned.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DnaiMapSub'
                minItems: 0
        '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'

    post:
      summary: Create a new DNAI Mapping Subscription.
      operationId: DNAIMapSubsc
      tags:
        - DNAI Mapping Subscriptions (Collection)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DnaiMapSub'
      responses:
        '201':
          description: >
            Created. A representation of the created Individual DNAI Mapping Subscription resource
            is returned in the response body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DnaiMapSub'
          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'
      callbacks:
        DNAIMapInfoUpdateNotif:
          '{$request.body#/notifUri}':
            post:
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/DnaiMapUpdateNotif'
              responses:
                '204':
                  description: >
                    No Content. The notification is successfully received and acknowledged.
                '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'

  /{afId}/subscriptions/{subscriptionId}:
    parameters:
      - name: afId
        in: path
        description: Represents the identifier of the AF.
        required: true
        schema:
          type: string
      - name: subscriptionId
        in: path
        description: Represents the identifier of the Individual DNAI Mapping Subscription resource.
        required: true
        schema:
          type: string

    get:
      summary: Retrieve an existing Individual DNAI Mapping Subscription resource.
      operationId: ReadIndDNAIMapSubsc
      tags:
        - Individual DNAI Mapping Subscription (Document)
      responses:
        '200':
          description: >
            OK. The requested Individual DNAI Mapping Subscription resource is successfully returned
            in the response body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DnaiMapSub'
        '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:
      summary: Delete an existing Individual DNAI Mapping Subscription resource.
      operationId: DeleteIndDNAIMapSubsc
      tags:
        - Individual Dnai Mapping Subscription (Document)
      responses:
        '204':
          description: >
            No Content. The Individual DNAI Mapping Subscription resource is successfully
            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: 
    DnaiMapSub:
      description: Represents a DNAI Mapping Subscription.
      type: object
      properties:
        easIpAddrs:
          type: array
          items:
            $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr'
          minItems: 1
          description: >
            Contains the IP address(es) of the EAS(s) in the Local part of the DN or the IP address
            Range(s)(IPv4 subnetwork(s) and/or IPv6 prefix(es)) of the Local part of the DN where the
            EAS(s) is/are deployed.
        fqdns:
          type: array
          items:
            $ref: 'TS29571_CommonData.yaml#/components/schemas/Fqdn'
          minItems: 1
          description: >
            Contains the FQDN(s) of the EAS(s) in the Local part of the DN where the EAS(s) is/are
            deployed.
        dnn:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn'
        snssai:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Snssai'
        eventReq:
          $ref: 'TS29523_Npcf_EventExposure.yaml#/components/schemas/ReportingInformation'
        immReports:
          type: array
          items:
            $ref: '#/components/schemas/DnaiMapUpdateNotif'
          minItems: 1
          description: Contains the DNAI EAS mapping information.
        notifUri:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri'
        notifCorrId:
          type: string
          description: Contains the updated notification correlation identifier.
        suppFeat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
      oneOf:
        - required: [easIpAddrs]
        - required: [fqdns]
      required:
        - notifUri
        - notifCorrId

    DnaiMapUpdateNotif:
      description: Represents a DNAI Mapping Information Update Notification.
      type: object
      properties:
        dnaiEasAddrMap:
          type: array
          items:
            $ref: 'TS29519_Application_Data.yaml#/components/schemas/DnaiEasInfo'
          minItems: 1
          description: >
            Contains the mapping information between DNAI(s) and EAS address(es).
        mappingId:
          type: string
          description: Identifies the provided mapping information.
        notifCorrId:
          type: string
          description: Contains the notification correlation identifier.
      required:
        - mappingId
        - notifCorrId
