openapi: 3.0.0

info:
  title: NSCE_ManagementServiceDiscovery
  version: 1.0.0
  description: |
    NSCE_ManagementServiceDiscovery Service.  
    © 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC).  
    All rights reserved.

externalDocs:
  description: >
    3GPP TS 29.435 V18.1.0; Service Enabler Architecture Layer for Verticals (SEAL);
    Network Slice Capability Exposure (NSCE) Server Service(s); Stage 3.
  url: http://www.3gpp.org/ftp/Specs/archive/29_series/29.435/

servers:
  - url: '{apiRoot}/nsce-msd/v1'
    variables:
      apiRoot:
        default: https://example.com
        description: apiRoot as defined in clause 6.5 of 3GPP TS 29.549

security:
  - {}
  - oAuth2ClientCredentials: []

paths:
  /subscriptions:
    post:
      summary: Request the creation of a Management Discovery Subscription.
      operationId: CreateMngtDiscSubsc
      tags:
        - Management Discovery Subscriptions (Collection)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MnSDiscSubsc'
      responses:
        '201':
          description: >
            Created. The Management Discovery Subscription is successfully created and a
            representation of the created Individual Management Discovery Subscription resource
            shall be returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MnSDiscSubsc'
          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:
        ManagementDiscoveryNotif:
          '{$request.body#/notifUri}':
            post:
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/MnSDiscNotif'
              responses:
                '204':
                  description: >
                    No Content. The Management Discovery Notification is successfully received and
                    processed.
                '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 the Individual Management Discovery Subscription resource.
        required: true
        schema:
          type: string

    get:
      summary: Retrieve an existing Individual Management Discovery Subscription resource.
      operationId: GetIndMngtDiscSubsc
      tags:
        - Individual Management Discovery Subscription (Document)
      responses:
        '200':
          description: >
            OK. The requested Individual Management Discovery Subscription resource shall be
            returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MnSDiscSubsc'
        '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'

    put:
      summary: Request the update of an existing Individual Management Discovery Subscription resource.
      operationId: UpdateIndMngtDiscSubsc
      tags:
        - Individual Management Discovery Subscription (Document)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MnSDiscSubsc'
      responses:
        '200':
          description: >
            OK. The Individual Management Discovery Subscription resource is successfully updated
            and a representation of the updated resource shall be returned in the response body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MnSDiscSubsc'
        '204':
          description: >
            No Content. The Individual Management Discovery 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:
      summary: Request the modification of an existing Individual Management Discovery Subscription resource.
      operationId: ModifyIndMngtDiscSubsc
      tags:
        - Individual Management Discovery Subscription (Document)
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/MnSDiscSubscPatch'
      responses:
        '200':
          description: >
            OK. The Individual Management Discovery Subscription resource is successfully modified
            and a representation of the updated resource shall be returned in the response body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MnSDiscSubsc'
        '204':
          description: >
            No Content. The Individual Management Discovery 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: Request the deletion of an existing Individual Management Discovery Subscription resource.
      operationId: DeleteIndMngtDiscSubsc
      tags:
        - Individual Management Discovery Subscription (Document)
      responses:
        '204':
          description: >
            No Content. The Individual Management Discovery 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:
    MnSDiscSubsc:
      description: Represents a Management Discovery Subscription.
      type: object
      properties:
        notifUri:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri'
        netSliceIds:
          type: array
          items:
            $ref: 'TS29435_NSCE_PolicyManagement.yaml#/components/schemas/NetSliceId'
          minItems: 1
        expCapReqs:
          $ref: '#/components/schemas/ExpCapReqs'
        suppFeat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
      required:
        - notifUri

    MnSDiscSubscPatch:
      description: Represents the requested modifications to a Management Discovery Subscription.
      type: object
      properties:
        notifUri:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri'
        expCapReqs:
          $ref: '#/components/schemas/ExpCapReqs'

    MnSDiscNotif:
      description: Represents a Management Discovery Notification.
      type: object
      properties:
        mnSDomainId:
          type: string
        mnSs:
          type: array
          items:
            $ref: '#/components/schemas/MnSInfo'
          minItems: 1
      required:
        - mnSDomainId
        - mnSs

    MnSInfo:
      description: Represents the Management Services related information.
      type: object
      properties:
        mnSIds:
          type: array
          items:
            type: string
          minItems: 1
        mnSCap:
          type: string
        mnSPerms:
          type: array
          items:
            $ref: '#/components/schemas/MnSPermission'
          minItems: 1
        netSliceId:
          $ref: 'TS29435_NSCE_PolicyManagement.yaml#/components/schemas/NetSliceId'
      required:
        - mnSIds
        - mnSCap

    ExpCapReqs:
      description: Represents the exposure capability requirements.
      type: object
      properties:
        reqPerm:
          type: array
          items:
            $ref: '#/components/schemas/MnSPermission'
          minItems: 1
        expCapType:
          type: array
          items:
            $ref: '#/components/schemas/ExpCapType'
          minItems: 1
      anyOf:
        - required: [reqPerm]
        - required: [expCapType]

#
# ENUMERATIONS DATA TYPES
#

    MnSPermission:
      anyOf:
      - type: string
        enum:
          - READ
          - WRITE
          - DELETE
          - UPDATE
      - 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 permissions for exposing information related to the target slice over the MnS.  
        Possible values are:
        - READ: Indicates the allowed permission of the VAL server to read over the MnS.
        - WRITE: Indicates the allowed permission of the VAL server to write over the MnS.
        - DELETE: Indicates the allowed permission of the VAL server to delete over the MnS.
        - UPDATE: Indicates the allowed permission of the VAL server to update over the MnS.

    ExpCapType:
      anyOf:
      - type: string
        enum:
          - VIA_EGMF
          - DIRECT
      - 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 exposure capability type.  
        Possible values are:
        - VIA_EGMF: Indicates the supported exposure capability is via EGMF.
        - DIRECT: Indicates the supported exposure capability is directly to MnS producer.

