openapi: 3.0.0
info:
  version: '-'
  title: 'Unified Data Repository Service API file for structured data for exposure'
  description: 'The API version is defined in 3GPP TS 29.504'
externalDocs:
  description: 3GPP TS 29.519 V15.2.0; 5G System; Usage of the Unified Data Repository Service for Policy Data, Application Data and Structured Data for Exposure.
  url: 'http://www.3gpp.org/ftp/Specs/archive/29_series/29.519/'

paths:
  /exposure-data/{ueId}/access-and-mobility-data:
    put:
      summary: Creates and updates the access and mobility exposure data for a UE
      operationId: CreateAccessAndMobilityData
      tags:
        - AccessAndMobilityData
      parameters:
        - name: ueId
          in: path
          description: UE id
          required: true
          schema:
            $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccessAndMobilityData'
      responses:
        '201':
          description: Upon success, a response body is returned containing a representation of the access and mobility data
          headers:
            Location:
              description: 'Contains the URI of the newly created resource'
              required: true
              schema:
                type: string
        '400':
          $ref: 'TS29571_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29571_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29571_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29571_CommonData.yaml#/components/responses/404'
        '411':
          $ref: 'TS29571_CommonData.yaml#/components/responses/411'
        '413':
          $ref: 'TS29571_CommonData.yaml#/components/responses/413'
        '415':
          $ref: 'TS29571_CommonData.yaml#/components/responses/415'
        '429':
          $ref: 'TS29571_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29571_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29571_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29571_CommonData.yaml#/components/responses/default'
    get:
      summary: Retrieves the access and mobility exposure data for a UE
      operationId: QueryAccessAndMobilityData
      tags:
        - AccessAndMobilityData
      parameters:
        - name: ueId
          in: path
          description: UE id
          required: true
          schema:
            $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId'
        - name: supp-feat
          in: query
          description: Supported Features
          schema:
             $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
      responses:
        '200':
          description: The response body contains the access and mobility data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessAndMobilityData'
        '400':
          $ref: 'TS29571_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29571_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29571_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29571_CommonData.yaml#/components/responses/404'
        '406':
          $ref: 'TS29571_CommonData.yaml#/components/responses/406'
        '414':
          $ref: 'TS29571_CommonData.yaml#/components/responses/414'
        '429':
          $ref: 'TS29571_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29571_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29571_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29571_CommonData.yaml#/components/responses/default'
    delete:
      summary: Deletes the access and mobility exposure data for a UE
      operationId: DeleteAccessAndMobilityData
      tags:
        - AccessAndMobilityData
      parameters:
        - name: ueId
          in: path
          description: UE id
          required: true
          schema:
            $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId'
      responses:  
        '204':
          description: Upon success, an empty response body shall be returned
        '400':
          $ref: 'TS29571_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29571_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29571_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29571_CommonData.yaml#/components/responses/404'
        '429':
          $ref: 'TS29571_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29571_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29571_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29571_CommonData.yaml#/components/responses/default'
  /exposure-data/{ueId}/session-management-data/{pduSessionId}:
    put:
      summary: Creates and updates the session management data for a UE and for an individual PDU session
      operationId: CreateSessionManagementData
      tags:
        - PduSessionManagementData
      parameters:
        - name: ueId
          in: path
          description: UE id
          required: true
          schema:
            $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId'
        - name: pduSessionId
          in: path
          description: PDU session id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PduSessionManagementData'
      responses:  
        '201':
          description: Upon success, a response body is returned containing a representation of the session management data
          headers:
            Location:
              description: 'Contains the URI of the newly created resource'
              required: true
              schema:
                type: string
        '400':
          $ref: 'TS29571_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29571_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29571_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29571_CommonData.yaml#/components/responses/404'
        '411':
          $ref: 'TS29571_CommonData.yaml#/components/responses/411'
        '413':
          $ref: 'TS29571_CommonData.yaml#/components/responses/413'
        '415':
          $ref: 'TS29571_CommonData.yaml#/components/responses/415'
        '429':
          $ref: 'TS29571_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29571_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29571_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29571_CommonData.yaml#/components/responses/default'
    get:
      summary: Retrieves the session management data for a UE and for an individual PDU session
      operationId: QuerySessionManagementData
      tags:
        - PduSessionManagementData
      parameters:
        - name: ueId
          in: path
          description: UE id
          required: true
          schema:
            $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId'
        - name: pduSessionId
          in: path
          description: PDU session id
          required: true
          schema:
            type: integer
        - name: ipv4-addr
          in: query
          description: IPv4 Address of the UE
          schema:
            $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr'
        - name: ipv6-prefix
          in: query
          description: IPv6 Address Prefix of the UE
          schema:
            $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix'
        - name: dnn
          in: query
          description: DNN of the UE
          schema:
            $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn'
        - name: fields
          in: query
          description: attributes to be retrieved
          required: false
          schema:
            type: array
            items:
              type: string
        - name: supp-feat
          in: query
          description: Supported Features
          schema:
             $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
      responses:
        '200':
          description: The response body contains the session management data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PduSessionManagementData'
        '400':
          $ref: 'TS29571_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29571_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29571_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29571_CommonData.yaml#/components/responses/404'
        '406':
          $ref: 'TS29571_CommonData.yaml#/components/responses/406'
        '414':
          $ref: 'TS29571_CommonData.yaml#/components/responses/414'
        '429':
          $ref: 'TS29571_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29571_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29571_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29571_CommonData.yaml#/components/responses/default'
    delete:
      summary: Deletes the session management data for a UE and for an individual PDU session
      operationId: DeleteSessionManagementData
      tags:
        - PduSessionManagementData
      parameters:
        - name: ueId
          in: path
          description: UE id
          required: true
          schema:
            $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId'
        - name: pduSessionId
          in: path
          description: PDU session id
          required: true
          schema:
            type: integer
      responses:  
        '204':
          description: Upon success, an empty response body shall be returned
        '400':
          $ref: 'TS29571_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29571_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29571_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29571_CommonData.yaml#/components/responses/404'
        '429':
          $ref: 'TS29571_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29571_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29571_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29571_CommonData.yaml#/components/responses/default'
  /exposure-data/subs-to-notify:
    post:
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExposureDataSubscription'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExposureDataSubscription'
          headers:
            Location:
              description: 'Contains the URI of the newly created resource'
              required: true
              schema:
                type: string
        '400':
          $ref: 'TS29571_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29571_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29571_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29571_CommonData.yaml#/components/responses/404'
        '411':
          $ref: 'TS29571_CommonData.yaml#/components/responses/411'
        '413':
          $ref: 'TS29571_CommonData.yaml#/components/responses/413'
        '415':
          $ref: 'TS29571_CommonData.yaml#/components/responses/415'
        '429':
          $ref: 'TS29571_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29571_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29571_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29571_CommonData.yaml#/components/responses/default'
      callbacks:
        exposureDataChangeNotification:
          '{$request.body#/notificationUri}': 
            post:
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      type: array
                      items:
                        $ref: '#/components/schemas/ExposureDataChangeNotification'
                      minItems: 1
              responses:
                '204':
                  description: No Content, Notification was succesfull
                '400':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/400'
                '401':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/401'
                '403':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/403'
                '404':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/404'
                '411':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/411'
                '413':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/413'
                '415':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/415'
                '429':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/429'
                '500':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/500'
                '503':
                  $ref: 'TS29571_CommonData.yaml#/components/responses/503'
                default:
                  $ref: 'TS29571_CommonData.yaml#/components/responses/default'
  /exposure-data/subs-to-notify/{subId}:
    put:
      summary: updates a subcription for notifications
      parameters:
        - name: subId
          in: path
          description: Subscription id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExposureDataSubscription'
      responses:  
        '200':
          description: Resource was succesfully modified.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExposureDataSubscription'
        '400':
          $ref: 'TS29571_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29571_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29571_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29571_CommonData.yaml#/components/responses/404'
        '411':
          $ref: 'TS29571_CommonData.yaml#/components/responses/411'
        '413':
          $ref: 'TS29571_CommonData.yaml#/components/responses/413'
        '415':
          $ref: 'TS29571_CommonData.yaml#/components/responses/415'
        '429':
          $ref: 'TS29571_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29571_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29571_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29571_CommonData.yaml#/components/responses/default'
    delete:
      summary: Deletes a subcription for notifications
      parameters:
        - name: subId
          in: path
          description: Subscription id
          required: true
          schema:
            type: string
      responses:  
        '204':
          description: Resource was succesfully deleted.
        '400':
          $ref: 'TS29571_CommonData.yaml#/components/responses/400'
        '401':
          $ref: 'TS29571_CommonData.yaml#/components/responses/401'
        '403':
          $ref: 'TS29571_CommonData.yaml#/components/responses/403'
        '404':
          $ref: 'TS29571_CommonData.yaml#/components/responses/404'
        '429':
          $ref: 'TS29571_CommonData.yaml#/components/responses/429'
        '500':
          $ref: 'TS29571_CommonData.yaml#/components/responses/500'
        '503':
          $ref: 'TS29571_CommonData.yaml#/components/responses/503'
        default:
          $ref: 'TS29571_CommonData.yaml#/components/responses/default'
