BwManagementApi.yaml 16.4 KB
Newer Older
openapi: 3.0.2
  description: The ETSI MEC ISG MEC015 Bandwidth Management API described using OpenAPI
    url: https://forge.etsi.org/etsi-forge-copyright-notice.txt
  contact:
    email: cti_support@etsi.org
  description: ETSI MEC015 V1.1.1 Bandwidth Management API
  url: http://www.etsi.org/deliver/etsi_gs/MEC/001_099/015/01.01.01_60/gs_MEC015v010101p.pdf
servers:
  - url: http://127.0.0.1:8081/bwm/v1
  - url: https://127.0.0.1:8081/bwm/v1
security:
  - OauthSecurity:
      - all
tags:
  - name: BandwithAllocation
  - name: BandwithAllocations
  '/bw_allocations':
    get:
      description: >-
        This method retrieves information about a list of bandwidthAllocation
        resources. In queries, either "app_instance_id" or "app_name" or "session_Id" 
        or none of them shall be present.
        - $ref: "#/components/parameters/Query.AppInstanceId"
        - $ref: "#/components/parameters/Query.AppName"
        - $ref: "#/components/parameters/Query.SessionId"
      operationId: BandwithAllocations_GET
      tags:
        - BandwithAllocations
      responses:
        '200':
          $ref: '#/components/responses/BandwithAllocations'
          $ref: '#/components/responses/Error.400'
          $ref: '#/components/responses/Error.403'
          $ref: '#/components/responses/Error.404'
    post:
      description: >-
        This method is used to create a bandwidthAllocation resource.
      requestBody:
        $ref: "#/components/requestBodies/BwInfo"
      operationId: BandwithAllocations_POST
      tags:
        - BandwithAllocations
      responses:
        '201':
          $ref: '#/components/responses/BandwithAllocation.201'
          $ref: '#/components/responses/Error.400'
          $ref: '#/components/responses/Error.403'
          $ref: '#/components/responses/Error.404'
  '/bw_allocations/{allocationId}':
    parameters:
      - $ref: "#/components/parameters/Path.AllocationId"
      description: >- 
        This method retrieves information about a specific bandwidthAllocation
        resource.
      operationId: BandwithAllocation_GET
      tags:
        - BandwithAllocation
      responses:
        '200':
          $ref: '#/components/responses/BandwithAllocation'
          $ref: '#/components/responses/Error.400'
          $ref: '#/components/responses/Error.403'
          $ref: '#/components/responses/Error.404'
    put:
      description: >-
        This method updates the information about a specific
        bandwidthAllocation resource.
      requestBody:
        $ref: "#/components/requestBodies/BwInfo"
      operationId: BandwithAllocation_PUT
      tags:
        - BandwithAllocation
      responses:
        '200':
          $ref: '#/components/responses/BandwithAllocation'
          $ref: '#/components/responses/Error.400'
          $ref: '#/components/responses/Error.403'
          $ref: '#/components/responses/Error.404'
          $ref: '#/components/responses/Error.412'
    patch:
      description: >-
        This method updates the information about a specific
        bandwidthAllocation resource.
      requestBody:
        $ref: '#/components/requestBodies/BwInfoDeltas'
      operationId: BandwithAllocation_PAT
      tags:
        - BandwithAllocation
          $ref: '#/components/responses/BandwithAllocation'
          $ref: '#/components/responses/Error.400'
          $ref: '#/components/responses/Error.403'
          $ref: '#/components/responses/Error.404'
          $ref: '#/components/responses/Error.412'
      description: >-
        Remove a specific bandwidthAllocation resource. DELETE method is
        typically used in "Unregister from Bandwidth Management Service"
        procedure
      operationId: BandwithAllocation_DEL
      tags:
        - BandwithAllocation
      responses:
        '204':
          description: No Content
        '403':
          $ref: '#/components/responses/Error.403'
          $ref: '#/components/responses/Error.404'
