openapi: 3.0.0

info:
  title: SEALDD Server Policy Configuration Service
  version: 1.0.0-alpha.4
  description: |
    SEALDD Server Policy Configuration Service.  
    © 2024, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC).  
    All rights reserved.

externalDocs:
  description: >
    3GPP TS 29.548 V1.1.0; Service Enabler Architecture Layer for Verticals (SEAL);
    SEAL Data Delivery (SEALDD) Server Services; Stage 3.
  url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.548/

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

security:
  - {}
  - oAuth2ClientCredentials: []

paths:
  /configurations:
    post:
      summary: Request the creation of a Policy Configuration.
      operationId: CreatePolicyConfig
      tags:
        - Policy Configurations (Collection)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PolicyConfig'
      responses:
        '201':
          description: >
            Created. The Policy Configuration is successfully created and a representation of
            the created Individual Policy Configuration resource shall be returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PolicyConfig'
          headers:
            Location:
              description: >
                Contains the URI of the created Individual Policy Configuration 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'

  /configurations/{configId}:
    parameters:
      - name: configId
        in: path
        description: >
          Represents the identifier of the Individual Policy Configuration resource.
        required: true
        schema:
          type: string

    get:
      summary: Retrieve an existing Individual Policy Configuration resource.
      operationId: GetIndPolicyConfig
      tags:
        - Individual Policy Configuration (Document)
      responses:
        '200':
          description: >
            OK. The requested Individual Policy Configuration resource shall be returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PolicyConfig'
        '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 Policy Configuration resource.
      operationId: UpdateIndPolicyConfig
      tags:
        - Individual Policy Configuration (Document)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PolicyConfig'
      responses:
        '200':
          description: >
            OK. The Individual Policy Configuration 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/PolicyConfig'
        '204':
          description: >
            No Content. The Individual Policy Configuration 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'
        '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'

    patch:
      summary: Request the modification of an existing Individual Policy Configuration resource.
      operationId: ModifyIndPolicyConfig
      tags:
        - Individual Policy Configuration (Document)
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/PolicyConfigPatch'
      responses:
        '200':
          description: >
            OK. The Individual Policy Configuration 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/PolicyConfig'
        '204':
          description: >
            No Content. The Individual Policy Configuration 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'
        '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: Request the deletion of an existing Individual Policy Configuration resource.
      operationId: DeleteIndPolicyConfig
      tags:
        - Individual Policy Configuration (Document)
      responses:
        '204':
          description: >
            No Content. The Individual Policy Configuration 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'
        '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'


components:
  securitySchemes:
    oAuth2ClientCredentials:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: '{tokenUrl}'
          scopes: {}

  schemas:

#
# STRUCTURED DATA TYPES
#

    PolicyConfig:
      description: >
        Represents a SEALDD Policy Configuration.
      type: object
      properties:
        appTrafficIds:
          type: array
          items:
            type: string
          minItems: 1
        valTargetId:
          $ref: 'TS29549_SS_UserProfileRetrieval.yaml#/components/schemas/ValTargetUe'
        sealddPol:
          $ref: '#/components/schemas/SealddPolicy'
        expTime:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/DateTimeRo'
        suppFeat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
      required:
        - appTrafficIds
        - sealddPol

    PolicyConfigPatch:
      description: >
        Represents the requested modifications to a SEALDD Policy Configuration.
      type: object
      properties:
        sealddPol:
          $ref: '#/components/schemas/SealddPolicy'

    SealddPolicy:
      description: >
        Represents a SEALDD Policy.
      type: object
      properties:
        qualGuarPol:
          $ref: '#/components/schemas/QualGuarPolicy'
        bdwCtrlSets:
          type: array
          items:
            $ref: '#/components/schemas/BdwCtrlPolicy'
          minItems: 1
      anyOf:
        - required: [qualGuarPol]
        - required: [bdwCtrlSets]

    QualGuarPolicy:
      description: >
        Represents the quality guarantee policy.
      type: object
      properties:
        thresholds:
          $ref: '#/components/schemas/QualGuarThresh'
      required:
        - thresholds

    QualGuarThresh:
      description: >
        Represents the quality guarantee related thresholds.
      type: object
      properties:
        measId:
          type: array
          items:
            $ref: 'TS29548_SDD_TransmissionQualityMeasurement.yaml#/components/schemas/MeasurementId'
          minItems: 1
        measThesh:
          $ref: 'TS29548_SDD_TransmissionQualityMeasurement.yaml#/components/schemas/TransQualMeasCriteria'
      required:
        - measId
        - measThesh


# SIMPLE DATA TYPES
#

#
# ENUMERATIONS
#

    BdwCtrlPolicy:
      anyOf:
        - type: string
          enum:
          - REALLOCATE_DL
          - REALLOCATE_UL
          - NOT_REALLOCATE_DL
          - NOT_REALLOCATE_UL
        - 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 bandwidth control policy.  
        Possible values are:
        - REALLOCATE_DL: Indicates that the bandwidth control action is to reallocate the
          bandwidth limit between different VAL users for DL traffic.
        - REALLOCATE_UL: Indicates that the bandwidth control action is to reallocate the
          bandwidth limit between different VAL users for UL traffic.
        - NOT_REALLOCATE_DL: Indicates that the bandwidth control action is to not reallocate
          the bandwidth limit between different VAL users for DL traffic.
        - NOT_REALLOCATE_UL: Indicates that the bandwidth control action is to not reallocate
          the bandwidth limit between different VAL users for UL traffic.


# Data types describing alternative data types or combinations of data types:
#