components:
  schemas:
    AccessAndMobilityData:
      type: object
      properties:
        location:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/UserLocation'
        locationTs:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime'
        timeZone:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/TimeZone'
        timeZoneTs:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime'
        accessType:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/AccessType'
        regStates:
          type: array
          items:
            $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/RmInfo'
        regStatesTs:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime'
        connStates:
          type: array
          items:
            $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/CmInfo'
        connStatesTs:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime'
        reachabilityStatus:
          $ref: 'TS29518_Namf_EventExposure.yaml#/components/schemas/UeReachability'
        reachabilityStatusTs:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime'
        smsOverNasStatus:
          $ref: 'TS29518_Namf_Communication.yaml#/components/schemas/SmsSupport'
        smsOverNasStatusTs:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime'
        roamingStatus:
          type: boolean
          description: True  The serving PLMN of the UE is different from the HPLMN of the UE; False  The serving PLMN of the UE is the HPLMN of the UE.
        roamingStatusTs:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime'
        currentPlmn:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/PlmnId'
        currentPlmnTs:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime'
        ratType:
          type: array
          items:
            $ref: 'TS29571_CommonData.yaml#/components/schemas/RatType'
        ratTypesTs:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime'
    PduSessionManagementData:
      type: object
      properties:
        pduSessionStatus:
          $ref: '#/components/schemas/PduSessionStatus'
        pduSessionStatusTs:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime'
        dnai:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnai'
        dnaiTs:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime'
        n6TrafficRoutingInfo:
          type: array
          items:
            $ref: 'TS29571_CommonData.yaml#/components/schemas/RouteToLocation'
        n6TrafficRoutingInfoTs:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime'
        ipv4Addr:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv4Addr'
        ipv6Prefix:
          type: array
          items:
            $ref: 'TS29571_CommonData.yaml#/components/schemas/Ipv6Prefix'
          minItems: 1
          description: UE IPv6 prefix.
        ipAddrTs:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/DateTime'
        dnn:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Dnn'
    ExposureDataSubscription:
      type: object
      properties:
        notificationUri:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri'
        monitoredResourceUris:
          type: array
          items:
            $ref: 'TS29571_CommonData.yaml#/components/schemas/Uri'
          minItems: 1
        supportedFeatures:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
      required:
        - notificationUri
        - monitoredResourceUris
    ExposureDataChangeNotification:
      type: object
      properties:
        ueId:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/VarUeId'
        accessAndMobilityData:
          $ref: '#/components/schemas/AccessAndMobilityData'
        pduSessionManagementData:
          type: array
          items:
            $ref: '#/components/schemas/PduSessionManagementData'
          minItems: 1
    PduSessionStatus:
      anyOf:
      - type: string
        enum:
          - "ACTIVE"
          - "RELEASED"
      - type: string
        description: >
          This string provides forward-compatibility with future
          extensions to the enumeration but is not used to encode
          content defined in the present version of this API.
      description: >
        Possible values are
        - "ACTIVE"
        - "RELEASED"