emolero's picture
Upload folder using huggingface_hub
ab74ec2 verified
|
Raw
History Blame Contribute Delete
72.1 kB

edge-application-management

---
openapi: 3.0.3
info:
  title: Edge Application Management API
  version: wip
  description: |
    Edge Application Management API allows API consumers to manage the
    Life Cycle of an Application and to Discover Edge Cloud Zones.
    # Overview
    The reference scenario foresees a distributed Telco Edge Cloud where any
    Application Delevoper, known as an Application Provider, can host and
    deploy their application according to their specifications and operational
    criteria (e.g. within an specific geographical zone for data protection
    purposes, ensure a minimum QoS for the application clients, etc).
    Through Telco Edge Cloud services Developers around the globe can be
    benefit from the traditional Cloud strengths but expertise and advantages
    of the Mobile Network Operators offering to their users an evolved
    experience for XR, V2X, Holographic and other new services.

    # Introduction
    The Edge Application Management API provides capabilities for lifecycle
    management of application, instances and edge cloud zone discovery.
    Lifecycle Management allows Application Provider to onboard
    their application to the Edge Cloud Platform which do bookkeeping,
    resource validation and other pre-deployment operations.
    Application details can contain components network specification,
    package type (QCOW2, OVA, CONTAINER, HELM, CSAR), operating system details and
    respository to download the image of the desired application.
    Once the application is available on the Edge Cloud
    Platform, the Application Provider can instantiate the application.
    Edge Cloud Provider helps Application Provider to decide where to
    instantiate the applications allowing them to retrieve a list of
    Edge Cloud Zones that meets the provided criteria.

    This discovery can be filtered by an specific geographical region
    (e.g when data residency is need) and by status (active, inactive, unknown)
    Application Provider can ask the Edge Cloud Platform to instantiate the
    application to one or several Edge Cloud Zones that meet the criteria.
    Typically when more than one Edge Cloud Zone is required in the same
    geographic boundary, Application Provider can define instead
    the entire Edge Cloud Region.

    Application Provider can retrieve the information of the instances
    for a given application, the information could be the Edge Cloud Zone
    where the instance is, status (ready, instantiating, failed,
    terminating, unknown) and endpoint (ip, port, fqdn).
    Application Provider can terminate an instance of an application
    (appInstanceId) or all the instances for a given appId.

    # Quick Start
    The usage of this API is based on several resources including GSMA
    Edge Platform, Public Cloud and SDOs, to define a first approach on the
    lifecycle management of application instances and edge cloud zones discovery

    Before starting to use the API, the developer needs to know about
    the below specified details.

    __Application Management__
    * __submitApp__ - Submits application details to an Edge Cloud Provider.
    Based on the details provided, Edge Cloud Provider shall do bookkeeping,
    resource validation and other pre-deployment operations.
    * __deleteApp__ - Removes an application from an Edge Cloud Provider,
    if there is a running instance of the given application,
    the request cannot be done.
    * __getApp__ - Retrieves the information of a given application.

    __Application Instance Management__
    * __createAppInstance__  Request the Edge Cloud Provider to instatiate
    an instance of an application in a given Edge Cloud Zone,
    if this parameter is not set, the Edge Cloud Provider will instantiate
    the applications in all the Edge Cloud Zones.
    * __getAppInstance__  Retrieves the list with information of the instances
    related to a given application.
    * __deleteAppInstance__ - Removes a given application instance from an Edge
    Cloud Zone.

    __Application Deployment Management__
    * __createAppDeployment__ - Requests the Edge Cloud Provider to create and
    maintain application instances to multiple Edge Cloud Zones.
    * __getAppDeployments__ - Retrieves a list of deployments for a given
    application.
    * __deleteAppDeployment__ - Terminates a specific application deployment,
    removing all associated instances.

    __Edge Cloud information__
    *  __getEdgeCloudZones__ List of the operators Edge Cloud Zones and their
    status, ordering the results by location and filtering by status
    (active/inactive/unknown)

    # Authentication and Authorization
    CAMARA guidelines defines a set of authorization flows which can grant API
    clients access to the API functionality, as outlined in the document
    [CAMARA-API-access-and-user-consent.md](https://github.com/camaraproject\
    /IdentityAndConsentManagement/blob/main/documentation/CAMARA-API-access\
    -and-user-consent.md).
    Which specific authorization flows are to be used will be determined during
    onboarding process, happening between the API Client and the Telco Edge
    exposing the API, taking into account the declared purpose for accessing the
    API, while also being subject to the prevailing legal framework dictated by
    local legislation.

    It is important to remark that in cases where personal user data is
    processed by the API, and users can exercise their rights through mechanisms
    such as opt-in and/or opt-out, the use of 3-legged access tokens becomes
    mandatory. This measure ensures that the API remains in strict compliance
    with user privacy preferences and regulatory obligations, upholding the
    principles of transparency and user-centric data control.
    # API documentation
    Two operations have been defined in Edge Application Management API.

    *__Application__* - The Application Provider submit application metadata to
    the Edge Cloud Platform. The Edge Cloud Platform generates an appId for that
    metadata that will be used to instantiate the application within
    the Edge Cloud Zone.

    *__Edge Cloud__* - Retrieves all the Edge Cloud Zones available according to
    some defined parameters where an application can be instantiated.

    Definitions of terminologies commonly referred
    to throughout the API descriptions.
    * __Application Provider__ - The provider of the application that accesses
    an Edge Cloud Provider to deploy its application on the Edge Cloud.
    An Application Provider may be part of a larger organisation,
    like an enterprise, enterprise customer of an Edge Cloud Provider,
    or be an independent entity.
    * __Application__ - Contains the information about the application to be
    instantiated. Descriptor, binary image, charts or any other package
    assosiated with the application. The Application Provider request contains
    mandatory criteria (e.g. required CPU, memory, storage, bandwidth) defined
    in an Application. The Edge Cloud Platform generates a unique ID
    for an Application that is ready to be instantiated.
    * __Application Instance__ - Is an instance (VM or Container based) running
    in an Edge Cloud Zone. The Edge Cloud Platform generates a unique ID
    for each instance.
    * __Application Deployment__ - A specification that defines the requirements
    for the Edge Cloud Provider to create and maintain application instances
    across multiple Edge Cloud Zones. The deployment ensures that the
    application is instantiated and managed consistently across the specified
    zones, meeting the defined requirements.
    * __Edge Cloud__ - Cloud-like capabilities located at the network edge
    including, from the Application Provider's perspective, access to
    elastically allocated compute, data storage and network resources,
    this access is provided through the Edge Cloud Platform.
    * __Edge Cloud Provider__ - Company name of the provider offering the
    Edge Services through the Edge Cloud Platform.
    Could be an Operator or a Cloud Provider.
    * __Edge Cloud Region__ - An Edge Cloud Region is equivalent
    to a Region on a Public Cloud.
    The higher construct in the hierarchy exposed to an Application
    Provider who wishes to deploy an Application on the Edge Cloud and broadly
    represents a geography. An Edge CloudRegion typically contains one or
    multiple Edge Cloud Zones.
    An Edge Cloud Region exists within an Edge Cloud.
    * __Edge Cloud Zone__ - An Edge Cloud Zone is the lowest level of
    abstraction exposed to an Application Provider who wants to deploy
    an Application on Edge Cloud.
    Edge Cloud Zones exists within a Edge Cloud Region.
    ---
  contact:
    email: sp-edc@lists.camaraproject.org
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
externalDocs:
  description: Product documentation at Camara
  url: https://github.com/camaraproject/EdgeCloud

