BwManagementApi.yaml 16.4 KB
Newer Older
1
openapi: 3.0.2
2
info:
3
  description: The ETSI MEC ISG MEC015 Bandwidth Management API described using OpenAPI
4 5
  version: 1.1.1
  title: BWM API
6
  license:
7
    name: ETSI Forge copyright notice
8 9 10
    url: https://forge.etsi.org/etsi-forge-copyright-notice.txt
  contact:
    email: cti_support@etsi.org
11
externalDocs:
12
  description: ETSI MEC015 V1.1.1 Bandwidth Management API
13 14 15 16
  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
17 18 19
security:
  - OauthSecurity:
      - all
20 21 22
tags:
  - name: BandwithAllocation
  - name: BandwithAllocations
23
paths:
24
  '/bw_allocations':
25 26
    get:
      description: >-
27 28 29
        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.
30
      parameters:
31 32 33 34 35 36
        - $ref: "#/components/parameters/Query.AppInstanceId"
        - $ref: "#/components/parameters/Query.AppName"
        - $ref: "#/components/parameters/Query.SessionId"
      operationId: BandwithAllocations_GET
      tags:
        - BandwithAllocations
37 38
      responses:
        '200':
39
          $ref: '#/components/responses/BandwithAllocations'
40
        '400':
41
          $ref: '#/components/responses/Error.400'
42
        '403':
43
          $ref: '#/components/responses/Error.403'
44
        '404':
45
          $ref: '#/components/responses/Error.404'
46 47 48
    post:
      description: >-
        This method is used to create a bandwidthAllocation resource.
49 50 51 52 53
      requestBody:
        $ref: "#/components/requestBodies/BwInfo"
      operationId: BandwithAllocations_POST
      tags:
        - BandwithAllocations
54 55
      responses:
        '201':
56
          $ref: '#/components/responses/BandwithAllocation.201'
57
        '400':
58
          $ref: '#/components/responses/Error.400'
59
        '403':
60
          $ref: '#/components/responses/Error.403'
61
        '404':
62 63 64 65
          $ref: '#/components/responses/Error.404'
  '/bw_allocations/{allocationId}':
    parameters:
      - $ref: "#/components/parameters/Path.AllocationId"
66
    get:
67 68 69 70 71 72
      description: >- 
        This method retrieves information about a specific bandwidthAllocation
        resource.
      operationId: BandwithAllocation_GET
      tags:
        - BandwithAllocation
73 74
      responses:
        '200':
75
          $ref: '#/components/responses/BandwithAllocation'
76
        '400':
77
          $ref: '#/components/responses/Error.400'
78
        '403':
79
          $ref: '#/components/responses/Error.403'
80
        '404':
81
          $ref: '#/components/responses/Error.404'
82 83
    put:
      description: >-
84 85 86 87 88 89 90
        This method updates the information about a specific
        bandwidthAllocation resource.
      requestBody:
        $ref: "#/components/requestBodies/BwInfo"
      operationId: BandwithAllocation_PUT
      tags:
        - BandwithAllocation
91 92
      responses:
        '200':
93
          $ref: '#/components/responses/BandwithAllocation'
94
        '400':
95
          $ref: '#/components/responses/Error.400'
96
        '403':
97
          $ref: '#/components/responses/Error.403'
98
        '404':
99
          $ref: '#/components/responses/Error.404'
100
        '412':
101
          $ref: '#/components/responses/Error.412'
102 103
    patch:
      description: >-
104 105 106 107 108 109 110
        This method updates the information about a specific
        bandwidthAllocation resource.
      requestBody:
        $ref: '#/components/requestBodies/BwInfoDeltas'
      operationId: BandwithAllocation_PAT
      tags:
        - BandwithAllocation
111 112
      responses:
        '200':
113
          $ref: '#/components/responses/BandwithAllocation'
114
        '400':
115
          $ref: '#/components/responses/Error.400'
116
        '403':
117
          $ref: '#/components/responses/Error.403'
118
        '404':
119
          $ref: '#/components/responses/Error.404'
120
        '412':
121
          $ref: '#/components/responses/Error.412'
122
    delete:
123 124 125 126 127 128 129
      description: >-
        Remove a specific bandwidthAllocation resource. DELETE method is
        typically used in "Unregister from Bandwidth Management Service"
        procedure
      operationId: BandwithAllocation_DEL
      tags:
        - BandwithAllocation
130 131 132 133
      responses:
        '204':
          description: No Content
        '403':
134
          $ref: '#/components/responses/Error.403'
135
        '404':
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310
          $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:
311
          schema:
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372
            $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
373
      type: object
374 375 376 377 378
      required:
        - appInsId
        - requestType
        - fixedAllocation
        - allocationDirection
379
      properties:
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481
        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)
482
      type: string
483 484 485 486 487 488 489
    SourcePort:
      description: Source port identity of session
      type: array
      items:
        type: string
    DstAddress:
      description: Destination address identity of session (including range)
490
      type: string
491 492 493 494 495 496 497 498
    DstPort:
      description: Destination port identity of session
      type: array
      items:
        type: string
    Protocol:
      description: Protocol number
      type: string