openapi: 3.0.0

info:
  title: UAE Server USS Change Management Service
  version: 1.0.0-alpha.1
  description: |
    UAE Server USS Change Management Service.  
    © 2023, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC).  
    All rights reserved.

externalDocs:
  description: >
    3GPP TS 29.257 V18.1.0; Application layer support for Uncrewed Aerial System (UAS);
    UAS Application Enabler (UAE) Server Services; Stage 3.
  url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.257/

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

security:
  - {}
  - oAuth2ClientCredentials: []

paths:
  /policies:
    get:
      summary: Retrieve all the active USS Change Policies managed by the UAE Server.
      operationId: GetUSSChangePolicies
      tags:
        - USS Change Policies (Collection)
      responses:
        '200':
          description: >
            OK. All the active USS Change Policies managed by the UAE Server shall be returned.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/USSChangePolicy'
        '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: Request the creation of a USS Change Policy.
      operationId: CreateUSSChangePolicy
      tags:
        - USS Change Policies (Collection)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/USSChangePolReq'
      responses:
        '200':
          description: >
            OK. The USS Change Policy is successfully created and a representation of the created
            Individual USS Change Policy resource shall be returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/USSChangePolResp'
          headers:
            Location:
              description: >
                Contains the URI of the created Individual USS Change Policy 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'
#Editor's Note: The definition of the notifications is FFS.


  /policies/{policyId}:
    parameters:
      - name: policyId
        in: path
        description: Represents the identifier of the Individual USS Change Policy resource.
        required: true
        schema:
          type: string

    get:
      summary: Retrieve an existing Individual USS Change Policy resource.
      operationId: GetUSSChangePolicy
      tags:
        - Individual USS Change Policy (Document)
      responses:
        '200':
          description: OK. The requested Individual USS Change Policy resource shall be returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/USSChangePolicy'
        '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 USS Change Policy resource.
      operationId: UpdateUSSChangePolicy
      tags:
        - Individual USS Change Policy (Document)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/USSChangePolicy'
      responses:
        '200':
          description: >
            OK. The Individual USS Change Policy 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/USSChangePolicy'
        '204':
          description: >
            No Content. The Individual USS Change Policy 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 USS Change Policy resource.
      operationId: ModifyUSSChangePolicy
      tags:
        - Individual USS Change Policy (Document)
      requestBody:
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/USSChangePolicyPatch'
      responses:
        '200':
          description: >
            OK. The Individual USS Change Policy 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/USSChangePolicy'
        '204':
          description: >
            No Content. The Individual USS Change Policy 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 USS Change Policy resource.
      operationId: DeleteUSSChangePolicy
      tags:
        - Individual USS Change Policy (Document)
      responses:
        '204':
          description: >
            No Content. The Individual USS Change Policy 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'

  /request-usschange:
    post:
      summary: Request USS change.
      operationId: RequestUSSChange
      tags:
        - Request USS Change
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/USSChangeReq'
      responses:
        '204':
          description: >
            No Content. The USS change request is successfully received.
        '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'


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

  schemas:
    USSChangePolReq:
      description: >
        Represents the parameters to request the creation/Update of a USS Change Policy.
      type: object
      properties:
        uassId:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri'
        ussChangePol:
          $ref: '#/components/schemas/USSChangePolicy'
        suppFeat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
      required:
        - uassId
        - ussChangePol

    USSChangePolResp:
      description: Represents the response to a USS Change Policy create/update request.
      type: object
      properties:
        ussChangePol:
          $ref: '#/components/schemas/USSChangePolicy'
        suppFeat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
      required:
        - ussChangePol

    USSChangePolicy:
      description: Represents a USS Change Policy.
      type: object
      properties:
        uasId:
          $ref: 'TS29257_UAE_C2OperationModeManagement.yaml#/components/schemas/UasId'
        notifUri:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri'
      required:
        - uasId
        - notifUri

    USSChangePolicyPatch:
      description: >
        Represents the parameters to request the modification of a USS Change Policy.
      type: object
      properties:
        notifUri:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri'

    USSChangeReq:
      description: Represents the parameters to request for USS change.
      type: object
      properties:
        uassId:
          $ref: 'TS29122_CommonData.yaml#/components/schemas/Uri'
        uasId:
          $ref: 'TS29257_UAE_C2OperationModeManagement.yaml#/components/schemas/UasId'
        suppFeat:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/SupportedFeatures'
      required:
        - uassId
        - uasId