servers:
  - url: "{apiRoot}/edge-application-management/vwip"
    variables:
      apiRoot:
        default: http://localhost:9091
        description: API root, defined by the service provider, e.g. `api.example.com` or `api.example.com/somepath`

tags:
  - name: Application
    description: Application and Application Instance Lice Cycle Management
  - name: Edge Cloud
    description: Edge Cloud Zones Availability

paths:
  /apps:
    post:
      security:
        - openId:
            - edge-application-management:apps:write
      tags:
        - Application
      summary: Submit application metadata to the Edge Cloud Provider.
      description: |
        Contains the information about the application to be
        instantiated in the Edge Cloud
      operationId: submitApp
      parameters:
        - $ref: '#/components/parameters/x-correlator'
      requestBody:
        description: |
          The Application Provider request contains mandatory
          criteria (e.g. required CPU, memory, storage, bandwidth) and
          optional parameters.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AppManifest'
        required: true
      responses:
        '201':
          description: Application created successfully
          headers:
            x-correlator:
              $ref: "#/components/headers/x-correlator"
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmittedApp'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                status: 409
                code: CONFLICT
                message: "App already exists"
        '500':
          $ref: '#/components/responses/500'
        '501':
          $ref: '#/components/responses/501'
        '503':
          $ref: '#/components/responses/503'
    get:
      security:
        - openId:
            - edge-application-management:apps:read
      tags:
        - Application
      summary: Retrieve a list of existing Applications
      description: |
        Get the list of all existing Application definitions from the
        Edge Cloud Provider that the user has permission to view.
      operationId: getApps
      parameters:
        - $ref: '#/components/parameters/x-correlator'
      responses:
        '200':
          description: List of existing applications
          headers:
            x-correlator:
              $ref: "#/components/headers/x-correlator"
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AppManifest'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'

  /apps/{appId}:
    get:
      security:
        - openId:
            - edge-application-management:apps:read
      tags:
        - Application
      summary: Retrieve the information of an Application
      description: |
        Ask the Edge Cloud Provider the information for a given application
      operationId: getApp
      parameters:
        - $ref: '#/components/parameters/x-correlator'
        - name: appId
          description: |
            A globally unique identifier associated with the
            application.
            Edge Cloud Provider generates this identifier when the application
            is submitted.
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/AppId'
      responses:
        '200':
          description: Information of Application
          headers:
            x-correlator:
              $ref: "#/components/headers/x-correlator"
          content:
            application/json:
              schema:
                type: object
                properties:
                  appManifest:
                    $ref: '#/components/schemas/AppManifest'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'
    delete:
      security:
        - openId:
            - edge-application-management:apps:delete
      tags:
        - Application
      summary: |
        Delete an Application from an Edge Cloud Provider
      description: Delete all the information and content
        related to an Application
      operationId: deleteApp
      parameters:
        - $ref: '#/components/parameters/x-correlator'
        - name: appId
          in: path
          description: |
            Identificator of the application to be
            deleted provided by the Edge Cloud Provider
            once the submission was successful
          required: true
          schema:
            $ref: "#/components/schemas/AppId"
      responses:
        '202':
          description: Request accepted
          headers:
            x-correlator:
              $ref: "#/components/headers/x-correlator"
        '204':
          description: App deleted
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                status: 409
                code: CONFLICT
                message: "App with a running application instance
                  cannot be deleted"
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'

  /appinstances:
    post:
      security:
        - openId:
            - edge-application-management:instances:write
      tags:
        - Application
      summary: Instantiation of an Application
      description: |
        Ask the Edge Cloud Platform to instantiate an application to an
        Edge Cloud Zone.
      operationId: createAppInstance
      parameters:
        - $ref: '#/components/parameters/x-correlator'
      requestBody:
        description: |
          Information about the application and where to deploy it.
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - appId
                - edgeCloudZoneId
              properties:
                name:
                  $ref: '#/components/schemas/AppInstanceName'
                appId:
                  $ref: '#/components/schemas/AppId'
                edgeCloudZoneId:
                  $ref: '#/components/schemas/EdgeCloudZoneId'
                kubernetesClusterRef:
                  $ref: '#/components/schemas/KubernetesClusterRef'
        required: true
      responses:
        '202':
          description: Application instantiation accepted
          headers:
            x-correlator:
              $ref: "#/components/headers/x-correlator"
            Location:
              description: Contains the URI of the newly created application.
              required: true
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppInstanceInfo'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                status: 409
                code: CONFLICT
                message: "Application already instantiated in the given
                  Edge Cloud Zone"
        '500':
          $ref: '#/components/responses/500'
        '501':
          $ref: '#/components/responses/501'
        '503':
          $ref: '#/components/responses/503'
    get:
      security:
        - openId:
            - edge-application-management:instances:read
      tags:
        - Application
      summary: Retrieve the information of Application Instances for a given App
      description: |
        Ask the Edge Cloud Provider the information of the instances for a
        given application
      operationId: getAppInstance
      parameters:
        - $ref: '#/components/parameters/x-correlator'
        - name: appId
          description: |
            A globally unique identifier associated with
            the application.
            Edge Cloud Provider generates this identifier when the
            application is submitted.
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/AppId'
        - name: appInstanceId
          description: |
            A globally unique identifier associated with a running
            instance of an application within an specific Edge Cloud Zone.
            Edge Cloud Provider generates this identifier.
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/AppInstanceId'
        - name: region
          description: |
            Human readable name of the geographical Edge Cloud Region of
            the Edge Cloud. Defined by the Edge Cloud Provider.
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/EdgeCloudRegion'
      responses:
        '200':
          description: |
            List of application instances. Returns an empty list if no
            instances were found or none match the specified query
            parameters.
          headers:
            x-correlator:
              $ref: "#/components/headers/x-correlator"
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AppInstanceInfo'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'
  /appinstances/{appInstanceId}:
    delete:
      security:
        - openId:
            - edge-application-management:instances:delete
      tags:
        - Application
      summary: Terminate an Application Instance
      description: |
        Terminate a running instance of an application within
        an Edge Cloud Zone
      operationId: deleteAppInstance
      parameters:
        - $ref: '#/components/parameters/x-correlator'
        - name: appInstanceId
          in: path
          description: |
            Identificator of the specific application instance
            that will be terminated
          required: true
          schema:
            $ref: "#/components/schemas/AppInstanceId"
      responses:
        '202':
          description: |
            Request accepted to be processed. It applies for async
            deletion process
          headers:
            x-correlator:
              $ref: "#/components/headers/x-correlator"
        '204':
          description: Application Instance Deleted
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'

  /deployments:
    post:
      security:
        - openId:
            - edge-application-management:deployments:write
      tags:
        - Application
      summary: Deploy an Application
      description: |
        Ask the Edge Cloud Platform to instantiate an application to several
        Edge Cloud Zones.
      operationId: createAppDeployment
      parameters:
        - $ref: '#/components/parameters/x-correlator'
      requestBody:
        description: |
          Information about the application and where to deploy it.
        content:
          application/json:
            schema:
              type: object
              required:
                - appDeploymentName
                - appId
                - edgeCloudZones
              properties:
                appDeploymentName:
                  $ref: '#/components/schemas/AppDeploymentName'
                appId:
                  $ref: '#/components/schemas/AppId'
                edgeCloudZones:
                  type: array
                  items:
                    $ref: '#/components/schemas/EdgeCloudZoneId'
                kubernetesClusterRefs:
                  type: array
                  items:
                    $ref: '#/components/schemas/KubernetesClusterRef'
        required: true
      responses:
        '202':
          description: Application deployment accepted
          headers:
            x-correlator:
              $ref: "#/components/headers/x-correlator"
          content:
            application/json:
              schema:
                type: object
                properties:
                  appDeploymentId:
                    $ref: '#/components/schemas/AppDeploymentId'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                status: 409
                code: CONFLICT
                message: "Deployment already exists"
        '500':
          $ref: '#/components/responses/500'
        '501':
          $ref: '#/components/responses/501'
        '503':
          $ref: '#/components/responses/503'
    get:
      security:
        - openId:
            - edge-application-management:deployments:read
      tags:
        - Application
      summary: Retrieve a list of Application Deployment for a given App
      description: |
        Ask the Edge Cloud Provider the information of the Deployments for a
        given application
      operationId: getAppDeployments
      parameters:
        - $ref: '#/components/parameters/x-correlator'
        - name: appId
          description: |
            A globally unique identifier associated with
            the application.
            Edge Cloud Provider generates this identifier when the
            application is submitted.
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/AppId'
        - name: appDeploymentId
          description: |
            A globally unique identifier associated with a existing deployment
            of an application. Edge Cloud Platform generates this identifier when
            the deployment request in the Edge Cloud Zone is successful.
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/AppDeploymentId'
      responses:
        '200':
          description: |
            List of application deployments. Returns an empty list if no
            deployments were found or none match the specified query
            parameters.
          headers:
            x-correlator:
              $ref: "#/components/headers/x-correlator"
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AppDeploymentInfo'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '410':
          $ref: '#/components/responses/410'
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'
  /deployments/{appDeploymentId}:
    delete:
      security:
        - openId:
            - edge-application-management:deployments:delete
      tags:
        - Application
      summary: Terminate an Application Deployment
      description: |
        Delete a deployment terminating all related instances of an application
      operationId: deleteAppDeployment
      parameters:
        - $ref: '#/components/parameters/x-correlator'
        - name: appDeploymentId
          in: path
          description: |
            Identificator of the specific application deployment
            that will be terminated
          required: true
          schema:
            $ref: "#/components/schemas/AppDeploymentId"
      responses:
        '202':
          description: |
            Request accepted to be processed. It applies for async
            deletion process
          headers:
            x-correlator:
              $ref: "#/components/headers/x-correlator"
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '410':
          $ref: '#/components/responses/410'
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'
    patch:
      security:
        - openId:
            - edge-application-management:deployments:update
      tags:
        - Application
      summary: Update an Application Deployment
      description: |
        Update the configuration or properties of an existing application deployment
        using JSON Merge Patch semantics (RFC 7396). Only the fields provided in the
        request body will be updated. Fields not included in the request will remain unchanged.

        IMPORTANT: When updating array fields (like edgeCloudZones or kubernetesClusterRefs),
        JSON Merge Patch will REPLACE the entire array, not merge or append to it.

        This operation may include changing the deployment name, target Edge Cloud Zones, or other updatable fields.
      operationId: updateAppDeployment
      parameters:
        - $ref: '#/components/parameters/x-correlator'
        - name: appDeploymentId
          in: path
          description: |
            Identifier of the specific application deployment to be updated.
          required: true
          schema:
            $ref: "#/components/schemas/AppDeploymentId"
      requestBody:
        description: |
          The fields to update for the application deployment using JSON Merge Patch (RFC 7396).
          Only the fields included in the request will be updated; omitted fields remain unchanged.

          NOTE: When updating array fields (edgeCloudZones, kubernetesClusterRefs), the entire array
          will be REPLACED, not merged. To modify an array, you must include the complete array
          with all desired elements in your request.
        required: true
        content:
          application/merge-patch+json:
            schema:
              type: object
              properties:
                appDeploymentName:
                  $ref: '#/components/schemas/AppDeploymentName'
                edgeCloudZones:
                  type: array
                  items:
                    $ref: '#/components/schemas/EdgeCloudZoneId'
                kubernetesClusterRefs:
                  type: array
                  items:
                    $ref: '#/components/schemas/KubernetesClusterRef'
            examples:
              updateDeploymentName:
                summary: Update only the deployment name
                description: |
                  This example shows how to update only the deployment name.
                  Other fields will remain unchanged.
                value:
                  appDeploymentName: "my_updated_deployment"
              updateMultipleFields:
                summary: Update multiple fields simultaneously
                description: |
                  This example shows how to update both the deployment name
                  and Edge Cloud Zones in a single request. Remember that both
                  array fields will be completely replaced with the new values.
                value:
                  appDeploymentName: "production_deployment"
                  edgeCloudZones:
                    - "123e4567-e89b-12d3-a456-426614174000"
                    - "123e4567-e89b-12d3-a456-426614174001"
                  kubernetesClusterRefs:
                    - "642f6105-7015-4af1-a4d1-e1ecb8437abc"
                    - "642f6105-7015-4af1-a4d1-e1ecb8437def"
              arrayReplacementExample:
                summary: Example of array replacement behavior
                description: |
                  This example demonstrates how arrays are completely replaced in JSON Merge Patch.

                  If the current deployment has:
                  - edgeCloudZones: ["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001", "123e4567-e89b-12d3-a456-426614174002"]
                  - kubernetesClusterRefs: ["642f6105-7015-4af1-a4d1-e1ecb8437abc", "642f6105-7015-4af1-a4d1-e1ecb8437def"]

                  And the user sends this patch:
                  - edgeCloudZones: ["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174003"]

                  The result will be:
                  - edgeCloudZones: ["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174003"] (completely replaced)
                  - kubernetesClusterRefs: ["642f6105-7015-4af1-a4d1-e1ecb8437abc", "642f6105-7015-4af1-a4d1-e1ecb8437def"] (unchanged, as it wasn't in the patch)

                  To add a single zone while keeping existing ones, ALL zones must be included in the request.
                value:
                  edgeCloudZones:
                    - "123e4567-e89b-12d3-a456-426614174000"
                    - "123e4567-e89b-12d3-a456-426614174003"
      responses:
        '200':
          description: Application deployment updated successfully
          headers:
            x-correlator:
              $ref: "#/components/headers/x-correlator"
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppDeploymentInfo'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '410':
          $ref: '#/components/responses/410'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInfo'
              example:
                status: 409
                code: CONFLICT
                message: "Update conflict"
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'

  /clusters:
    get:
      security:
        - openId:
            - edge-application-management:clusters:read
      tags:
        - Cluster
      summary: |
        Retrieve a list of the available clusters filtered by the optional
        query parameters.
      description: |
        List available cluster information
      operationId: getClusters
      parameters:
        - $ref: '#/components/parameters/x-correlator'
        - name: region
          description: |
            Human readable name of the geographical Edge Cloud Region of
            the Cluster. Defined by the Edge Cloud Provider.
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/EdgeCloudRegion'
        - name: clusterRef
          description: |
            A globally unique identifier for the Cluster.
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/KubernetesClusterRef'
        - name: edgeCloudZoneId
          description: |
            Edge Cloud Zone identifier.
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/EdgeCloudZoneId'
      responses:
        '200':
          description: |
            Successful response, returning the cluster's information.
            Returns an empty list if no clusters were found or none match
            the specified query parameters.
          headers:
            x-correlator:
              $ref: "#/components/headers/x-correlator"
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ClusterInfo'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'
  /edge-cloud-zones:
    get:
      security:
        - openId:
            - edge-application-management:edge-cloud-zones:read
      tags:
        - Edge Cloud
      summary: Retrieve a list of the operators Edge Cloud Zones and
        their status
      description: |
        List of the operators Edge Cloud Zones and their
        status, ordering the results by location and filtering by
        status (active/inactive/unknown)
      operationId: getEdgeCloudZones
      parameters:
        - $ref: '#/components/parameters/x-correlator'
        - name: region
          description: |
            Human readable name of the geographical Edge Cloud Region of
            the Edge Cloud. Defined by the Edge Cloud Provider.
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/EdgeCloudRegion'
        - name: status
          description: Human readable status of the Edge Cloud Zone
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/EdgeCloudZoneStatus'
      responses:
        '200':
          description: |
            Successful response, returning the
            Available Edge Cloud Zones.
          headers:
            x-correlator:
              $ref: "#/components/headers/x-correlator"
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EdgeCloudZones'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'
components:
  securitySchemes:
    openId:
      description: OpenID Provider Configuration Information.
      type: openIdConnect
      openIdConnectUrl: https://example.com/.well-known/openid-configuration
  parameters:
    x-correlator:
      name: x-correlator
      in: header
      description: |
        Correlation id for the different services
      schema:
        type: string
  headers:
    x-correlator:
      description: |
        Correlation id for the different services
      required: false
      schema:
        type: string
        format: uuid

  schemas:
    AccessEndpoint:
      type: object
      description: |
        Application Endpoint for an especific instance that is
        running in an specific Edge Cloud Zone.
      required:
        - port
      anyOf:
        - required:
            - fqdn
        - required:
            - ipv4Addresses
        - required:
            - ipv6Addresses
      properties:
        port:
          $ref: '#/components/schemas/Port'
        fqdn:
          $ref: '#/components/schemas/Fqdn'
        ipv4Addresses:
          description: IP version 4 of an application instance
          type: array
          items:
            $ref: '#/components/schemas/Ipv4Addr'
          minItems: 1
        ipv6Addresses:
          description: IP version 6 of an application instance.
          type: array
          items:
            $ref: '#/components/schemas/Ipv6Addr'
          minItems: 1

    AppId:
      type: string
      format: uuid
      description: |
        A globally unique identifier associated with the application.
        Edge Cloud Platform generates this identifier when the
        Application is submitted.

    AppInstanceId:
      type: string
      format: uuid
      description: |
        A globally unique identifier associated with a running
        instance of an application.
        Edge Cloud Platform generates this identifier when the
        instantiation in the Edge Cloud Zone is successful.

    AppDeploymentId:
      type: string
      format: uuid
      description: |
        A globally unique identifier associated with a existing deployment
        of an application. Edge Cloud Platform generates this identifier when
        the deployment request in the Edge Cloud Zone is successful.

    AppDeploymentInfo:
      type: object
      required:
        - appDeploymentName
        - appDeploymentId
        - appId
        - edgeCloudZones
        - appInstances
      properties:
        appDeploymentName:
          $ref: '#/components/schemas/AppDeploymentName'
        appDeploymentId:
          $ref: '#/components/schemas/AppDeploymentId'
        appId:
          $ref: '#/components/schemas/AppId'
        edgeCloudZones:
          type: array
          items:
            $ref: '#/components/schemas/EdgeCloudZoneId'
        appInstances:
          type: array
          items:
            $ref: '#/components/schemas/AppInstanceId'

    AppInstanceInfo:
      description: Information about the application instance.
      type: object
      required:
        - name
        - appId
        - appInstanceId
        - appProvider
        - edgeCloudZoneId
      properties:
        name:
          $ref: '#/components/schemas/AppInstanceName'
        appId:
          $ref: '#/components/schemas/AppId'
        appInstanceId:
          $ref: '#/components/schemas/AppInstanceId'
        appProvider:
          $ref: '#/components/schemas/AppProvider'
        status:
          description: Status of the application instance (default is 'unknown')
          type: string
          enum:
            - ready
            - instantiating
            - failed
            - terminating
            - unknown
          default: unknown
        componentEndpointInfo:
          description: |
            Information about the IP and Port exposed by the
            Edge Cloud Platform.
            Application Client shall use these access points to reach this
            application instance
          type: array
          items:
            type: object
            required:
              - interfaceId
              - accessPoints
            properties:
              interfaceId:
                type: string
                pattern: ^[A-Za-z0-9][A-Za-z0-9_]{6,30}[A-Za-z0-9]$
                description: |
                  This is the interface Identifier that Application Provider
                  defines when application is being submitted.
              accessPoints:
                $ref: '#/components/schemas/AccessEndpoint'
          minItems: 1
        kubernetesClusterRef:
          $ref: '#/components/schemas/KubernetesClusterRef'
        edgeCloudZoneId:
          $ref: '#/components/schemas/EdgeCloudZoneId'

    AppInstanceName:
      type: string
      pattern: ^[A-Za-z][A-Za-z0-9_]{1,63}$
      description: Name of the App instance, scoped to the AppProvider

    AppDeploymentName:
      type: string
      pattern: ^[A-Za-z][A-Za-z0-9_]{1,63}$
      description: Name of the App Deployment, scoped to the AppProvider

    AppManifest:
      description: |
        Application information and requirements provided by the
        Application Provider
      properties:
        appId:
          $ref: '#/components/schemas/AppId'
        name:
          type: string
          pattern: ^[A-Za-z][A-Za-z0-9_]{1,63}$
          description: Name of the application.
        appProvider:
          $ref: '#/components/schemas/AppProvider'
        version:
          type: string
          description: Application version information
        packageType:
          description: Format of the application image package
          type: string
          enum:
            - QCOW2
            - OVA
            - CONTAINER
            - HELM
            - CSAR
        operatingSystem:
          $ref: '#/components/schemas/OperatingSystem'
        appRepo:
          description: |
            Repository where Application Provider stores the application image
          type: object
          required:
            - type
            - imagePath
          properties:
            type:
              type: string
              enum:
                - PRIVATEREPO
                - PUBLICREPO
              description: |
                Application repository and image URI information.
                PUBLICREPO is used of public urls like github, helm repo etc.
                PRIVATEREPO  is used for private repo managed by the application
                developer. Private repo can be accessed by using the app
                developer provided userName and password. Password is
                recommended to be the personal access token created by developer
                e.g. in Github repo.
            imagePath:
              $ref: '#/components/schemas/Uri'
            userName:
              type: string
              description: |
                Username to acces the Helm chart, docker-compose
                file or VM image repository
            credentials:
              type: string
              maxLength: 128
              description: |
                Password or personal access token created by
                developer to acces the app repository. API users can generate
                a personal access token e.g. docker clients to use them as
                password.
            authType:
              type: string
              enum:
                - DOCKER
                - HTTP_BASIC
                - HTTP_BEARER
                - NONE
              description: |
                The credentials can also be formatted as a Basic
                auth or Bearer auth in HTTP "Authorization" header.
            checksum:
              type: string
              description: |
                MD5 checksum for VM and file-based images, sha256
                digest for containers
        requiredResources:
          $ref: '#/components/schemas/RequiredResources'
        componentSpec:
          description: |
            Information defined in "appRepo" point to the application
            descriptor e.g. Helm chart, docker-compose yaml file etc.
            The descriptor may contain one or more containers and their
            associated meta-data. A component refers to additional details
            about these containers to expose the instances of the containers
            to external client applications. App provider can define one or
            more components (via the associated network port) in componentSpec
            corresponding to the containers in helm charts or docker-compose
            yaml file as part of app descriptors.
          type: array
          items:
            type: object
            required:
              - componentName
              - networkInterfaces
            properties:
              componentName:
                type: string
                description: Component name must be unique with an application
              networkInterfaces:
                description: |
                  Each application component exposes some ports
                  either for external users or for inter component
                  communication.
                  Application provider is required to specify which ports are
                  to be exposed and the type of traffic that will flow through
                  these ports.The underlying platform may assign a dynamic port
                  against the "extPort" that the application clients will use
                  to connect with edge application instance.
                type: array
                items:
                  type: object
                  required:
                    - interfaceId
                    - protocol
                    - port
                    - visibilityType
                  properties:
                    interfaceId:
                      type: string
                      pattern: ^[A-Za-z][A-Za-z0-9_]{3,31}$
                      description: |
                        Each Port and corresponding traffic protocol
                        exposed by the component is identified by a name.
                        Application client on user device requires this to
                        uniquley idenify the interface.
                    protocol:
                      type: string
                      enum:
                        - TCP
                        - UDP
                        - ANY
                      description: |
                        Defines the IP transport communication
                        protocol i.e., TCP, UDP or ANY
                    port:
                      type: integer
                      format: int32
                      minimum: 1
                      maximum: 65535
                      description: |
                        Port number exposed by the component.
                        Edge Cloud Provider may generate a dynamic port
                        towards the component instance which forwards
                        external traffic to the component port.
                    visibilityType:
                      description: |
                        Defines whether the interface is exposed
                        to outer world or not i.e., external, or internal.
                        If this is set to "external", then it is  exposed
                        to external applications otherwise it is exposed
                        internally to edge application components within
                        edge cloud. When exposed to external world,
                        an external dynamic port is assigned for UC traffic
                        and mapped to the extPort
                      type: string
                      enum:
                        - VISIBILITY_EXTERNAL
                        - VISIBILITY_INTERNAL
                minItems: 1
      required:
        - name
        - version
        - appProvider
        - packageType
        - appRepo
        - requiredResources
        - componentSpec

    AppProvider:
      type: string
      pattern: ^[A-Za-z][A-Za-z0-9_]{7,63}$
      description: Human readable name of the Application Provider.

    ClusterInfo:
      description: Kubernetes cluster information
      required:
        - name
        - provider
        - clusterRef
        - edgeCloudZoneId
      properties:
        name:
          type: string
          description: |
            Name of the Cluster, scoped to the Provider
        provider:
          $ref: '#/components/schemas/AppProvider'
        clusterRef:
          $ref: '#/components/schemas/KubernetesClusterRef'
        edgeCloudZoneId:
          $ref: '#/components/schemas/EdgeCloudZoneId'
        edgeCloudRegion:
          $ref: '#/components/schemas/EdgeCloudRegion'
        version:
          type: string
          description: Kubernetes version of the cluster.
        nodePools:
          description: Node Pools in the cluster.
          type: array
          items:
            $ref: '#/components/schemas/KubernetesNodePool'
          minItems: 1

    EdgeCloudProvider:
      type: string
      description: Human readable name of the Edge Cloud Provider.

    EdgeCloudRegion:
      type: string
      description: |
        Human readable name of the geographical Edge Cloud Region of
        the Edge Cloud. Defined by the Edge Cloud Provider.

    EdgeCloudZones:
      type: array
      items:
        $ref: '#/components/schemas/EdgeCloudZone'
      minItems: 1
      description: |
        A collection of Edge Cloud Zones where the Application Provider can
        instantiate an Application Instance.
      additionalProperties: false

    EdgeCloudZoneId:
      type: string
      format: uuid
      description: |
        Unique identifier created by the Edge Cloud Platform to identify an
        Edge Cloud Zone within an Edge Cloud.

    EdgeCloudZone:
      type: object
      description: |
        An Edge Cloud Zone, uniquely identified by a
        combination of the value of the Edge Cloud Zone Id object
        and the value of the Edge Cloud Provider
        object. This value is used to identify an Edge Cloud zone
        between Edge Clouds from different Edge Cloud Providers.
      required:
        - edgeCloudZoneId
        - edgeCloudZoneName
        - edgeCloudProvider
      properties:
        edgeCloudZoneId:
          $ref: '#/components/schemas/EdgeCloudZoneId'
        edgeCloudZoneName:
          $ref: '#/components/schemas/EdgeCloudZoneName'
        edgeCloudZoneStatus:
          $ref: '#/components/schemas/EdgeCloudZoneStatus'
        edgeCloudProvider:
          $ref: '#/components/schemas/EdgeCloudProvider'
        edgeCloudRegion:
          $ref: '#/components/schemas/EdgeCloudRegion'
      minItems: 1

    EdgeCloudZoneName:
      type: string
      description: |
        Human readable name of the geographical zone of
        the Edge Cloud. Defined by the Edge Cloud Provider.

    EdgeCloudZoneStatus:
      description: Status of the Edge Cloud Zone (default is 'unknown')
      type: string
      enum:
        - active
        - inactive
        - unknown
      default: unknown

    ErrorInfo:
      type: object
      description: Information about the error
      properties:
        status:
          type: integer
          description: HTTP status code returned along with this error response
        code:
          type: string
          description: Code given to this error
        message:
          type: string
          description: Detailed error description
      required:
        - status
        - code
        - message

    Fqdn:
      type: string
      description: |
        Full qualified domain name of an application instance

    GpuInfo:
      type: object
      description: Information about the supported GPUs
      required:
        - gpuMemory
        - numGPU
      properties:
        gpuMemory:
          type: integer
          description: GPU memory in mega bytes
        numGPU:
          type: integer
          description: Number of GPUs

    K8sAddons:
      description: |
        Addons for the Kubernetes cluster.
        Additional addons should be defined in application the helm chart
        (Service Mesh, Serverless, AI).
      type: object
      properties:
        monitoring:
          type: boolean
          example: true
          default: false
          description: Enable monitoring for Kubernetes cluster.
        ingress:
          type: boolean
          example: true
          default: false
          description: Enable ingress for Kubernetes cluster.

    K8sNetworking:
      description: |
        Kubernetes networking definition
      type: object
      properties:
        primaryNetwork:
          description: Definition of Kubernetes primary Network
          type: object
          properties:
            provider:
              description: CNI provider name
              type: string
              example: cilium
            version:
              description: CNI provider version
              type: string
              example: "1.13"
        additionalNetworks:
          description: Additional Networks for the Kubernetes cluster.
          type: array
          items:
            type: object
            description: Additional network interface definition
            properties:
              name:
                description: Additional Network Name
                type: string
                example: net1
              interfaceType:
                description: |
                  Type of additional Interface:
                  netdevice: (SR-IOV) A regular kernel network device in the
                             Network Namespace (netns) of the container
                  vfio-pci: (SR-IOV) A PCI network interface directly mounted
                            in the container
                  interface: Additional interface to be used by cni plugins
                             such as macvlan, ipvlan
                  Note: The use of SR-IOV interfaces automatically
                  configure the required kernel parameters for the nodes.
                type: string
                example: vfio-pci
                enum:
                  - netdevice
                  - vfio-pci
                  - interface

    AdditionalStorage:
      description: Additional storage for the application.
      type: array
      items:
        type: object
        required:
          - storageSize
          - mountPoint
        properties:
          name:
            type: string
            description: Name of additional storage resource.
            example: logs
          storageSize:
            type: string
            description: Additional persistent volume for the application.
            example: 80GB
            pattern: ^\d+(GB|MB)$
          mountPoint:
            type: string
            description: Location of additional storage resource.
            example: /logs

    Vcpu:
      type: string
      pattern: ^\d+((\.\d{1,3})|(m))?$
      description: |
        Number of vcpus in whole (i.e 1), decimal (i.e 0.500) up to
        millivcpu, or millivcpu (i.e 500m) format.
      example: "500m"

    KubernetesClusterRef:
      description: |
        A global unique identifier associated with a Kubernetes cluster
        infrastructure.
      type: string
      format: uuid
      example: "642f6105-7015-4af1-a4d1-e1ecb8437abc"

    KubernetesNodePool:
      description: |
        A Kubernetes node pool is a set of Kubernetes nodes that have the
        same configuration (vCPU, memory, networking, OS, etc) on each node.
      required:
        - name
        - numNodes
        - nodeResources
        - scalable
      properties:
        name:
          description: Human readable name of the Kubernetes Node Pool.
          type: string
        numNodes:
          description: Number of nodes in the Node Pool.
          type: integer
        scalable:
          description: |
            Indicates if the node pool can be dynamically scaled up by the
            system to accomodate more applications, and dynamically scaled
            down by the system when there are unused resources.
          type: boolean
          example: false
        nodeResources:
          description: Resource configuration of a node.
          type: object
          required:
            - numCPU
            - memory
          properties:
            numCPU:
              description: |
                Number of whole vcpus for the node.
              type: integer
              example: 2
            memory:
              description: |
                Amount of system memory in mega bytes for the node.
              type: integer
              example: 4096

    KubernetesResources:
      description: Definition of Kubernetes Cluster Infrastructure.
      required:
        - infraKind
        - applicationResources
        - isStandalone
      properties:
        infraKind:
          description: Type of infrastructure for the application.
          type: string
          example: kubernetes
          enum:
            - kubernetes
        applicationResources:
          description: |
            Application resources define the resources pool required
            by the application to be executed in a Kubernetes clusters.
          type: object
          properties:
            cpuPool:
              required:
                - numCPU
                - memory
                - topology
              type: object
              description: |
                CPU Pool refers to the amount of application' resources
                that is executed in nodes with CPU only. That means the part
                of application that doesn't require GPU or other kind of
                acceleration.
                CPU pool is not mandatory when the application is executed
                exclusively in a GPU pool.
                A CPU pool is composed by CPU and memory.
              properties:
                numCPU:
                  description: |
                    Total number of vcpus in whole (i.e 1) of CPU pool.
                  type: integer
                  example: 1
                memory:
                  description: Total memory in mega bytes of CPU pool.
                  type: integer
                  example: 1024
                topology:
                  type: object
                  description: |
                    CPU pool topology defines an application's CPU-based
                    architecture.
                    When deploying for high availability or redundancy, it
                    allows for clustering with a configurable number of nodes
                    and minimum CPU/memory resource per Kubernetes node
                    requirements.
                  required:
                    - minNumberOfNodes
                    - minNodeCpu
                    - minNodeMemory
                  properties:
                    minNumberOfNodes:
                      description: |
                        Minimum number of worker nodes required by the
                        application.
                      type: integer
                      example: 5
                    minNodeCpu:
                      description: |
                        Minimum number of vcpus in whole (i.e 1) per cluster
                        node in CPU pool.
                      type: integer
                      example: 2
                    minNodeMemory:
                      description: |
                        Minimum memory in mega bytes per cluster node in
                        CPU pool.
                      type: integer
                      example: 1024
            gpuPool:
              required:
                - numCPU
                - memory
                - gpuMemory
                - topology
              type: object
              description: |
                GPU Pool refers to the amount of resources of the application
                that is executed in nodes with GPU.
                GPU Pool is not mandatory when the application is executed
                exclusively in a CPU pool.
                A GPU pool is composed by memory, CPU and GPU memory
              properties:
                numCPU:
                  description: |
                    Total Number of vcpus in whole (i.e 1) of GPU pool.
                  type: integer
                  example: 1
                memory:
                  description: Total memory in mega bytes of GPU pool.
                  type: integer
                  example: 1024
                gpuMemory:
                  description: Total GPU memory in giga bytes of GPU pool.
                  type: integer
                  example: 16
                topology:
                  type: object
                  description: |
                    GPU pool topology defines an application's GPU-based
                    architecture.
                    When deploying for high availability or redundancy, it
                    allows for clustering with a configurable number of nodes
                    and minimum CPU/memory/GPU memory resource per Kubernetes
                    node requirements.
                  required:
                    - minNumberOfNodes
                    - minNodeCpu
                    - minNodeMemory
                    - minNodeGpuMemory
                  properties:
                    minNumberOfNodes:
                      description: |
                        Minimum number of worker nodes with GPU required by
                        the application.
                      type: integer
                      example: 2
                    minNodeCpu:
                      description: |
                        Minimum number of vcpus in whole (i.e 1) per cluster
                        node in GPU pool.
                      type: integer
                      example: 2
                    minNodeMemory:
                      description: |
                        Minimum memory in mega bytes per cluster node in
                        GPU pool.
                      type: integer
                      example: 1024
                    minNodeGpuMemory:
                      description: Minimum memory in giga bytes per cluster
                        node in GPU pool.
                      type: integer
                      example: 8
        isStandalone:
          description: |
            Define if the Kubernetes clusters can be reused by other
            applications.
          type: boolean
          example: false
        version:
          type: string
          description: Minimum Kubernetes Version.
          example: "1.29"
        additionalStorage:
          type: string
          description: |
            Amount of persistent storage allocated to the Kubernetes PVC.
          example: 80GB
          pattern: ^\d+(GB|MB)$
        networking:
          $ref: '#/components/schemas/K8sNetworking'
        addons:
          $ref: '#/components/schemas/K8sAddons'

    VmResources:
      description: Definition of Virtual Machine Infrastructure
      type: object
      required:
        - infraKind
        - numCPU
        - memory
      properties:
        infraKind:
          description: Type of infrastructure for the application.
          type: string
          example: virtualMachine
          enum:
            - virtualMachine
        numCPU:
          type: integer
          description: |
            Number of vcpus in whole (i.e 1)
          example: 1
        memory:
          type: integer
          example: 1024
          description: Memory in mega bytes
        additionalStorages:
          $ref: '#/components/schemas/AdditionalStorage'
        gpu:
          $ref: '#/components/schemas/GpuInfo'

    DockerComposeResources:
      description: Definition of Docker Compose Infrastructure
      type: object
      required:
        - infraKind
        - numCPU
        - memory
      properties:
        infraKind:
          description: Type of infrastructure for the application.
          type: string
          example: dockerCompose
          enum:
            - dockerCompose
        numCPU:
          type: integer
          description: |
            Number of vcpus in whole (i.e 1)
          example: 1
        memory:
          type: integer
          example: 1024
          description: Memory in mega bytes
        storage:
          $ref: '#/components/schemas/AdditionalStorage'
        gpu:
          $ref: '#/components/schemas/GpuInfo'

    ContainerResources:
      description: Container Infrastructure Definition
      type: object
      required:
        - infraKind
        - numCPU
        - memory
      properties:
        infraKind:
          description: Type of infrastructure for the application.
          type: string
          example: container
          enum:
            - container
        numCPU:
          $ref: '#/components/schemas/Vcpu'
        memory:
          type: integer
          example: 1024
          description: Memory in mega bytes
        storage:
          $ref: '#/components/schemas/AdditionalStorage'
        gpu:
          $ref: '#/components/schemas/GpuInfo'

    Ipv4Addr:
      type: string
      format: ipv4
      example: "192.168.0.1"
      description: |
        IP of the device. A single IPv4 address may be specified in
        dotted-quad form 1.2.3.4. Only this exact IP number will match the flow
        control rule.

    Ipv6Addr:
      type: string
      format: ipv6
      example: "2001:db8:85a3:8d3:1319:8a2e:370:7344"
      description: |
        IP of the device. A single IPv6 address, following IETF 5952
        format, may be specified like 2001:db8:85a3:8d3:1319:8a2e:370:7344

    OperatingSystem:
      description: |
        Information about the Operating System of the application image
      type: object
      required:
        - architecture
        - family
        - version
        - license
      properties:
        architecture:
          description: Type of the OS Architecture
          type: string
          enum:
            - x86_64
            - x86
          example: x86_64
        family:
          description: Family to which OS belongs
          type: string
          enum:
            - RHEL
            - UBUNTU
            - COREOS
            - WINDOWS
            - OTHER
        version:
          description: Version of the OS
          type: string
          enum:
            - OS_VERSION_UBUNTU_2204_LTS
            - OS_VERSION_RHEL_8
            - OS_MS_WINDOWS_2022
            - OTHER
        license:
          description: License needed to activate the OS
          type: string
          enum:
            - OS_LICENSE_TYPE_FREE
            - OS_LICENSE_TYPE_ON_DEMAND
            - OTHER

    Port:
      type: integer
      description: Port to stablish the connection
      minimum: 0

    RequiredResources:
      description: |
        Fundamental hardware requirements to be provisioned by the
        Application Provider.
      oneOf:
        - $ref: "#/components/schemas/KubernetesResources"
        - $ref: "#/components/schemas/VmResources"
        - $ref: "#/components/schemas/ContainerResources"
        - $ref: "#/components/schemas/DockerComposeResources"
      discriminator:
        propertyName: infraKind
        mapping:
          kubernetes: "#/components/schemas/KubernetesResources"
          virtualMachine: "#/components/schemas/VmResources"
          container: "#/components/schemas/ContainerResources"
          dockerCompose: "#/components/schemas/DockerComposeResources"

    SubmittedApp:
      description: Information about the submitted app
      type: object
      properties:
        appId:
          $ref: '#/components/schemas/AppId'

    Uri:
      type: string
      example: https://charts.bitnami.com/bitnami/helm/example-chart:0.1.0
      description: |
        A Uniform Resource Identifier (URI) as per RFC 3986,
        identifies the endpoint within an Edge Cloud Zone where the user
        equipment may connect to the selected application instance

  responses:
    '400':
      description: Bad request
      headers:
        x-correlator:
          $ref: "#/components/headers/x-correlator"
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorInfo'
          example:
            status: 400
            code: INVALID_ARGUMENT
            message: "Schema validation failed at  ..."
    '401':
      description: Unauthorized
      headers:
        x-correlator:
          $ref: "#/components/headers/x-correlator"
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorInfo'
          example:
            status: 401
            code: UNAUTHENTICATED
            message: "Authorization failed: ..."
    '403':
      description: Unauthorized
      headers:
        x-correlator:
          $ref: "#/components/headers/x-correlator"
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorInfo'
          example:
            status: 403
            code: PERMISSION_DENIED
            message: "Operation not allowed: ..."
    '404':
      description: Not Found
      headers:
        x-correlator:
          $ref: "#/components/headers/x-correlator"
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorInfo'
          example:
            status: 404
            code: NOT_FOUND
            message: "Resource does not exist"
    '410':
      description: Gone
      headers:
        x-correlator:
          $ref: "#/components/headers/x-correlator"
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorInfo'
          example:
            status: 410
            code: GONE
            message: "The resource has been permanently removed"
    '500':
      description: Internal Server Error
      headers:
        x-correlator:
          $ref: "#/components/headers/x-correlator"
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorInfo'
          example:
            status: 500
            code: INTERNAL
            message: "Internal server error: ..."
    '501':
      description: Not Implemented
      headers:
        x-correlator:
          $ref: "#/components/headers/x-correlator"
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorInfo'
          example:
            status: 501
            code: NOT_IMPLEMENTED
            message: "Service not implemented"
    '503':
      description: Service Unavailable
      headers:
        x-correlator:
          $ref: "#/components/headers/x-correlator"
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorInfo'
          example:
            status: 503
            code: UNAVAILABLE
            message: "Service unavailable"