openapi: 3.0.0
info:
  title: M1_EdgeResourcesProvisioning
  version: 2.1.2
  description: |
    5GMS AF M1 Edge Resources Provisioning API
    © 2023, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC).
    All rights reserved.
tags:
  - name: M1_EdgeResourcesProvisioning
    description: '5G Media Streaming: Provisioning (M1) APIs: Edge Resources Provisioning'
externalDocs:
  description: 'TS 26.512 V17.6.0; 5G Media Streaming (5GMS); Protocols'
  url: 'https://www.3gpp.org/ftp/Specs/archive/26_series/26.512/'
servers:
  - url: '{apiRoot}/3gpp-m1/v2'
    variables:
      apiRoot:
        default: https://example.com
        description: See 3GPP TS 29.512 clause 7.10.
paths:
  /provisioning-sessions/{provisioningSessionId}/edge-resources-configurations:
    parameters:
      - name: provisioningSessionId
        in: path
        required: true
        schema: 
          $ref: 'TS26512_CommonData.yaml#/components/schemas/ResourceId'
        description: 'The resource identifier of an existing Provisioning Session.'
    post:
      operationId: createEdgeResourcesConfiguration
      summary: 'Create an Edge Resources Configuration within the scope of the specified Provisioning Session'
      requestBody:
        description: 'A JSON representation of an Edge Resources Configuration'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EdgeResourcesConfiguration'
      responses:
        '201':
          description: 'Edge Resources Configuration Created'
          headers:
            Location:
              description: 'URL of the newly created Edge Resources Configuration.'
              required: true
              schema:
                $ref: 'TS26512_CommonData.yaml#/components/schemas/AbsoluteUrl'
  /provisioning-sessions/{provisioningSessionId}/edge-resources-configurations/{edgeResourcesConfigurationId}:
    parameters:
      - name: provisioningSessionId
        in: path
        required: true
        schema: 
          $ref: 'TS26512_CommonData.yaml#/components/schemas/ResourceId'
        description: 'The resource identifier of an existing Provisioning Session.'
      - name: edgeResourcesConfigurationId
        in: path
        required: true
        schema:
          $ref: 'TS26512_CommonData.yaml#/components/schemas/ResourceId'
        description: 'The resource identifier of an existing Edge Resources Configuration.'
    get:
      operationId: retrieveEdgeResourcesConfiguration
      summary: 'Retrieve the Edge Resources Configuration of the specified Provisioning Session'
      responses:
        '200':
          description: 'Success'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EdgeResourcesConfiguration'
    put:
      operationId: updateEdgeResourcesConfiguration
      summary: 'Update an Edge Resources Configuration for the specified Provisioning Session'
      requestBody:
        description: 'A JSON representation of an Edge Resources Configuration'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EdgeResourcesConfiguration'
      responses:
        '204':
          description: 'Updated Edge Resources Configuration'
        '404':
          description: 'Not Found'
    patch:
      operationId: patchEdgeResourcesConfiguration
      summary: 'Patch the Edge Resources Configuration for the specified Provisioning Session'
      requestBody:
        description: 'A JSON representation of a Edge Resources Configuration'
        required: true
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/EdgeResourcesConfiguration'
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/EdgeResourcesConfiguration'
      responses:
        '200':
          description: 'Patched Edge Resources Configuration'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EdgeResourcesConfiguration'
        '404':
          description: 'Not Found'
    delete: 
      operationId: destroyEdgeResourcesConfiguration
      responses:
        '204':
          description: 'Destroyed Edge Resources Configuration'
        '404':
          description: 'Not Found'

components:
  schemas:    
    EdgeResourcesConfiguration:
      type: object
      description: 'A representation of an Edge Resources Configuration resource.'
      required:
        - edgeResourcesConfigurationId
        - edgeManagementMode
        - easRequirements
      properties:
        edgeResourcesConfigurationId:
          $ref: 'TS26512_CommonData.yaml#/components/schemas/ResourceId'
        edgeManagementMode:
          $ref: '#/components/schemas/EdgeManagementMode'
        eligibilityCriteria:
          $ref: 'TS26512_CommonData.yaml#/components/schemas/EdgeProcessingEligibilityCriteria'
        easRequirements:
          $ref: '#/components/schemas/EASRequirements'
        easRelocationRequirements:
          $ref: '#/components/schemas/M1EASRelocationRequirements'

    M1EASRelocationRequirements:
      type: object
      description: 'Relocation requirements of an EAS.'
      required:
        - tolerance
      properties:
        tolerance:
          $ref: 'TS26512_CommonData.yaml#/components/schemas/EASRelocationTolerance'
        maxInterruptionDuration:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm'
        maxResponseTimeDifference:
          $ref: 'TS29571_CommonData.yaml#/components/schemas/UintegerRm'

    EASRequirements:
        type: object
        description: 'Requirements of an EAS.'
        properties:
          easProviderIds:
            type: array
            items:
              type: string
            minItems: 1
          easId:
            type: string
          easType:
            type: string
          easFeatures:
            type: array
            items:
              type: string
            minItems: 1
          serviceKpi:
            $ref: 'TS29558_Eees_EASRegistration.yaml#/components/schemas/EASServiceKPI'
          serviceArea:
            $ref: 'TS29558_Eecs_EESRegistration.yaml#/components/schemas/GeographicalServiceArea'
          serviceAvailabilitySchedule:
            type: array
            items:
              $ref: 'TS29122_CpProvisioning.yaml#/components/schemas/ScheduledCommunicationTime'
            minItems: 1
          serviceContinuityScenarios:
            type: array
            items:
              $ref: 'TS29558_Eecs_EESRegistration.yaml#/components/schemas/ACRScenario'
            minItems: 1
          serviceContinuitySupport:
            type: array
            items:
              $ref: 'TS29558_Eecs_EESRegistration.yaml#/components/schemas/ACRScenario'
            minItems: 1

    EdgeManagementMode:
      description: 'The management mode of an EAS.'
      anyOf:
        - type: string
          enum: [EM_AF_DRIVEN, EM_APP_DRIVEN]
        - 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.
