diff --git a/code/API_definitions/NetworkSliceBooking.yaml b/code/API_definitions/NetworkSliceBooking.yaml new file mode 100644 index 0000000..ec8d08b --- /dev/null +++ b/code/API_definitions/NetworkSliceBooking.yaml @@ -0,0 +1,508 @@ +openapi: 3.0.3 +info: + title: Network Slice Booking + description: | + The Network Slice Booking (NSB) API provides programmable interface for developers to reserve a slice resource of a selected area within a period, and manage device access control as needed. + version: wip + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html +servers: + - url: "{apiRoot}/network-slice-booking/vwip" + variables: + apiRoot: + default: http://localhost:9100 + description: API root, defined by the service provider, e.g. `api.example.com` or `api.example.com/somepath` +tags: + - name: Network Slice Booking Sessions + description: Manage Network Slice Booking sessions +paths: + /sessions: + post: + tags: + - Network Slice Booking Sessions + summary: Creates a new session + operationId: createSession + requestBody: + description: Parameters to create a new session + content: + application/json: + schema: + $ref: "#/components/schemas/CreateSession" + required: true + + responses: + "201": + description: Session created + content: + application/json: + schema: + $ref: "#/components/schemas/SessionInfo" + "400": + $ref: "#/components/responses/Generic400" + "401": + $ref: "#/components/responses/Generic401" + "403": + $ref: "#/components/responses/Generic403" + "410": + $ref: "#/components/responses/Generic410" + "429": + $ref: "#/components/responses/Generic429" + "500": + $ref: "#/components/responses/Generic500" + "503": + $ref: "#/components/responses/Generic503" + + /sessions/{sessionId}: + delete: + tags: + - Network Slice Booking Sessions + summary: Delete a NSB session + description: Deleting NSB session + operationId: deleteSession + parameters: + - name: sessionId + in: path + description: Session ID that was obtained from the createSession operation + required: true + schema: + $ref: "#/components/schemas/SessionId" + responses: + "204": + description: Session deleted + "400": + $ref: "#/components/responses/Generic400" + "401": + $ref: "#/components/responses/Generic401" + "403": + $ref: "#/components/responses/Generic403" + "410": + $ref: "#/components/responses/Generic410" + "429": + $ref: "#/components/responses/Generic429" + "500": + $ref: "#/components/responses/Generic500" + "503": + $ref: "#/components/responses/Generic503" + + get: + tags: + - NSB Sessions + summary: Get NSB session information + description: Querying for NSB session resource information details + operationId: getSession + parameters: + - name: sessionId + in: path + description: Session ID that was obtained from the createSession operation + required: true + schema: + $ref: "#/components/schemas/SessionId" + responses: + "200": + description: Contains information about active session + content: + application/json: + schema: + $ref: "#/components/schemas/SessionInfo" + "400": + $ref: "#/components/responses/Generic400" + "401": + $ref: "#/components/responses/Generic401" + "403": + $ref: "#/components/responses/Generic403" + "410": + $ref: "#/components/responses/Generic410" + "429": + $ref: "#/components/responses/Generic429" + "500": + $ref: "#/components/responses/Generic500" + "503": + $ref: "#/components/responses/Generic503" + +components: + headers: + x-correlator: + description: Correlation id for the different services + schema: + type: string + schemas: + SessionId: + description: Session ID in UUID format + type: string + format: uuid + + SessionInfo: + description: Session related information. + allOf: + - $ref: "#/components/schemas/CreateSession" + - type: object + properties: + sessionId: + $ref: "#/components/schemas/SessionId" + result: + type: string + enum: + - Success + - Fail + required: + - result + + + + CreateSession: + description: Attributes required to create a session + type: object + properties: + ServiceTime: + $ref: "#/components/schemas/ServiceTime" + ServiceArea: + $ref: "#/components/schemas/Area" + QoSProfile: + $ref: "#/components/schemas/QoSProfile" + required: + - ServiceTime + - ServiceArea + - QoSProfile + + QoSProfile: + type: object + properties: + MaxNumofTerminals: + $ref: "#/components/schemas/NumberOfTerminals" + DLThroughputPerTerminal: + $ref: "#/components/schemas/Rate" + ULThroughputPerTerminal: + $ref: "#/components/schemas/Rate" + DLLatency: + description: | + DLLatency is an attribute specifies the required DL packet transmission latency (millisecond) through the 5G network. + $ref: "#/components/schemas/Duration" + ULLatency: + description: | + ULLatency is an attribute specifies the required UL packet transmission latency (millisecond) through the 5G network. + $ref: "#/components/schemas/Duration" + + + Duration: + description: Specification of duration + type: object + properties: + value: + description: Quantity of duration + type: integer + example: 12 + format: int32 + minimum: 1 + unit: + $ref: "#/components/schemas/TimeUnitEnum" + + + TimeUnitEnum: + description: Units of time + type: string + enum: + - Days + - Hours + - Minutes + - Seconds + - Milliseconds + - Microseconds + - Nanoseconds + + + Rate: + description: Specification of rate + type: object + properties: + value: + description: Quantity of rate + type: integer + example: 10 + format: int32 + minimum: 0 + maximum: 1024 + unit: + $ref: "#/components/schemas/RateUnitEnum" + + RateUnitEnum: + description: Units of rate + type: string + enum: + - bps + - kbps + - Mbps + - Gbps + - Tbps + + NumberOfTerminals: + type: integer + example: 5 + description: Number of terminals + format: int32 + minimum: 1 + maximum: 20 + + + Throughput: + type: object + properties: + min: + $ref: "#/components/schemas/Float" + max: + $ref: "#/components/schemas/Float" + + ServiceTime: + description: Attributes required to service time + type: object + properties: + StartTime: + description: Start the Slice Service From + type: string + format: date-time + example: "2024-06-01T12:00:00Z" + EndTime: + description: End the Slice Service At + type: string + format: date-time + example: "2024-06-01T12:00:00Z" + + Float: + type: number + + Area: + type: object + properties: + areaType: + $ref: "#/components/schemas/AreaType" + required: + - areaType + discriminator: + propertyName: areaType + mapping: + CIRCLE: "#/components/schemas/Circle" + POLYGON: "#/components/schemas/Polygon" + + AreaType: + type: string + description: | + Type of this area. + CIRCLE - The area is defined as a circle. + POLYGON - The area is defined as a polygon. + enum: + - CIRCLE + - POLYGON + + Circle: + description: Circular area + allOf: + - $ref: "#/components/schemas/Area" + - type: object + required: + - center + - radius + properties: + center: + $ref: "#/components/schemas/Point" + radius: + type: number + description: Distance from the center in meters + minimum: 1 + + Polygon: + allOf: + - $ref: "#/components/schemas/Area" + - type: object + required: + - boundary + properties: + boundary: + $ref: "#/components/schemas/PointList" + + PointList: + type: array + items: + $ref: "#/components/schemas/Point" + minItems: 3 + maxItems: 15 + + Point: + type: object + description: Coordinates (latitude, longitude) defining a location in a map + required: + - latitude + - longitude + properties: + latitude: + $ref: "#/components/schemas/Latitude" + longitude: + $ref: "#/components/schemas/Longitude" + example: + latitude: 31.22529 + longitude: 121.48905 + + Latitude: + description: Latitude component of a location + type: number + format: double + minimum: -90 + maximum: 90 + + Longitude: + description: Longitude component of location + type: number + format: double + minimum: -180 + maximum: 180 + + TimeStamp: + type: string + description: string with format "date-time" + + + ErrorInfo: + type: object + 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 + responses: + Generic400: + description: Bad Request + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorInfo" + examples: + GENERIC_400_INVALID_ARGUMENT: + description: Invalid Argument. Generic Syntax Exception + value: + status: 400 + code: INVALID_ARGUMENT + message: Client specified an invalid argument, request body or query param. + GENERIC_400_OUT_OF_RANGE: + description: Out of Range. Specific Syntax Exception used when a given field has a pre-defined range or a invalid filter criteria combination is requested + value: + status: 400 + code: OUT_OF_RANGE + message: Client specified an invalid range. + Generic401: + 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: ..." + + Generic403: + description: Forbidden + 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: ..." + + Generic410: + description: Gone + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorInfo" + examples: + GENERIC_410_GONE: + description: Use in notifications flow to allow API Consumer to indicate that its callback is no longer available + value: + status: 410 + code: GONE + message: Access to the target resource is no longer available. + + Generic429: + description: Too Many Requests + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorInfo" + examples: + GENERIC_429_QUOTA_EXCEEDED: + description: Request is rejected due to exceeding a business quota limit + value: + status: 429 + code: QUOTA_EXCEEDED + message: Either out of resource quota or reaching rate limiting. + GENERIC_429_TOO_MANY_REQUESTS: + description: API Server request limit is overpassed + value: + status: 429 + code: TOO_MANY_REQUESTS + message: Either out of resource quota or reaching rate limiting. + + + Generic500: + 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: ..." + + + Generic503: + 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" + + + + + + + + + +