openapi: 3.0.0

info:
  title: 3gpp-ue-address
  version: 1.1.0-alpha.1
  description: |
    API for UE Address service.
    © 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC).  
    All rights reserved.

externalDocs:
  description: 3GPP TS 29.522 V19.1.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-ue-address/v1'
    variables:
      apiRoot:
        default: https://example.com
        description: apiRoot as defined in subclause 5.2.4 of 3GPP TS 29.122.

paths:
  /retrieve:
    post:
      summary: Request to retrieve UE Address information.
      operationId: RetrieveUEAddress
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UeAddressReq'
      responses:
        '200':
          description: >
            OK. The UE Address information request is successfully processed, and UE address
            information is returned in the response body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UeAddressInfo'
        '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:
    get:
      summary: read all of the active subscriptions for the AF.
      operationId: ReadAllSubscriptions
      tags:
        - UE Address Subscriptions
      parameters:
        - name: supp-feat
          in: query
          description: Features supported by the NF service consumer
          required: false
          schema:
            $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
      responses:
        '200':
          description: OK (Successful get all of the active subscriptions for the AF)
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UeAddrSubsc'
                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: Creates a new subscription resource
      operationId: CreateNewSubscription
      tags:
        - UE Address Subscriptions
      requestBody:
        description: new subscription creation
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UeAddrSubsc'
      callbacks:
        notification:
          '{$request.body#/notifUri}':
            post:
              requestBody:  # contents of the callback message
                required: true
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/UeAddrNotif'
              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: Created (Successful creation)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UeAddrSubsc'
          headers:
            Location:
              description: Contains the URI of the newly created resource.
              required: true
              schema:
                type: string
        '204':
          description: >
            Successful case. The resource has been successfully created and no additional
            content is to be sent in the response message.
        '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}:
    get:
      summary: read an active subscription for the AF and the subscription Id
      operationId: ReadAnSubscription
      tags:
        - Individual UE Address information Subscription
      parameters:
        - name: subscriptionId
          in: path
          description: Identifier of the subscription resource
          required: true
          schema:
            type: string
        - name: supp-feat
          in: query
          description: Features supported by the NF service consumer
          required: false
          schema:
            $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
      responses:
        '200':
          description: OK (Successful get the active subscription)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UeAddrSubsc'
        '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: Deletes an already existing subscription
      operationId: DeleteAnSubscription
      tags:
        - Individual UE Address Subscription
      parameters:
        - name: subscriptionId
          in: path
          description: Identifier of the subscription resource
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content (Successful deletion of the existing subscription)
        '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: 
    UeAddressReq:
      description: Represents the parameters to request the retrieval of UE Address information.
      type: object
      properties:
        afId:
          type: string
        gpsi:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Gpsi'
        suppFeat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
      required:
        - afId
        - gpsi

    UeAddressInfo:
      description: Represents UE Address information.
      type: object
      properties:
        ueIpAddrs:
          type: array
          items:
            $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr'
          minItems: 1
        suppFeat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
      required:
        - ueIpAddrs

    UeAddrSubsc:
      description: Represents the parameters to subscribe for UE Address information.
      type: object
      properties:
        notifUri:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri'
        notifId:
          type: string
        afId:
          type: string
        ueAddrInfo:
          $ref: '#/components/schemas/UeAddrInfo'
        immRepInd:
          type: boolean
          description: >
            Indicates whether immediate reporting shall be included in the corresponding response if
            available:
        immReport:
          $ref: '#/components/schemas/UeAddrNotif'
        suppFeat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
        self:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/Link'
      required:
        - notifUri
        - notifId
        - afId

    UeAddrInfo:
      description: Represents the parameters to subscribe for UE NAT Address information.
      type: object
      properties:
        uePrivateIpAddr:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr'
        ipDomain:
          type: string
        remoteIpAddr:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr'
        remotePortNumber:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger'
      required:
        - uePrivateIpAddr
        - remoteIpAddr

    UeAddrNotif:
      description: Represents a UE address information.
      type: object
      properties:
        notifCorrId:
          type: string
          description: Contains the updated notification correlation identifier.
        ueNatAddrInfo:
          $ref: '#/components/schemas/UeNatAddrInfo'
      required:
        - notifCorrId

    UeNatAddrInfo:
      description: Represents UE NAT Address information.
      type: object
      properties:
        ueNatIpAddr:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/IpAddr'
        ueNatPortNumber:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Uinteger'
