diff --git a/code/API_definitions/network-slice-assignment.yaml b/code/API_definitions/network-slice-assignment.yaml index 961ac0c..bfd3812 100644 --- a/code/API_definitions/network-slice-assignment.yaml +++ b/code/API_definitions/network-slice-assignment.yaml @@ -66,7 +66,7 @@ tags: - name: Network Slice Assignment description: Manage Network Slice Assignment paths: - /slices/devices/assign: + /slices/{sliceId}/devices: post: tags: - Network Slice Assignment @@ -85,8 +85,9 @@ paths: operationId: assignDevice security: - openId: - - network-slice-assignment:devices:create + - network-slice-assignment:devices:assign parameters: + - $ref: "#/components/parameters/sliceId" - $ref: "#/components/parameters/x-correlator" requestBody: description: Parameters to assign a device to a network slice @@ -175,13 +176,50 @@ paths: "429": $ref: "#/components/responses/Generic429" - /slices/devices/release: + get: + tags: + - Network Slice Assignment + summary: Get devices assigned to a network slice + description: | + Get information about devices assigned to an existing network slice. + operationId: getDevices + security: + - openId: + - network-slice-assignment:devices:get + parameters: + - $ref: "#/components/parameters/sliceId" + - $ref: "#/components/parameters/x-correlator" + responses: + "200": + description: Contains information about active slice + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + $ref: "#/components/schemas/SliceDevices" + examples: + GET_DEVICES_SUCCESSFUL: + $ref: "#/components/examples/GET_DEVICES_SUCCESSFUL" + "400": + $ref: "#/components/responses/Generic400" + "401": + $ref: "#/components/responses/Generic401" + "403": + $ref: "#/components/responses/Generic403" + "404": + $ref: "#/components/responses/Generic404" + "429": + $ref: "#/components/responses/Generic429" + + /slices/{sliceId}/release: post: tags: - Network Slice Assignment summary: Release a device from an existing network slice description: | - Unbind a device to an existing network slice. + Release a device from an existing network slice. - If the release operation is successful, the response will indicate the status as `SUCCESS` with statusInfo as `RELEASE_COMPLETED`. - If the device is not assigned to the slice, the response will indicate the status as `FAILURE` with statusInfo as `DEVICE_ALREADY_RELEASED`. @@ -194,6 +232,7 @@ paths: - openId: - network-slice-assignment:devices:delete parameters: + - $ref: "#/components/parameters/sliceId" - $ref: "#/components/parameters/x-correlator" requestBody: description: Parameters to release a device from a network slice @@ -239,54 +278,11 @@ paths: "429": $ref: "#/components/responses/Generic429" - /slices/devices/get/{sliceId}: - get: - tags: - - Network Slice Assignment - summary: Get devices assigned to a network slice - description: | - Get information about devices assigned to an existing network slice. - operationId: getDevices - security: - - openId: - - network-slice-assignment:devices:get - parameters: - - name: sliceId - in: path - description: Slice ID that was obtained from the createSlice operation - required: true - schema: - $ref: "#/components/schemas/SliceId" - - $ref: "#/components/parameters/x-correlator" - responses: - "200": - description: Contains information about active slice - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - $ref: "#/components/schemas/SliceDevice" - examples: - GET_DEVICES_SUCCESSFUL: - $ref: "#/components/examples/GET_DEVICES_SUCCESSFUL" - "400": - $ref: "#/components/responses/Generic400" - "401": - $ref: "#/components/responses/Generic401" - "403": - $ref: "#/components/responses/Generic403" - "404": - $ref: "#/components/responses/Generic404" - "429": - $ref: "#/components/responses/Generic429" - - /slices/devices/retrieve: + /retrieve-slices: post: tags: - Network Slice Assignment - summary: Retrieve all network slices corresponds to a device + summary: Retrieve all network slices by device description: | Retrieve the list of network slices to which a device is assigned. operationId: retrieveSlicesByDevice @@ -331,8 +327,14 @@ paths: components: securitySchemes: openId: + description: OpenID Connect authentication type: openIdConnect openIdConnectUrl: https://example.com/.well-known/openid-configuration + notificationsBearerAuth: + description: Bearer authentication for notifications + type: http + scheme: bearer + bearerFormat: "{$request.body#sinkCredential.credentialType}" parameters: x-correlator: @@ -341,6 +343,13 @@ components: description: Correlation id for the different services schema: $ref: "#/components/schemas/XCorrelator" + sliceId: + name: sliceId + in: path + description: Slice ID that was obtained from the createSlice operation + required: true + schema: + $ref: "#/components/schemas/SliceId" headers: x-correlator: @@ -367,8 +376,6 @@ components: properties: device: $ref: "#/components/schemas/Device" - sliceId: - $ref: "#/components/schemas/SliceId" sink: type: string format: uri @@ -378,8 +385,6 @@ components: description: A sink credential provides authentication or authorization information necessary to enable delivery of events to a target. allOf: - $ref: "#/components/schemas/SinkCredential" - required: - - sliceId Device: description: | End-user equipment able to connect to a mobile network. Examples of devices include smartphones or IoT sensors/actuators. @@ -469,11 +474,8 @@ components: properties: device: $ref: "#/components/schemas/Device" - sliceId: - $ref: "#/components/schemas/SliceId" required: - device - - sliceId DeviceAssignmentInfo: description: | Information about the device assignment operation returned in the response. @@ -570,7 +572,7 @@ components: $ref: "#/components/schemas/SliceInfo" minItems: 0 - SliceDevice: + SliceDevices: description: Information about devices assigned to a slice type: object properties: @@ -587,15 +589,15 @@ components: SliceInfo: description: Slice related information. allOf: - - $ref: "#/components/schemas/CreateSlice" + - $ref: "#/components/schemas/SliceAttributes" - type: object properties: sliceId: $ref: "#/components/schemas/SliceId" required: - sliceId - CreateSlice: - description: Attributes required to create a slice + SliceAttributes: + description: Attributes defining the characteristics of the slice type: object properties: serviceTime: @@ -1318,7 +1320,6 @@ components: publicAddress: "84.125.93.10" publicPort: 59765 ipv6Address: "2001:db8:85a3:8d3:1319:8a2e:370:7344" - sliceId: "3fa85f64-5717-4562-b3fc-2c963f66afa6" sink: "https://endpoint.example.com/sink" sinkCredential: @@ -1332,7 +1333,6 @@ components: value: device: phoneNumber: "+123456789" - sliceId: "3fa85f64-5717-4562-b3fc-2c963f66afa6" sink: "https://endpoint.example.com/sink" sinkCredential: @@ -1400,7 +1400,6 @@ components: value: device: phoneNumber: "+123456789" - sliceId: "3fa85f64-5717-4562-b3fc-2c963f66afa6" RELEASE_DEVICE_INPUT_ALL: summary: Release device - All Identifiers description: Example of request to assign a device to a network slice using all identifiers @@ -1412,7 +1411,6 @@ components: publicAddress: "84.125.93.10" publicPort: 59765 ipv6Address: "2001:db8:85a3:8d3:1319:8a2e:370:7344" - sliceId: "3fa85f64-5717-4562-b3fc-2c963f66afa6" RELEASE_DEVICE_SUCCESSFUL: summary: Release Successful description: Example of successful response for releasing a device from a network slice request diff --git a/code/API_definitions/network-slice-booking.yaml b/code/API_definitions/network-slice-booking.yaml index 53dfa5a..593663e 100644 --- a/code/API_definitions/network-slice-booking.yaml +++ b/code/API_definitions/network-slice-booking.yaml @@ -84,7 +84,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/CreateSlice" + $ref: "#/components/schemas/SliceAttributes" examples: LOCATION_CIRCLE: $ref: "#/components/examples/RETRIEVAL_CIRCLE" @@ -249,8 +249,14 @@ paths: components: securitySchemes: openId: + description: Bearer authentication for notifications type: openIdConnect openIdConnectUrl: https://example.com/.well-known/openid-configuration + notificationsBearerAuth: + description: Bearer authentication for notifications + type: http + scheme: bearer + bearerFormat: "{$request.body#sinkCredential.credentialType}" parameters: x-correlator: @@ -279,7 +285,7 @@ components: SliceInfo: description: Slice related information. allOf: - - $ref: "#/components/schemas/CreateSlice" + - $ref: "#/components/schemas/SliceAttributes" - type: object properties: sliceId: @@ -287,8 +293,8 @@ components: required: - sliceId - CreateSlice: - description: Attributes required to create a slice + SliceAttributes: + description: Attributes defining the characteristics of the slice type: object properties: serviceTime: diff --git a/code/Test_definitions/network-slice-assignment-assign.feature b/code/Test_definitions/network-slice-assignment-assignDevice.feature similarity index 82% rename from code/Test_definitions/network-slice-assignment-assign.feature rename to code/Test_definitions/network-slice-assignment-assignDevice.feature index 905414c..f2b4244 100644 --- a/code/Test_definitions/network-slice-assignment-assign.feature +++ b/code/Test_definitions/network-slice-assignment-assignDevice.feature @@ -1,4 +1,4 @@ -Feature: CAMARA Network Slice Assignment API vwip - Operation assign +Feature: CAMARA Network Slice Assignment API vwip - Operation assignDevice # Input to be provided by the implementation to the tester # @@ -9,32 +9,32 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation assign # # References to OAS spec schemas refer to schemas specified in network-slice-assignment.yaml, version wip - Background: Common assignSlice setup + Background: Common assignDevice setup Given an environment at "apiRoot" - And the resource "/network-slice-assignment/vwip/slices/devices/assign" + And the resource "/network-slice-assignment/vwip/slices/{sliceId}/devices" And the header "Content-Type" is set to "application/json" And the header "Authorization" is set to a valid access token And the header "x-correlator" complies with the schema at "#/components/schemas/XCorrelator" # Success scenarios - @network_slice_booking_assignSlice_01_generic_success_scenario + @network_slice_booking_assignDevice_01_generic_success_scenario Scenario: Common validations for any success scenario Given a valid testing device supported by the service and slice id have already been allocated - When the request "assignSlice" is sent + When the request "assignDevice" is sent Then the response status code is 201 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" - And the response body complies with the OAS schema at "/components/schemas/AssignmentInfo" + And the response body complies with the OAS schema at "/components/schemas/DeviceAssignmentInfo" And the response property "$.sliceId" is a character string And the response property "$.device" exists only if provided in the request body and with the same value And the assigned status include in "SUCCESS" and "FAILURE" And the corresponding status prompt information - @network_slice_booking_assignSlice_02_invalid_argument_scenario + @network_slice_booking_assignDevice_02_invalid_argument_scenario Scenario: Error response for invalid argument in request body Given the request body property argument is invalid, such as illegal character and format error - When the request "assignSlice" is sent + When the request "assignDevice" is sent Then the response status code is 400 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" @@ -42,10 +42,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation assign And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" is "Client specified an invalid argument, request body or query param." - @network_slice_booking_assignSlice_03_out_of_range_scenario + @network_slice_booking_assignDevice_03_out_of_range_scenario Scenario: Error responses where the parameters in the request body are out of range Given the request body property argument are out of range, for example maxNumOfDevices is a negative integer - When the request "assignSlice" is sent + When the request "assignDevice" is sent Then the response status code is 400 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" @@ -53,11 +53,11 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation assign And the response property "$.code" is "OUT_OF_RANGE" And the response property "$.message" is "Client specified an invalid range." - @network_slice_booking_assignSlice_04_missing_authorization_scenario + @network_slice_booking_assignDevice_04_missing_authorization_scenario Scenario: Error response for no header "Authorization" Given the header "Authorization" is not sent And the request body is set to a valid request body - When the request "assignSlice" is sent + When the request "assignDevice" is sent Then the response status code is 401 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -65,10 +65,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation assign And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text - @network_slice_booking_assignSlice_05_missing_access_token_scope_scenario + @network_slice_booking_assignDevice_05_missing_access_token_scope_scenario Scenario: Missing access token scope - Given the header "Authorization" is set to an access token that does not include scope network-slice-booking:slices:assign - When the request "assignSlice" is sent + Given the header "Authorization" is set to an access token that does not include scope network-slice-assignment:devices:assign + When the request "assignDevice" is sent Then the response status code is 403 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -76,10 +76,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation assign And the response property "$.code" is "PERMISSION_DENIED" And the response property "$.message" contains a user friendly text - @network_slice_booking_assignSlice_06_server_resource_not_found_scenario + @network_slice_booking_assignDevice_06_server_resource_not_found_scenario Scenario: Error response for not found server resouce Given an correct format and existing network slice id - When the request "assignSlice" is sent + When the request "assignDevice" is sent Then the response status code is 404 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -87,10 +87,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation assign And the response property "$.code" is "NOT_FOUND" And the response property "$.message" contains a user friendly text - @network_slice_booking_assignSlice_07_business_resource_not_found_scenario + @network_slice_booking_assignDevice_07_business_resource_not_found_scenario Scenario: Error response for not found bussiness resouce Given an correct format and not existing network slice id - When the request "assignSlice" is sent + When the request "assignDevice" is sent Then the response status code is 404 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -98,10 +98,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation assign And the response property "$.code" is "IDENTIFIER_NOT_FOUND" And the response property "$.message" contains a user friendly text - @network_slice_booking_assignSlice_08_service_not_applicable_scenario + @network_slice_booking_assignDevice_08_service_not_applicable_scenario Scenario: Common validations for fail scenario of area not supported Given the correct slice id is not supported by the service - When the request "assignSlice" is sent + When the request "assignDevice" is sent Then the response status code is 422 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -109,10 +109,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation assign And the response property "$.code" is "SERVICE_NOT_APPLICABLE" And the response property "$.message" is "The service is not available for the provided identifier." - @network_slice_booking_assignSlice_09_inapposite_identifier_scenario + @network_slice_booking_assignDevice_09_inapposite_identifier_scenario Scenario: Common validations for fail scenario of inapposite identifier Given inapposite identifier or identifier is lost - When the request "assignSlice" is sent + When the request "assignDevice" is sent Then the response status code is 422 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -120,10 +120,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation assign And the response property "$.code" such as "MISSING_IDENTIFIER", "UNSUPPORTED_IDENTIFIER" and "UNNECESSARY_IDENTIFIER" And the response property "$.message" contains a user friendly text - @network_slice_booking_assignSlice_10_quota_exceeded_scenario + @network_slice_booking_assignDevice_10_quota_exceeded_scenario Scenario: Error response for quota exceeded Given the right request body property argument - When the request "assignSlice" is sent + When the request "assignDevice" is sent Then the response status code is 429 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -131,10 +131,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation assign And the response property "$.code" is "QUOTA_EXCEEDED" And the response property "$.message" is "Out of resource quota." - @network_slice_booking_assignSlice_11_too_many_requests_scenario + @network_slice_booking_assignDevice_11_too_many_requests_scenario Scenario: Error response for too many requests Given the right request body property argument - When the request "assignSlice" is sent + When the request "assignDevice" is sent Then the response status code is 429 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" diff --git a/code/Test_definitions/network-slice-assignment-get.feature b/code/Test_definitions/network-slice-assignment-getDevices.feature similarity index 83% rename from code/Test_definitions/network-slice-assignment-get.feature rename to code/Test_definitions/network-slice-assignment-getDevices.feature index 8f2f318..d6b5020 100644 --- a/code/Test_definitions/network-slice-assignment-get.feature +++ b/code/Test_definitions/network-slice-assignment-getDevices.feature @@ -1,4 +1,4 @@ -Feature: CAMARA Network Slice Assignment API vwip - Operation get +Feature: CAMARA Network Slice Assignment API vwip - Operation getDevices # Get information about devices assigned to an existing network slice. @@ -16,9 +16,9 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation get # # References to OAS spec schemas refer to schemas specified in network-slice-assignment.yaml, version wip - Background: Common getDevice setup + Background: Common getDevices setup Given an environment at "apiRoot" - And the resource "/network-slice-assignment/vwip/slices/devices/get/{sliceId}" + And the resource "/network-slice-assignment/vwip/slices/{sliceId}/devices" And the header "Content-Type" is set to "application/json" And the header "Authorization" is set to a valid access token And the header "x-correlator" complies with the schema at "#/components/schemas/XCorrelator" @@ -27,10 +27,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation get # Success scenarios - @network_slice_booking_getDevice_01_generic_success_scenario + @network_slice_booking_getDevices_01_generic_success_scenario Scenario: Query the bound devices under the slice resouce Given a slice id of a device that has already been bound - When the request "getDevice" is sent + When the request "getDevices" is sent Then the response status code is 200 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" @@ -38,10 +38,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation get And the response property "$.deviceList" is an array format that stores device information under slices And the response property "$.sliceInfo" is a json format that stores the configuration information of slice resources - @network_slice_booking_getDevice_02_invalid_argument_scenario + @network_slice_booking_getDevices_02_invalid_argument_scenario Scenario: Error response for invalid argument in request body Given the request body property argument is invalid, such as illegal character and format error - When the request "getDevice" is sent + When the request "getDevices" is sent Then the response status code is 400 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" @@ -49,10 +49,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation get And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" is "Client specified an invalid argument, request body or query param." - @network_slice_booking_getDevice_03_out_of_range_scenario + @network_slice_booking_getDevices_03_out_of_range_scenario Scenario: Error responses where the parameters in the request body are out of range Given the request body property argument are out of range, for example maxNumOfDevices is a negative integer - When the request "getDevice" is sent + When the request "getDevices" is sent Then the response status code is 400 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" @@ -60,11 +60,11 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation get And the response property "$.code" is "OUT_OF_RANGE" And the response property "$.message" is "Client specified an invalid range." - @network_slice_booking_getDevice_04_missing_authorization_scenario + @network_slice_booking_getDevices_04_missing_authorization_scenario Scenario: Error response for no header "Authorization" Given the header "Authorization" is not sent And the request body is set to a valid request body - When the request "getDevice" is sent + When the request "getDevices" is sent Then the response status code is 401 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -72,10 +72,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation get And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text - @network_slice_booking_getDevice_05_missing_access_token_scope_scenario + @network_slice_booking_getDevices_05_missing_access_token_scope_scenario Scenario: Missing access token scope - Given the header "Authorization" is set to an access token that does not include scope network-slice-booking:slices:assign - When the request "getDevice" is sent + Given the header "Authorization" is set to an access token that does not include scope network-slice-assignment:devices:get + When the request "getDevices" is sent Then the response status code is 403 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -83,10 +83,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation get And the response property "$.code" is "PERMISSION_DENIED" And the response property "$.message" contains a user friendly text - @network_slice_booking_getDevice_06_server_resource_not_found_scenario + @network_slice_booking_getDevices_06_server_resource_not_found_scenario Scenario: Error response for not found server resouce Given an correct format and existing network slice id - When the request "getDevice" is sent + When the request "getDevices" is sent Then the response status code is 404 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -94,10 +94,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation get And the response property "$.code" is "NOT_FOUND" And the response property "$.message" contains a user friendly text - @network_slice_booking_getDevice_07_business_resource_not_found_scenario + @network_slice_booking_getDevices_07_business_resource_not_found_scenario Scenario: Error response for not found bussiness resouce Given an correct format and not existing network slice id - When the request "getDevice" is sent + When the request "getDevices" is sent Then the response status code is 404 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -105,10 +105,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation get And the response property "$.code" is "IDENTIFIER_NOT_FOUND" And the response property "$.message" contains a user friendly text - @network_slice_booking_getDevice_08_service_not_applicable_scenario + @network_slice_booking_getDevices_08_service_not_applicable_scenario Scenario: Common validations for fail scenario of area not supported Given the correct slice id is not supported by the service - When the request "getDevice" is sent + When the request "getDevices" is sent Then the response status code is 422 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -116,10 +116,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation get And the response property "$.code" is "SERVICE_NOT_APPLICABLE" And the response property "$.message" is "The service is not available for the provided identifier." - @network_slice_booking_getDevice_09_inapposite_identifier_scenario + @network_slice_booking_getDevices_09_inapposite_identifier_scenario Scenario: Common validations for fail scenario of inapposite identifier Given inapposite identifier or identifier is lost - When the request "getDevice" is sent + When the request "getDevices" is sent Then the response status code is 422 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -127,10 +127,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation get And the response property "$.code" such as "MISSING_IDENTIFIER", "UNSUPPORTED_IDENTIFIER" and "UNNECESSARY_IDENTIFIER" And the response property "$.message" contains a user friendly text - @network_slice_booking_getDevice_10_quota_exceeded_scenario + @network_slice_booking_getDevices_10_quota_exceeded_scenario Scenario: Error response for quota exceeded Given the right request body property argument - When the request "getDevice" is sent + When the request "getDevices" is sent Then the response status code is 429 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -138,10 +138,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation get And the response property "$.code" is "QUOTA_EXCEEDED" And the response property "$.message" is "Out of resource quota." - @network_slice_booking_getDevice_11_too_many_requests_scenario + @network_slice_booking_getDevices_11_too_many_requests_scenario Scenario: Error response for too many requests Given the right request body property argument - When the request "getDevice" is sent + When the request "getDevices" is sent Then the response status code is 429 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" diff --git a/code/Test_definitions/network-slice-assignment-release.feature b/code/Test_definitions/network-slice-assignment-releaseDevice.feature similarity index 80% rename from code/Test_definitions/network-slice-assignment-release.feature rename to code/Test_definitions/network-slice-assignment-releaseDevice.feature index d30f6a1..8d40f4b 100644 --- a/code/Test_definitions/network-slice-assignment-release.feature +++ b/code/Test_definitions/network-slice-assignment-releaseDevice.feature @@ -1,4 +1,4 @@ -Feature: CAMARA Network Slice Assignment API vwip - Operation release +Feature: CAMARA Network Slice Assignment API vwip - Operation releaseDevice # Input to be provided by the implementation to the tester # @@ -6,14 +6,14 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation release # * apiRoot: API root of the server URL # Testing assets: - # * The AssignmentInfo of an existing Slice assignment - # * The AssignmentInfo of an existing Slice assignment with status "AVAILABLE", and with provided values for "sink" and "sinkCredential" + # * The DeviceAssignmentInfo of an existing Slice assignment + # * The DeviceAssignmentInfo of an existing Slice assignment with status "AVAILABLE", and with provided values for "sink" and "sinkCredential" # # References to OAS spec schemas refer to schemas specified in network-slice-assignment.yaml, version wip - Background: Common releaseSlice setup + Background: Common releaseDevice setup Given an environment at "apiRoot" - And the resource "/network-slice-assignment/vwip/slices/devices/release" + And the resource "/network-slice-assignment/vwip/slices/{sliceId}/release" And the header "Content-Type" is set to "application/json" And the header "Authorization" is set to a valid access token And the header "x-correlator" complies with the schema at "#/components/schemas/XCorrelator" @@ -22,10 +22,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation release # Success scenarios - @network_slice_booking_releaseSlice_01_generic_success_scenario + @network_slice_booking_releaseDevice_01_generic_success_scenario Scenario: Release the slice resources that have been allocated to the device Given a valid testing device that has been allocated slices - When the request "releaseSlice" is sent + When the request "releaseDevice" is sent Then the response status code is 201 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" @@ -34,10 +34,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation release And the response property "$.status" include in "SUCCESS" and "FAILURE" And the response property "$.statusInfo" contains a user friendly text - @network_slice_booking_releaseSlice_02_invalid_argument_scenario + @network_slice_booking_releaseDevice_02_invalid_argument_scenario Scenario: Error response for invalid argument in request body Given the request body property argument is invalid, such as illegal character and format error - When the request "releaseSlice" is sent + When the request "releaseDevice" is sent Then the response status code is 400 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" @@ -45,10 +45,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation release And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" is "Client specified an invalid argument, request body or query param." - @network_slice_booking_releaseSlice_03_out_of_range_scenario + @network_slice_booking_releaseDevice_03_out_of_range_scenario Scenario: Error responses where the parameters in the request body are out of range Given the request body property argument are out of range, for example maxNumOfDevices is a negative integer - When the request "releaseSlice" is sent + When the request "releaseDevice" is sent Then the response status code is 400 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" @@ -56,11 +56,11 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation release And the response property "$.code" is "OUT_OF_RANGE" And the response property "$.message" is "Client specified an invalid range." - @network_slice_booking_releaseSlice_04_missing_authorization_scenario + @network_slice_booking_releaseDevice_04_missing_authorization_scenario Scenario: Error response for no header "Authorization" Given the header "Authorization" is not sent And the request body is set to a valid request body - When the request "releaseSlice" is sent + When the request "releaseDevice" is sent Then the response status code is 401 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -68,10 +68,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation release And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text - @network_slice_booking_releaseSlice_05_missing_access_token_scope_scenario + @network_slice_booking_releaseDevice_05_missing_access_token_scope_scenario Scenario: Missing access token scope - Given the header "Authorization" is set to an access token that does not include scope network-slice-booking:slices:assign - When the request "releaseSlice" is sent + Given the header "Authorization" is set to an access token that does not include scope network-slice-assignment:devices:delete + When the request "releaseDevice" is sent Then the response status code is 403 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -79,10 +79,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation release And the response property "$.code" is "PERMISSION_DENIED" And the response property "$.message" contains a user friendly text - @network_slice_booking_releaseSlice_06_server_resource_not_found_scenario + @network_slice_booking_releaseDevice_06_server_resource_not_found_scenario Scenario: Error response for not found server resouce Given an correct format and existing network slice id - When the request "releaseSlice" is sent + When the request "releaseDevice" is sent Then the response status code is 404 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -90,10 +90,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation release And the response property "$.code" is "NOT_FOUND" And the response property "$.message" contains a user friendly text - @network_slice_booking_releaseSlice_07_business_resource_not_found_scenario + @network_slice_booking_releaseDevice_07_business_resource_not_found_scenario Scenario: Error response for not found bussiness resouce Given an correct format and not existing network slice id - When the request "releaseSlice" is sent + When the request "releaseDevice" is sent Then the response status code is 404 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -101,10 +101,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation release And the response property "$.code" is "IDENTIFIER_NOT_FOUND" And the response property "$.message" contains a user friendly text - @network_slice_booking_releaseSlice_08_service_not_applicable_scenario + @network_slice_booking_releaseDevice_08_service_not_applicable_scenario Scenario: Common validations for fail scenario of area not supported Given the correct slice id is not supported by the service - When the request "releaseSlice" is sent + When the request "releaseDevice" is sent Then the response status code is 422 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -112,10 +112,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation release And the response property "$.code" is "SERVICE_NOT_APPLICABLE" And the response property "$.message" is "The service is not available for the provided identifier." - @network_slice_booking_releaseSlice_09_inapposite_identifier_scenario + @network_slice_booking_releaseDevice_09_inapposite_identifier_scenario Scenario: Common validations for fail scenario of inapposite identifier Given inapposite identifier or identifier is lost - When the request "releaseSlice" is sent + When the request "releaseDevice" is sent Then the response status code is 422 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -123,10 +123,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation release And the response property "$.code" such as "MISSING_IDENTIFIER", "UNSUPPORTED_IDENTIFIER" and "UNNECESSARY_IDENTIFIER" And the response property "$.message" contains a user friendly text - @network_slice_booking_releaseSlice_10_quota_exceeded_scenario + @network_slice_booking_releaseDevice_10_quota_exceeded_scenario Scenario: Error response for quota exceeded Given the right request body property argument - When the request "releaseSlice" is sent + When the request "releaseDevice" is sent Then the response status code is 429 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -134,10 +134,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation release And the response property "$.code" is "QUOTA_EXCEEDED" And the response property "$.message" is "Out of resource quota." - @network_slice_booking_releaseSlice_11_too_many_requests_scenario + @network_slice_booking_releaseDevice_11_too_many_requests_scenario Scenario: Error response for too many requests Given the right request body property argument - When the request "releaseSlice" is sent + When the request "releaseDevice" is sent Then the response status code is 429 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" diff --git a/code/Test_definitions/network-slice-assignment-retrieve.feature b/code/Test_definitions/network-slice-assignment-retrieveSlicesByDevice.feature similarity index 80% rename from code/Test_definitions/network-slice-assignment-retrieve.feature rename to code/Test_definitions/network-slice-assignment-retrieveSlicesByDevice.feature index a0750bd..e4035c1 100644 --- a/code/Test_definitions/network-slice-assignment-retrieve.feature +++ b/code/Test_definitions/network-slice-assignment-retrieveSlicesByDevice.feature @@ -1,4 +1,4 @@ -Feature: CAMARA Network Slice Assignment API vwip - Operation retrieve +Feature: CAMARA Network Slice Assignment API vwip - Operation retrieveSlicesByDevice # Retrieve the list of network slices to which a device is assigned. @@ -16,9 +16,9 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation retrieve # # References to OAS spec schemas refer to schemas specified in network-slice-assignment.yaml, version wip - Background: Common retrieveSlice setup + Background: Common retrieveSlicesByDevice setup Given an environment at "apiRoot" - And the resource "/network-slice-assignment/vwip/slices/devices/retrieve" + And the resource "/network-slice-assignment/vwip/retrieve-slices" And the header "Content-Type" is set to "application/json" And the header "Authorization" is set to a valid access token And the header "x-correlator" complies with the schema at "#/components/schemas/XCorrelator" @@ -27,19 +27,19 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation retrieve # Success scenarios - @network_slice_booking_retrieveSlice_01_generic_success_scenario + @network_slice_booking_retrieveSlicesByDevice_01_generic_success_scenario Scenario: Retrieve the slice information bound to the device Given a valid testing device that has been allocated slices - When the request "retrieveSlice" is sent + When the request "retrieveSlicesByDevice" is sent Then the response status code is 200 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" And the response property "$.sliceList" is an array, with each element including the slice id, service area, service time, and slice configuration information - @network_slice_booking_retrieveSlice_02_invalid_argument_scenario + @network_slice_booking_retrieveSlicesByDevice_02_invalid_argument_scenario Scenario: Error response for invalid argument in request body Given the request body property argument is invalid, such as illegal character and format error - When the request "retrieveSlice" is sent + When the request "retrieveSlicesByDevice" is sent Then the response status code is 400 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" @@ -47,10 +47,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation retrieve And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" is "Client specified an invalid argument, request body or query param." - @network_slice_booking_retrieveSlice_03_out_of_range_scenario + @network_slice_booking_retrieveSlicesByDevice_03_out_of_range_scenario Scenario: Error responses where the parameters in the request body are out of range Given the request body property argument are out of range, for example maxNumOfDevices is a negative integer - When the request "retrieveSlice" is sent + When the request "retrieveSlicesByDevice" is sent Then the response status code is 400 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" @@ -58,11 +58,11 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation retrieve And the response property "$.code" is "OUT_OF_RANGE" And the response property "$.message" is "Client specified an invalid range." - @network_slice_booking_retrieveSlice_04_missing_authorization_scenario + @network_slice_booking_retrieveSlicesByDevice_04_missing_authorization_scenario Scenario: Error response for no header "Authorization" Given the header "Authorization" is not sent And the request body is set to a valid request body - When the request "retrieveSlice" is sent + When the request "retrieveSlicesByDevice" is sent Then the response status code is 401 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -70,10 +70,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation retrieve And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text - @network_slice_booking_retrieveSlice_05_missing_access_token_scope_scenario + @network_slice_booking_retrieveSlicesByDevice_05_missing_access_token_scope_scenario Scenario: Missing access token scope - Given the header "Authorization" is set to an access token that does not include scope network-slice-booking:slices:assign - When the request "retrieveSlice" is sent + Given the header "Authorization" is set to an access token that does not include scope network-slice-assignment:devices:retrieve + When the request "retrieveSlicesByDevice" is sent Then the response status code is 403 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -81,10 +81,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation retrieve And the response property "$.code" is "PERMISSION_DENIED" And the response property "$.message" contains a user friendly text - @network_slice_booking_retrieveSlice_06_server_resource_not_found_scenario + @network_slice_booking_retrieveSlicesByDevice_06_server_resource_not_found_scenario Scenario: Error response for not found server resouce Given an correct format and existing network slice id - When the request "retrieveSlice" is sent + When the request "retrieveSlicesByDevice" is sent Then the response status code is 404 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -92,10 +92,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation retrieve And the response property "$.code" is "NOT_FOUND" And the response property "$.message" contains a user friendly text - @network_slice_booking_retrieveSlice_07_business_resource_not_found_scenario + @network_slice_booking_retrieveSlicesByDevice_07_business_resource_not_found_scenario Scenario: Error response for not found bussiness resouce Given an correct format and not existing network slice id - When the request "retrieveSlice" is sent + When the request "retrieveSlicesByDevice" is sent Then the response status code is 404 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -103,10 +103,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation retrieve And the response property "$.code" is "IDENTIFIER_NOT_FOUND" And the response property "$.message" contains a user friendly text - @network_slice_booking_retrieveSlice_08_service_not_applicable_scenario + @network_slice_booking_retrieveSlicesByDevice_08_service_not_applicable_scenario Scenario: Common validations for fail scenario of area not supported Given the correct slice id is not supported by the service - When the request "retrieveSlice" is sent + When the request "retrieveSlicesByDevice" is sent Then the response status code is 422 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -114,10 +114,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation retrieve And the response property "$.code" is "SERVICE_NOT_APPLICABLE" And the response property "$.message" is "The service is not available for the provided identifier." - @network_slice_booking_retrieveSlice_09_inapposite_identifier_scenario + @network_slice_booking_retrieveSlicesByDevice_09_inapposite_identifier_scenario Scenario: Common validations for fail scenario of inapposite identifier Given inapposite identifier or identifier is lost - When the request "retrieveSlice" is sent + When the request "retrieveSlicesByDevice" is sent Then the response status code is 422 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -125,10 +125,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation retrieve And the response property "$.code" such as "MISSING_IDENTIFIER", "UNSUPPORTED_IDENTIFIER" and "UNNECESSARY_IDENTIFIER" And the response property "$.message" contains a user friendly text - @network_slice_booking_retrieveSlice_10_quota_exceeded_scenario + @network_slice_booking_retrieveSlicesByDevice_10_quota_exceeded_scenario Scenario: Error response for quota exceeded Given the right request body property argument - When the request "retrieveSlice" is sent + When the request "retrieveSlicesByDevice" is sent Then the response status code is 429 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -136,10 +136,10 @@ Feature: CAMARA Network Slice Assignment API vwip - Operation retrieve And the response property "$.code" is "QUOTA_EXCEEDED" And the response property "$.message" is "Out of resource quota." - @network_slice_booking_retrieveSlice_11_too_many_requests_scenario + @network_slice_booking_retrieveSlicesByDevice_11_too_many_requests_scenario Scenario: Error response for too many requests Given the right request body property argument - When the request "retrieveSlice" is sent + When the request "retrieveSlicesByDevice" is sent Then the response status code is 429 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" diff --git a/code/Test_definitions/network-slice-booking-createSession.feature b/code/Test_definitions/network-slice-booking-createSlice.feature similarity index 99% rename from code/Test_definitions/network-slice-booking-createSession.feature rename to code/Test_definitions/network-slice-booking-createSlice.feature index 2f46fad..4751340 100644 --- a/code/Test_definitions/network-slice-booking-createSession.feature +++ b/code/Test_definitions/network-slice-booking-createSlice.feature @@ -23,7 +23,7 @@ Feature: CAMARA Network Slice Booking API vwip - Operation createSlice And the header "Authorization" is set to a valid access token And the header "x-correlator" complies with the schema at "#/components/schemas/XCorrelator" # Properties not explicitly overwritten in the Scenarios can take any values compliant with the schema - And the request body is set by default to a request body compliant with the schema at "/components/schemas/CreateSlice" + And the request body is set by default to a request body compliant with the schema at "/components/schemas/SliceAttributes" # Success scenarios diff --git a/code/Test_definitions/network-slice-booking-deleteSession.feature b/code/Test_definitions/network-slice-booking-deleteSlice.feature similarity index 100% rename from code/Test_definitions/network-slice-booking-deleteSession.feature rename to code/Test_definitions/network-slice-booking-deleteSlice.feature diff --git a/code/Test_definitions/network-slice-booking-getSession.feature b/code/Test_definitions/network-slice-booking-getSlice.feature similarity index 100% rename from code/Test_definitions/network-slice-booking-getSession.feature rename to code/Test_definitions/network-slice-booking-getSlice.feature