components:
  parameters:
    Path.AllocationId:
      name: allocationId
      in: path
      description: >-
        Represents a bandwidth allocation instance
      required: true
      schema:
        type: string
    Query.AppInstanceId:
      name: app_instance_id
      in: query
      description: >-
        A MEC application instance may use multiple app_instance_ids as
        an input parameter to query the bandwidth allocation of a list of mobile
        edge application instances.
      required: false
      schema:
        type: array
        items:
          type: string
    Query.AppName:
      name: app_name
      in: query
      description: >-
        A MEC application instance may use multiple ser_names as an
        input parameter to query the bandwidth allocation of a list of mobile
        edge application instances.
      required: false
      schema:
        type: array
        items:
          type: string
    Query.SessionId:
      name: session_id
      in: query
      description: >-
        A MEC application instance may use session_id as an input
        parameter to query the bandwidth allocation of a list of sessions.
      required: false
      schema:
        type: array
        items:
          type: string
  requestBodies:
    BwInfo:
      description: >-
        Bandwidth Allocation information
      required: true
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/BwInfo"
    BwInfoDeltas:
      description: >-
        Description of the changes to instruct the server how to modify the
        Bandwidth Allocation information.
      required: true
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/BwInfoDeltas"
  links:
    GetBandwithAllocation:
      operationId: BandwithAllocation_GET
      description: The `allocationId` value returned in the response can be used as the `allocationId` parameter in 'GET .../bw_allocations/{allocationId}''
      parameters:
        description: >-
          regex = \/bwm\/v1\/bw_allocations\/(.*);
          allocationId = location.match(regex)[1];
          where "location" is the location header uri returned from operationId BandwithAllocations_POST  
        allocationId: 'TBC'
    PatBandwithAllocation:
      operationId: BandwithAllocation_PAT
      description: The `allocationId` value returned in the response can be used as the `allocationId` parameter in 'PATCH .../bw_allocations/{allocationId}''
      parameters:
        description: >-
          regex = \/bwm\/v1\/bw_allocations\/(.*);
          allocationId = location.match(regex)[1];
          where "location" is the location header uri returned from operationId BandwithAllocations_POST  
        allocationId: 'TBC'
    PutBandwithAllocation:
      operationId: BandwithAllocation_PUT
      description: The `allocationId` value returned in the response can be used as the `allocationId` parameter in 'PUT .../bw_allocations/{allocationId}''
      parameters:
        description: >-
          regex = \/bwm\/v1\/bw_allocations\/(.*);
          allocationId = location.match(regex)[1];
          where "location" is the location header uri returned from operationId BandwithAllocations_POST  
        allocationId: 'TBC'
    DelBandwithAllocation:
      operationId: BandwithAllocation_DEL
      description: The `allocationId` value returned in the response can be used as the `allocationId` parameter in 'DELETE .../bw_allocations/{allocationId}''
      parameters:
        description: >-
          regex = \/bwm\/v1\/bw_allocations\/(.*);
          allocationId = location.match(regex)[1];
          where "location" is the location header uri returned from operationId BandwithAllocations_POST  
        allocationId: 'TBC'
  responses:
    BandwithAllocation:
      description: Bandwidth Allocation.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/BwInfo"
    BandwithAllocation.201:
      description: Bandwidth Allocation.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/BwInfo"
      headers:
        location:
          description: The resource URI of the created resource
          schema:
            type: string
            format: uri
    BandwithAllocations:
      description: Bandwidth Allocations.
      content:
        application/json:
          schema:
            type: array
            minItems: 0
            items:
              $ref: "#/components/schemas/BwInfo"
      links:
        getBandwithAllocation:
          $ref: "#/components/links/GetBandwithAllocation"
        patBandwithAllocation:
          $ref: "#/components/links/PatBandwithAllocation"
        putBandwithAllocation:
          $ref: "#/components/links/PutBandwithAllocation"
        delBandwithAllocation:
          $ref: "#/components/links/DelBandwithAllocation"
    Error.400:
      description: >-
        Bad Request.
        It is used to indicate that incorrect parameters were passed to the request.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
        text/plain:
          schema:
            $ref: '#/components/schemas/Empty'
    Error.401:
      description: >-
        Unauthorized.
        It is used when the client did not submit the appropriate credentials.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
        text/plain:
          schema:
            $ref: '#/components/schemas/Empty'
    Error.403:
      description: >-
        Forbidden.
        The operation is not allowed given the current status of the resource. 
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
    Error.404:
      description: >-
        Not Found.
        It is used when a client provided a URI that cannot be mapped 
        to a valid resource URI.
      content:
        application/problem+json:
            $ref: '#/components/schemas/ProblemDetails'
        text/plain:
          schema:
            $ref: '#/components/schemas/Empty'  
    Error.412:
      description: >-
        Precondition Failed.
        It is used when a condition has failed during conditional requests, 
        e.g. when using ETags to avoid write conflicts.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
        text/plain:
          schema:
            $ref: '#/components/schemas/Empty'
  securitySchemes:
    OauthSecurity:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://oauth.exampleAPI/token
          scopes:
            all: Single oauth2 scope for API
  schemas:
    Empty:
      description: Empty schema
    ProblemDetails:
      type: object
      properties:
        type:
          $ref: "#/components/schemas/Problem.type"
        title:
          $ref: "#/components/schemas/Problem.title"
        status:
          $ref: "#/components/schemas/Problem.status"
        detail:
          $ref: "#/components/schemas/Problem.detail"
        instance:
          $ref: "#/components/schemas/Problem.instance"
    Problem.type:
      type: string
      format: uri
      description: A URI reference according to IETF RFC 3986 that identifies the problem
        type
    Problem.title:
      type: string
      description: A short, human-readable summary of the problem type
    Problem.status:
      type: integer
      format: uint32
      description: The HTTP status code for this occurrence of the problem
    Problem.detail:
      type: string
      description: A human-readable explanation specific to this occurrence of the problem
    Problem.instance:
      type: string
      format: uri
      description: A URI reference that identifies the specific occurrence of the problem
    BwInfo:
      description: information of bandwidth resource
      required:
        - appInsId
        - requestType
        - fixedAllocation
        - allocationDirection
        timeStamp:
          $ref: "#/components/schemas/TimeStamp"
        appInsId:
          $ref: "#/components/schemas/AppInsId"
        requestType:
          $ref: "#/components/schemas/RequestType"
        sessionFilter:
          $ref: "#/components/schemas/SessionFilter"
        fixedBWPriority:
          $ref: "#/components/schemas/FixedBWPriority"
        fixedAllocation:
          $ref: "#/components/schemas/FixedAllocation"
        allocationDirection:
          $ref: "#/components/schemas/AllocationDirection"
    BwInfoDeltas:
      description: Conform to JSON merge patch format and processing rules specified IETF
        RFC 7396, this type represents the attributes whose value are
        allowed to be updated with HTTP PATCH method in content format JSON
      type: object
      properties:
        appInsId:
          $ref: "#/components/schemas/AppInsId"
        requestType:
          $ref: "#/components/schemas/RequestType"
        sessionFilter:
          $ref: "#/components/schemas/SessionFilter"
        fixedBWPriority:
          $ref: "#/components/schemas/FixedBWPriority"
        fixedAllocation:
          $ref: "#/components/schemas/FixedAllocation"
        allocationDirection:
          $ref: "#/components/schemas/AllocationDirection"
    TimeStamp:
      type: object
      required:
        - seconds
        - nanoSeconds
      properties:
        seconds:
          $ref: "#/components/schemas/Seconds"
        nanoSeconds:
          $ref: "#/components/schemas/NanoSeconds"
    AppInsId:
      description: Application instance identifier
      type: string
    RequestType:
      description: Numeric value (0 - 255) corresponding to specific type of consumer
      type: string
      enum:
        - APPLICATION_SPECIFIC_BW_ALLOCATION
        - SESSION_SPECIFIC_BW_ALLOCATION
      example:
        APPLICATION_SPECIFIC_BW_ALLOCATION
    SessionFilter:
      description: Session filtering criteria, applicable when requestType is set as
        SESSION_SPECIFIC_BW_ALLOCATION. Any filtering criteria shall define a
        single session only. In case multiple sessions match sessionFilter the
        request shall be rejected
      type: array
      items:
        type: object
        properties:
          sourceIp:
            $ref: "#/components/schemas/SourceIp"
          sourcePort:
            $ref: "#/components/schemas/SourcePort"
          dstAddress:
            $ref: "#/components/schemas/DstAddress"
          dstPort:
            $ref: "#/components/schemas/DstPort"
          protocol:
            $ref: "#/components/schemas/Protocol"
    FixedBWPriority:
      description: Indicates the allocation priority when dealing with several applications
        or sessions in parallel. Values are not defined in the present document
      type: string
      enum:
        - not defined in the present document
    FixedAllocation:
      description: Size of requested fixed BW allocation in [bps]
      type: string
    AllocationDirection:
      description: The direction of the requested BW allocation
      type: string
      enum:
        - 00 = Downlink (towards the UE)
        - 01 = Uplink (towards the application/session)
        - 10 = Symmetrical
      example: 
        "00"
    Seconds:
      description: The seconds part of the Time. Time is defined as Unix-time since January
        1, 1970, 00:00:00 UTC
      type: integer
      format: uint32
    NanoSeconds:
      description: The nanoseconds part of the Time. Time is defined as Unix-time since
        January 1, 1970, 00:00:00 UTC
      type: integer
      format: uint32
    SourceIp:
      description: Source address identity of session (including range)
    SourcePort:
      description: Source port identity of session
      type: array
      items:
        type: string
    DstAddress:
      description: Destination address identity of session (including range)
    DstPort:
      description: Destination port identity of session
      type: array
      items:
        type: string
    Protocol:
      description: Protocol number
      type: string