diff --git a/SOL012/PolicyManagement-API/ApiVersion.robot b/SOL012/PolicyManagement-API/ApiVersion.robot new file mode 100644 index 0000000000000000000000000000000000000000..142232e7c72beda7b3da6291adf09b2e03181e41 --- /dev/null +++ b/SOL012/PolicyManagement-API/ApiVersion.robot @@ -0,0 +1,127 @@ +*** Settings *** +Resource environment/variables.txt +Library DependencyLibrary +Resource PolicyManagementKeywords.robot + +*** Test Cases *** +POST API Version - Method not implemented + [Documentation] Test ID: 10.3.1.1.1 + ... Test title: POST API version - Method not implemented + ... Test objective: The objective is to test that POST method is not implemented for this resource. + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.1 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + POST API Version + Check HTTP Response Status Code Is 405 + +GET API Version + [Documentation] Test ID: 10.3.1.1.2 + ... Test title: GET API Version + ... Test objective: The objective is to test that GET method successfully returns ApiVersionInformation. + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.2 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + GET API Version + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is ApiVersionInformation + +PUT API Version - Method not implemented + [Documentation] Test ID: 10.3.1.1.3 + ... Test title: PUT API Version - Method not implemented + ... Test objective: The objective is to test that PUT method is not implemented for this resource. + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.3 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + PUT API Version + Check HTTP Response Status Code Is 405 + +PATCH API Version - Method not implemented + [Documentation] Test ID: 10.3.1.1.4 + ... Test title: PATCH API Version - Method not implemented + ... Test objective: The objective is to test that PATCH method is not implemented + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.4 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + PATCH API Version + Check HTTP Response Status Code Is 405 + +DELETE API Version - Method not implemented + [Documentation] Test ID: 10.3.1.1.5 + ... Test title: DELETE API Version - Method not implemented + ... Test objective: The objective is to test that DELETE method is not implemented for this resource. + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.5 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + DELETE API Version + Check HTTP Response Status Code Is 405 + +POST API Version with apiMajorVersion - Method not implemented + [Documentation] Test ID: 10.3.1.1.6 + ... Test title: POST API version with apiMajorVersion - Method not implemented + ... Test objective: The objective is to test that POST method is not implemented. + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.1 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + POST API Version + Check HTTP Response Status Code Is 405 + +GET API Version with apiMajorVersion + [Documentation] 10.3.1.1.7 + ... Test title: GET API Version with apiMajorVersion + ... Test objective: The objective is to test that GET method successfully returns ApiVersionInformation. + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.2 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + GET API Version + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is ApiVersionInformation + +PUT API Version with apiMajorVersion - Method not implemented + [Documentation] Test ID: 10.3.1.1.8 + ... Test title: PUT API Version with apiMajorVersion - Method not implemented + ... Test objective: The objective is to test that PUT method is not implemented. + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.3 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + PUT API Version + Check HTTP Response Status Code Is 405 + +PATCH API Version with apiMajorVersion - Method not implemented + [Documentation] Test ID: 10.3.1.1.9 + ... Test title: PATCH API Version with apiMajorVersion - Method not implemented + ... Test objective: The objective is to test that PATCH method is not implemented. + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.4 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + PATCH API Version + Check HTTP Response Status Code Is 405 + +DELETE API Version with apiMajorVersion - Method not implemented + [Documentation] Test ID: 10.3.1.1.10 + ... Test title: DELETE API Version with apiMajorVersion - Method not implemented + ... Test objective: The objective is to test that DELETE method is not implemented. + ... Pre-conditions: none + ... Reference: Clause 9.3.3.3.5 - ETSI GS NFV-SOL 013 v3.3.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + DELETE API Version + Check HTTP Response Status Code Is 405 \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/IndividualPolicy.robot b/SOL012/PolicyManagement-API/IndividualPolicy.robot new file mode 100644 index 0000000000000000000000000000000000000000..7deca87f045eed83d7dac7011b1fefc8136c61a1 --- /dev/null +++ b/SOL012/PolicyManagement-API/IndividualPolicy.robot @@ -0,0 +1,108 @@ +*** Settings *** +Resource environment/variables.txt +Resource PolicyManagementKeywords.robot + +*** Test Cases *** +POST Individual Policy - Method not implemented + [Documentation] Test ID: 10.3.1.3.1 + ... Test title: POST Individual Policy - Method not implemented + ... Test objective: The objective is to test that POST method is not implemented. + ... Pre-conditions: none + ... Reference: Clause 5.5.4.3.1 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + POST Individual Policy + Check HTTP Response Status Code Is 405 + +GET Information about an individual policy - Successful + [Documentation] Test ID: 10.3.1.3.2 + ... Test title: GET Information about an individual policy - Successful + ... Test objective: The objective is to test the retrieval of Individual Policy and perform a JSON schema validation of the returned Policy data structure. + ... Pre-conditions: At least one policy is available in the NFV-MANO. + ... Reference: Clause 5.5.4.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + GET Individual Policy + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is Policy + +GET Information about an individual policy - NOT FOUND + [Documentation] Test ID: 10.3.1.3.3 + ... Test title: GET Information about an individual policy - NOT FOUND + ... Test objective: The objective is to test that the retrieval of individual policy fails when using an invalid resource identifier. + ... Pre-conditions: At least one individual policy is available in the NFV-MANO. + ... Reference: Clause 5.5.8.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + GET Individual Policy with Invalid URI + Check HTTP Response Status Code Is 404 + Check HTTP Response Body Json Schema Is ProblemDetails + +PUT an individual policy - Method not implemented + [Documentation] Test ID: 10.3.1.3.4 + ... Test title: PUT an individual policy - Method not implemented + ... Test objective: The objective is to test that PUT method is not implemented. + ... Pre-conditions: none + ... Reference: Clause 5.5.4.3.3 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + PUT Individual Policy + Check HTTP Response Status Code Is 405 + +PATCH an individual policy - Successful + [Documentation] Test ID: 10.3.1.3.5 + ... Test title: PATCH an individual policy - Successful + ... Test objective: The objective is to test that an individual policy is modified successfully when there is no conflict using PATCH method. + ... Pre-conditions: There should not exist a conflict as described in Reference. + ... Reference: Clause 5.5.4.3.4 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + PATCH Individual Policy + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is PolicyModifications + +PATCH an individual policy - Conflict + [Documentation] Test ID: 10.3.1.3.6 + ... Test title: PATCH an individual policy - Conflict + ... Test objective: The objective is to test that an individual policy is not modified when there is a conflict using PATCH method. + ... Pre-conditions: There exists a conflict as described in Reference. + ... Reference: Clause 5.5.4.3.4 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + PATCH Individual Policy + Check HTTP Response Status Code Is 409 + Check HTTP Response Body Json Schema Is ProblemDetails + + +DELETE an individual policy - Successful + [Documentation] Test ID: 10.3.1.3.7 + ... Test title: DELETE an individual policy - Successful + ... Test objective: The objective is to test that DELETE method deletes a deactivated individual policy. + ... Pre-conditions: The activation status of individual policy to be deleted is not set to ACTIVATED. + ... Reference: Clause 5.5.8.3.5 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: The individual policy is not available anymore in the NFV-MANO. + DELETE Individual Policy + Check HTTP Response Status Code Is 204 + Check Postcondition Individual Policy is Deleted + +DELETE an individual policy - CONFLICT + [Documentation] Test ID: 10.3.1.3.8 + ... Test title: DELETE an individual policy - CONFLICT + ... Test objective: The objective is to test that DELETE method does not delete an activated individual policy. + ... Pre-conditions: The activation status of individual policy to be deleted is set to ACTIVATED. + ... Reference: Clause 5.5.8.3.5 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: The individual policy is not deleted. + DELETE Individual Policy in status ACTIVATED + Check HTTP Response Status Code Is 409 + Check HTTP Response Body Json Schema Is ProblemDetails + Check Postcondition Individual Policy is Not Deleted \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/IndividualSubscription.robot b/SOL012/PolicyManagement-API/IndividualSubscription.robot new file mode 100644 index 0000000000000000000000000000000000000000..e7e3da0f7d6943df3b0dc1d72b7a9cbdc5dbf08c --- /dev/null +++ b/SOL012/PolicyManagement-API/IndividualSubscription.robot @@ -0,0 +1,79 @@ +*** Settings *** +Resource environment/variables.txt +Resource PolicyManagementKeywords.robot + +*** Test Cases *** +POST Individual Subscription - Method not implemented + [Documentation] Test ID: 10.3.1.7.1 + ... Test title: POST Individual Subscription - Method not implemented + ... Test objective: The objective is to test that POST method is not implemented for this resource. + ... Pre-conditions: none + ... Reference: Clause 5.5.8.3.1 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + POST Individual Subscription + Check HTTP Response Status Code Is 405 + +GET Information about an individual subscription - Successful + [Documentation] Test ID: 10.3.1.7.2 + ... Test title: GET Information about an individual subscription - Successful + ... Test objective: The objective is to test the retrieval of Policy Management subscription and perform a JSON schema validation of the returned PolicySubscription data structure + ... Pre-conditions: At least one policy management subscription is available in the NFV-MANO. + ... Reference: Clause 5.5.8.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + GET Individual subscription + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is PolicySubscription + +GET Information about an individual subscription - NOT FOUND + [Documentation] Test ID: 10.3.1.7.3 + ... Test title: GET Information about an individual subscription - NOT FOUND + ... Test objective: The objective is to test that the retrieval of individual Policy Management subscription fails when using an invalid resource identifier. + ... Pre-conditions: At least one Policy Management subscription is available in the NFV-MANO. + ... Reference: Clause 5.5.8.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + GET Individual subscription with Invalid URI + Check HTTP Response Status Code Is 404 + Check HTTP Response Body Json Schema Is ProblemDetails + +PUT an individual subscription - Method not implemented + [Documentation] Test ID: 10.3.1.7.4 + ... Test title: PUT an individual subscription - Method not implemented + ... Test objective: The objective is to test that PUT method is not implemented for this resource. + ... Pre-conditions: none + ... Reference: Clause 5.5.8.3.3 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + PUT Individual Subscription + Check HTTP Response Status Code Is 405 + +PATCH an individual subscription - Method not implemented + [Documentation] Test ID: 10.3.1.7.5 + ... Test title: PATCH an individual subscription - Method not implemented + ... Test objective: The objective is to test that PATCH method is not implemented for this resource. + ... Pre-conditions: none + ... Reference: Clause 5.5.8.3.4 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + PATCH Individual Subscription + Check HTTP Response Status Code Is 405 + +DELETE an individual subscription + [Documentation] Test ID: 10.3.1.7.6 + ... Test title: DELETE an individual subscription + ... Test objective: The objective is to test that DELETE method deletes an individual subscription + ... Pre-conditions: At least one policy management subscription is available in the NFV-MANO. + ... Reference: Clause 5.5.8.3.5 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: The Policy Management subscription is no longer available in the NFV-MANO. + DELETE Individual Subscription + Check HTTP Response Status Code Is 204 + Check Postcondition Individual Subscription is Deleted \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/NotificationConsumer.robot b/SOL012/PolicyManagement-API/NotificationConsumer.robot new file mode 100644 index 0000000000000000000000000000000000000000..80097e51a2fd627dcca6fad9b569f58ad0bf35e0 --- /dev/null +++ b/SOL012/PolicyManagement-API/NotificationConsumer.robot @@ -0,0 +1,90 @@ +*** Settings *** +Resource environment/variables.txt +Resource PolicyManagementKeywords.robot +Suite Setup Check resource existence and get CallbackUri + +*** Test Cases *** +Policy Change Notification + [Documentation] Test ID: 10.3.1.9.1 + ... Test title: Policy Change Notification + ... Test objective: The objective is to test that Policy Change Notification is delivered with success to the notification consumer. + ... Pre-conditions: A subscription for policy change notification is available in the NFV-MANO. + ... Reference: Clause 5.5.9.3.1 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_Notif_Endpoint + ... Applicability: none + ... Post-Conditions: none + POST Policy Change Notification + Check HTTP Response Status Code Is 204 + +Policy Conflict Notification + [Documentation] Test ID: 10.3.1.9.2 + ... Test title: Policy Conflict Notification + ... Test objective: The objective is to test that Policy Conflict Notification is delivered with success to the notification consumer. + ... Pre-conditions: A subscription for policy conflict notification is available in the NFV-MANO. + ... Reference: Clause 5.5.9.3.1 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_Notif_Endpoint + ... Applicability: none + ... Post-Conditions: none + POST Policy Conflict Notification + Check HTTP Response Status Code Is 204 + +Test the Notification Endpoint - Successful + [Documentation] Test ID: 10.3.1.9.3 + ... Test title: Test the Notification Endpoint - Successful + ... Test objective: The objective is to test the Notification Endpoint provided by the notification consumer. + ... Pre-conditions: A notification endpoint is provided by the API consumer upon subscription. + ... Reference: Clause 5.5.9.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_Notif_Endpoint + ... Applicability: none + ... Post-Conditions: none + Get reach the notification endpoint + Check HTTP Response Status Code Is 204 + +Test the Notification Endpoint - UNREACHABLE + [Documentation] Test ID: 10.3.1.9.4 + ... Test title: Test the Notification Endpoint - UNREACHABLE + ... Test objective: The objective is to test the Notification Endpoint provided by the notification consumer. + ... Pre-conditions: A notification endpoint is provided by the API consumer upon subscription. + ... Reference: Clause 5.5.7.3.1 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_Notif_Endpoint + ... Applicability: The notification endpoint is unreachable by the API producer. + ... Post-Conditions: none + GET reach an unreachable notification endpoint + Check HTTP Response Status Code Is 422 + Check HTTP Response Body Json Schema Is ProblemDetails + +PUT Notification endpoint - Method Not Implemented + [Documentation] Test ID: 10.3.1.9.5 + ... Test title: PUT Notification endpoint - Method Not Implemented + ... Test objective: The objective is to test the PUT method for Notification Endpoint provided by the consumer is not implemented. + ... Pre-conditions: A notification endpoint is provided by the API consumer upon subscription. + ... Reference: Clause 5.5.9.3.3 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_Notif_Endpoint + ... Applicability: none + ... Post-Conditions: none + PUT notification endpoint + Check HTTP Response Status Code Is 405 + +PATCH Notification endpoint - Method Not Implemented + [Documentation] Test ID: 10.3.1.9.6 + ... Test title: PATCH Notification endpoint - Method Not Implemented + ... Test objective: The objective is to test the PATCH method for Notification Endpoint provided by the consumer is not implemented. + ... Pre-conditions: A notification endpoint is provided by the API consumer upon subscription. + ... Reference: Clause 5.5.9.3.4 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_Notif_Endpoint + ... Applicability: none + ... Post-Conditions: none + PATCH notification endpoint + Check HTTP Response Status Code Is 405 + +DELETE Notification endpoint - Method Not Implemented + [Documentation] Test ID: 10.3.1.9.7 + ... Test title: DELETE Notification endpoint - Method Not Implemented + ... Test objective: The objective is to test the DELETE method for Notification Endpoint provided by the consumer is not implemented. + ... Pre-conditions: A notification endpoint is provided by the API consumer upon subscription. + ... Reference: Clause 5.5.9.3.5 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_Notif_Endpoint + ... Applicability: none + ... Post-Conditions: none + DELETE notification endpoint + Check HTTP Response Status Code Is 405 \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/NotificationEndpoint.robot b/SOL012/PolicyManagement-API/NotificationEndpoint.robot new file mode 100644 index 0000000000000000000000000000000000000000..faa5def1649388f0137b3954992c9dd179b8bf11 --- /dev/null +++ b/SOL012/PolicyManagement-API/NotificationEndpoint.robot @@ -0,0 +1,79 @@ +*** Settings *** +Suite Setup Create Sessions +Suite Teardown Terminate All Processes kill=true +Resource environment/variables.txt +Library MockServerLibrary +Library Process +Library OperatingSystem +Library Collections + +*** Test Cases *** +Policy Change Notification + [Documentation] Test ID: 10.3.1.8.1 + ... Test title: Policy Change Notification + ... Test objective: The objective is to test the dispatch of Policy Change Notification when the policy is changed, and perform a JSON schema and content validation of the delivered notification. The action that triggers the notification under test is an explicit test step, but it is not performed by the test system. + ... Pre-conditions: A subscription for policy change notification is available in the NFV-MANO. + ... Reference: Clause 5.5.9.3.1 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + Trigger a change in Policy (external action) + Check Policy Management Notification Http POST Request Body Json Schema Is PolicyChangeNotification + Check Policy Management Notification Http POST Request Body notificationType attribute Is PolicyChangeNotification + +Policy Conflict Notification + [Documentation] Test ID: 10.3.1.8.2 + ... Test title: Policy Conflict Notification + ... Test objective: The objective is to test the dispatch of Policy Conflict Notification when a conflict in policy is detected, and perform a JSON schema and content validation of the delivered notification. The action that triggers the notification under test is an explicit test step, but it is not performed by the test system. + ... Pre-conditions: A subscription for policy conflict notification is available in the NFV-MANO. + ... Reference: Clause 5.5.9.3.1 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + Trigger a conflict in Policy (external action) + Check Policy Management Notification Http POST Request Body Json Schema Is PolicyConflictNotification + Check Policy Management Notification Http POST Request Body notificationType attribute Is PolicyConflictNotification + +*** Keywords *** +Create Sessions + Start Process java -jar ${MOCK_SERVER_JAR} -serverPort ${callback_port} alias=mockInstance + Wait For Process handle=mockInstance timeout=5s on_timeout=continue + Create Mock Session ${callback_uri}:${callback_port} + +Trigger a change in Policy (external action) + #do nothing + Log do nothing + +Trigger a conflict in Policy (external action) + #do nothing + Log do nothing + +Configure Notification Forward + [Arguments] ${schema} ${endpoint} ${endpoint_fwd} + Log Creating mock Http POST forward to handle ${schema} + &{notification_tmp}= Create Mock Request Matcher POST ${endpoint} body_type="JSON_SCHEMA" body=${schema} + &{notification_fwd}= Create Mock Http Forward ${endpoint_fwd} + Create Mock Expectation With Http Forward ${notification_tmp} ${notification_fwd} + +Configure Policy Management Notification Handler + [Arguments] ${endpoint} ${type} + ${json}= evaluate {} + set to dictionary ${json} notificationType ${type} + ${BODY}= evaluate json.dumps(${json}) json + Log Creating mock request and response to handle status notification + &{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY} + &{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${notification_request} ${notification_response} + +Check Policy Management Notification Http POST Request Body Json Schema Is + [Arguments] ${element} + ${schema}= Get File schemas/${element}.schema.json + Configure Notification Forward ${schema} ${callback_endpoint} ${callback_endpoint_fwd} + +Check Policy Management Notification Http POST Request Body notificationType attribute Is + [Arguments] ${type} + Configure Policy Management Notification Handler ${callback_endpoint_fwd} ${type} + Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request} + Clear Requests ${callback_endpoint} + Clear Requests ${callback_endpoint_fwd} + \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/ParticularVersionOfAnIndividualPolicy.robot b/SOL012/PolicyManagement-API/ParticularVersionOfAnIndividualPolicy.robot new file mode 100644 index 0000000000000000000000000000000000000000..5c97dad14b7b335a86f44e7410385f8c4671c934 --- /dev/null +++ b/SOL012/PolicyManagement-API/ParticularVersionOfAnIndividualPolicy.robot @@ -0,0 +1,104 @@ +*** Settings *** +Resource environment/variables.txt +Resource PolicyManagementKeywords.robot + +*** Test Cases *** +POST Particular Version of an Individual Policy - Method not implemented + [Documentation] Test ID: 10.3.1.5.1 + ... Test title: POST Particular Version of an Individual Policy - Method not implemented + ... Test objective: The objective is to test that POST method is not implemented for this resource. + ... Pre-conditions: none + ... Reference: Clause 5.5.6.3.1 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + POST Particular Version of an Individual Policy + Check HTTP Response Status Code Is 405 + +GET Information about a Particular Version of an Individual Policy - Successful + [Documentation] Test ID: 10.3.1.5.2 + ... Test title: GET Information about a Particular Version of an Individual Policy - Successful + ... Test objective: The objective is to test that GET method fetches the content of a particular version of an individual policy. + ... Pre-conditions: Individual policy is available in the NFV-MANO. Policy contents are provided in the json/PolicyContent folder. + ... Reference: Clause 5.5.6.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: The policy content type is either JSON, YAML or ZIP. + ... Post-Conditions: none + GET Particular Version of an Individual Policy + Check HTTP Response Status Code Is 200 + Check that the Content-Type Header Is Set + +GET Information about a Particular Version of an Individual Policy - NOT FOUND + [Documentation] Test ID: 10.3.1.5.3 + ... Test title: GET Information about a Particular Version of an Individual Policy - NOT FOUND + ... Test objective: The objective is to test that the information about a particular version of an individual policy fails when using an invalid resource identifier. + ... Pre-conditions: none + ... Reference: Clause 5.5.6.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + GET Particular Version of an Individual Policy with Invalid URI + Check HTTP Response Status Code Is 404 + Check HTTP Response Body Json Schema Is ProblemDetails + +PUT Particular Version of an individual policy - Successful + [Documentation] Test ID: 10.3.1.5.4 + ... Test title: PUT Particular Version of an individual policy - Successful + ... Test objective: The objective is to test that the PUT method transfers the content of a particular version of an individual policy. + ... Pre-conditions: none + ... Reference: Clause 5.5.6.3.3 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: The policy content type is either JSON, YAML or ZIP. + ... Post-Conditions: none + PUT Particular Version of an Individual Policy + Check HTTP Response Status Code Is 201 + +PUT Particular Version of an individual policy - CONFLICT + [Documentation] Test ID: 10.3.1.5.5 + ... Test title: PUT Particular Version of an individual policy - CONFLICT + ... Test objective: The objective is to test that the PUT method does not transfer the content of a particular version in case of a conflict. + ... Pre-conditions: The particular version has already been transferred to the API producer. + ... Reference: Clause 5.5.6.3.3 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: The policy content type is either JSON, YAML or ZIP. + ... Post-Conditions: none + PUT Particular Version of an Individual Policy CONFLICT + Check HTTP Response Status Code Is 409 + Check HTTP Response Body Json Schema Is ProblemDetails + +PATCH Particular Version of an individual policy - Method not implemented + [Documentation] Test ID: 10.3.1.5.6 + ... Test title: PATCH Particular Version of an individual policy - Method not implemented + ... Test objective: The objective is to test that PATCH method is not implemented for this resource. + ... Pre-conditions: none + ... Reference: Clause 5.5.6.3.4 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + PATCH Particular Version of an Individual Policy + Check HTTP Response Status Code Is 405 + +DELETE Particular Version of an individual policy - Successful + [Documentation] Test ID: 10.3.1.5.7 + ... Test title: DELETE Particular Version of an individual policy - Successful + ... Test objective: The objective is to test that the DELETE method deletes a particular version of an individual policy. + ... Pre-conditions: none + ... Reference: Clause 5.5.6.3.5 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + DELETE Particular Version of an Individual Policy + Check HTTP Response Status Code Is 204 + +DELETE Particular Version of an individual policy - CONFLICT + [Documentation] Test ID: 10.3.1.5.8 + ... Test title: DELETE Particular Version of an individual policy - CONFLICT + ... Test objective: The objective is to test that the DELETE method does not delete a particular version of an individual policy in case of a conflict. + ... Pre-conditions: The requested version of the individual policy is the selected version. + ... Reference: Clause 5.5.6.3.5 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + DELETE Particular Version of an Individual Policy + Check HTTP Response Status Code Is 409 + Check HTTP Response Body Json Schema Is ProblemDetails diff --git a/SOL012/PolicyManagement-API/Policies.robot b/SOL012/PolicyManagement-API/Policies.robot new file mode 100644 index 0000000000000000000000000000000000000000..6e76d17b4744933937710a74116e4f113e1c968a --- /dev/null +++ b/SOL012/PolicyManagement-API/Policies.robot @@ -0,0 +1,185 @@ +*** Settings *** +Resource environment/variables.txt +Resource PolicyManagementKeywords.robot + +*** Test Cases *** +POST Create a new Policy + [Documentation] Test ID: 10.3.1.2.1 + ... Test title: POST Create a new Policy + ... Test objective: The objective is to test that POST method creates a policy. + ... Pre-conditions: none + ... Reference: Clause 5.5.3.3.1 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: Policy is created. + POST Policies + Check HTTP Response Status Code Is 201 + Check HTTP Response Body Json Schema Is Policy + Check HTTP Response Header Contains Location + +GET Policies + [Documentation] Test ID: 10.3.1.2.2 + ... Test title: GET Policies + ... Test objective: The objective is to test that GET method retrieves the list of existing policies. + ... Pre-conditions: none + ... Reference: Clause 5.5.3.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + GET Policies + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is Policies + +GET Policies - Filter + [Documentation] Test ID: 10.3.1.2.3 + ... Test title: GET Policies - Filter + ... Test objective: The objective is to GET the list of existing policies using a filter. + ... Pre-conditions: none + ... Reference: Clause 5.5.3.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + GET Policies with filter + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is Policies + +GET Policies - Bad Request Invalid attribute-based filtering parameters + [Documentation] Test ID: 10.3.1.2.4 + ... Test title: GET Policies - Bad Request Invalid attribute-based filtering parameters + ... Test objective: The objective is to GET the list of existing policies using an invalid filter. + ... Pre-conditions: none + ... Reference: Clause 5.5.3.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + Get Policies - invalid filter + Check HTTP Response Status Code Is 400 + Check HTTP Response Body Json Schema Is ProblemDetails + +GET Policies - Bad Request Response too Big + [Documentation] Test ID: 10.3.1.2.5 + ... Test title: GET Policies - Bad Request Response too Big + ... Test objective: The objective is test that the retrieval of existing policies list fails because response is too big, and perform the JSON schema validation of the failed operation HTTP response. + ... Pre-conditions: none + ... Reference: Clause 5.5.3.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: NFV-MANO does not support paged response. + ... Post-Conditions: none + GET Policies without Paging support + Check HTTP Response Status Code Is 400 + Check HTTP Response Body Json Schema Is ProblemDetails + +GET Policies with "all_fields" attribute selector + [Documentation] Test ID: 10.3.1.2.6 + ... Test title: GET Policies with "all_fields" attribute selector + ... Test objective: The objective is to retrieve the list of existing policies with "all_fields" attribute selector. + ... Pre-conditions: none + ... Reference: Clause 5.5.3.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + Get Policies with all_fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is Policies + +GET Policies with "exclude_default" attribute selector + [Documentation] Test ID: 10.3.1.2.7 + ... Test title: GET policies with "exclude_default" attribute selector + ... Test objective: The objective is to retrieve the list of existing policies with "exclude_default"s attribute selector. + ... Pre-conditions: none + ... Reference: Clause 5.5.3.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + Get Policies with exclude_default attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is Policies + +GET Policies with "fields" attribute selector + [Documentation] Test ID: 10.3.1.2.8 + ... Test title: GET Policies with "fields" attribute selector + ... Test objective: The objective is to retrieve the list of existing policies with "fields" attribute selector. + ... Pre-conditions: none + ... Reference: Clause 5.5.3.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + Get Policies with fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is Policies + +GET Policies with "exclude_fields" attribute selector + [Documentation] Test ID: 10.3.1.2.9 + ... Test title: GET Policies with "exclude_fields" attribute selector + ... Test objective: The objective is to retrieve the list of existing policies with "exclude_fields" attribute selector. + ... Pre-conditions: none + ... Reference: Clause 5.5.3.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + Get Policies with exclude_fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is Policies + +GET Policies with "exclude_default" and "fields" attribute selector + [Documentation] Test ID: 10.3.1.2.10 + ... Test title: GET Policies with "exclude_default" and "fields" attribute selector + ... Test objective: The objective is to retrieve the list of existing policies with "exclude_default" and "fields" attribute selector + ... Pre-conditions: + ... Reference: Clause 5.5.3.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + Get Policies with exclude_default and fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is Policies + +GET Policies as Paged Response + [Documentation] Test ID: 10.3.1.2.11 + ... Test title: GET Policies as Paged Response + ... Test objective: The objective is to test that GET method retrieves the list of existing policies as paged response. + ... Pre-conditions: none + ... Reference: Clause 5.5.3.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: NFV-MANO supports paged response. + ... Post-Conditions: none + GET Policies with Paging support + Check HTTP Response Status Code Is 200 + Check HTTP Response Header Contains Link + +PUT Policies - Method not implemented + [Documentation] Test ID: 10.3.1.2.12 + ... Test title: PUT Policies - Method not implemented + ... Test objective: The objective is to test that PUT method cannot modify policies. + ... Pre-conditions: none + ... Reference: Clause 5.5.3.3.3 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + PUT Policies + Check HTTP Response Status Code Is 405 + +PATCH Policies - Method not implemented + [Documentation] Test ID: 10.3.1.2.13 + ... Test title: PATCH Policies - Method not implemented + ... Test objective: The objective is to test that PATCH method cannot modify policies. + ... Pre-conditions: none + ... Reference: Clause 5.5.3.3.4 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + PATCH Policies + Check HTTP Response Status Code Is 405 + +DELETE Policies - Method not implemented + [Documentation] Test ID: 10.3.1.2.14 + ... Test title: DELETE Policies - Method not implemented + ... Test objective: The objective is to test that DELETE method cannot delete policies. + ... Pre-conditions: none + ... Reference: Clause 5.5.3.3.5 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: Policies are not deleted + DELETE Policies + Check HTTP Response Status Code Is 405 + Check Postcondition Policies Exist diff --git a/SOL012/PolicyManagement-API/PolicyManagementKeywords.robot b/SOL012/PolicyManagement-API/PolicyManagementKeywords.robot new file mode 100644 index 0000000000000000000000000000000000000000..2de04c7994696412dbece9b19b3eb1bcec479544 --- /dev/null +++ b/SOL012/PolicyManagement-API/PolicyManagementKeywords.robot @@ -0,0 +1,742 @@ +*** Settings *** +Resource environment/variables.txt +Library REST ${NFVMANO_SCHEMA}://${NFVMANO_HOST}:${NFVMANO_PORT}" +Library OperatingSystem +Library JSONLibrary +Library JSONSchemaLibrary schemas/ +Library String +Library MockServerLibrary +Library Process + +*** Keywords *** +Create Sessions + Start Process java -jar ../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar -serverPort ${callback_port} alias=mockInstance + Wait For Process handle=mockInstance timeout=5s on_timeout=continue + Create Mock Session ${callback_uri}:${callback_port} + +POST API Version + Set Headers {"Accept":"${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Post ${apiRoot}/${apiName}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET API Version + Set Headers {"Accept":"${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PUT API Version + Set Headers {"Accept":"${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Put ${apiRoot}/${apiName}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PATCH API Version + Set Headers {"Accept":"${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Patch ${apiRoot}/${apiName}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +DELETE API Version + Set Headers {"Accept":"${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Delete ${apiRoot}/${apiName}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +POST API Version with apiMajorVersion + Set Headers {"Accept":"${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Post ${apiRoot}/${apiName}/${apiVersion}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET API Version with apiMajorVersion + Set Headers {"Accept":"${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PUT API Version with apiMajorVersion + Set Headers {"Accept":"${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Put ${apiRoot}/${apiName}/${apiVersion}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PATCH API Version with apiMajorVersion + Set Headers {"Accept":"${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +DELETE API Version with apiMajorVersion + Set Headers {"Accept":"${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/api_versions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + Should Be Equal As Strings ${response['status']} ${expected_status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + ${schema} = Catenate ${input} .schema.json + Validate Json ${schema} ${response['body']} + Log Json Schema Validation OK + +Check HTTP Response Header Contains + [Arguments] ${CONTENT_TYPE} + Should Contain ${response['headers']} ${CONTENT_TYPE} + Log Header is present + +Check subscription existence + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 200 + +Check Postcondition Individual Subscription Resource Returned in Location Header Is Available + Log Going to check postcondition + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${response['headers']['Location']} + Integer response status 200 + Log Received a 200 OK as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body + Validate Json PolicySubscription.schema.json ${result} + Log Validated PolicySubscription schema + ${body}= Get File jsons/PolicySubscriptionRequest.json + ${subscription}= evaluate json.loads('''${body}''') json + Should Be Equal ${result['callbackUri']} ${subscription['callbackUri']} + Log Validated Issued subscription is same as original + +Check Postcondition Policy subscription is created + Log Going to check postcondition + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${response['body']['id']} + Integer response status 200 + Log Received a 200 OK as expected + +Check HTTP Response Header Contains Link + ${linkURL}= Get Value From Json ${response['headers']} $..Link + Should Not Be Empty ${linkURL} + +Check Postcondition Subscriptions Exist + Log Checking that subscriptions exists + Get Subscriptions + +POST subscriptions + Log Create subscription instance by POST to ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + ${body}= Get File jsons/PolicySubscriptionRequest.json + ${body}= Replace String ${body} \${callback_uri} ${callback_uri} + ${body}= Replace String ${body} \${callback_port} ${callback_port} + ${body}= Replace String ${body} \${callback_endpoint} ${callback_endpoint} + Log Creating mock request and response to handle GET operation on notification endpoint + &{notification_request}= Create Mock Request Matcher GET ${callback_endpoint} + &{notification_response}= Create Mock Response status_code=204 + Log Issue the subscription request + Create Mock Expectation ${notification_request} ${notification_response} + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + Clear Requests ${callback_endpoint} + + +POST subscriptions NO DUPLICATION + Log Trying to create a subscription with an already created content + #Skip this test if NFVMANO allows creation of duplicate/redundant subscriptions + Pass Execution If ${NFVMANO_DUPLICATION} == 1 NFVMANO allows creation of redundant subscriptions + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + ${body}= Get File jsons/PolicySubscriptionRequest.json + ${body}= Replace String ${body} \${callback_uri} ${callback_uri} + ${body}= Replace String ${body} \${callback_port} ${callback_port} + ${body}= Replace String ${body} \${callback_endpoint} ${callback_endpoint} + Log Creating mock request and response to handle GET operation on notification endpoint + &{notification_request}= Create Mock Request Matcher GET ${callback_endpoint} + &{notification_response}= Create Mock Response status_code=204 + Log Issue the subscription request + Create Mock Expectation ${notification_request} ${notification_response} + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + Clear Requests ${callback_endpoint} + +POST subscriptions with Invalid Request + Log Trying to create a subscription with invalid request body + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + ${body}= Get File jsons/InvalidPolicySubscriptionRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET Subscriptions + Log Get the list of active subscriptions + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Log Execute Query and validate response + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Get subscriptions with all_fields attribute selector + Log Get the list of active subscriptions, using fields + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?all_fields + ${output}= Output response + Set Suite Variable ${response} ${output} + +Get subscriptions with exclude_default attribute selector + Log Get the list of active subscriptions, using fields + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?exclude_default + ${output}= Output response + Set Suite Variable ${response} ${output} + +Get subscriptions with fields attribute selector + Log Get the list of active subscriptions, using fields + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?fields=${fields} + ${output}= Output response + Set Suite Variable ${response} ${output} + +Get subscriptions with exclude_fields attribute selector + Log Get the list of active subscriptions, using fields + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?exclude_fields=${fields} + ${output}= Output response + Set Suite Variable ${response} ${output} + +GET subscriptions with filter + Log Get the list of active subscriptions using a filter + Set Headers {"Accept": "${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Get subscriptions - invalid filter + Log Get the list of active subscriptions using an invalid filter + Set Headers {"Accept": "${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${sub_filter_invalid} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Get subscriptions with exclude_default and fields attribute selector + Log Get the list of active subscriptions, using fields + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?fields=${fields}&exclude_default + ${output}= Output response + Set Suite Variable ${response} ${output} + +Get subscriptions without Paging support + Run Keyword If ${PAGING_SUPPORTED} == 0 Get subscriptions + +Get subscriptions with Paging support + Run Keyword If ${PAGING_SUPPORTED} == 1 Get subscriptions + +PUT subscriptions + Log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Put ${apiRoot}/${apiName}/${apiVersion}/subscriptions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PATCH subscriptions + Log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +DELETE subscriptions + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +POST Individual Subscription + log Trying to perform a POST. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET Individual subscription + log Trying to get information about an individual subscription + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET Individual subscription with Invalid URI + log Trying to get information about an individual subscription with invalid subscription ID + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${invalidSubscriptionId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PUT Individual Subscription + log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Put ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PATCH Individual Subscription + log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +DELETE Individual subscription + log Trying to delete an individual subscription + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Check Postcondition Individual Subscription is Deleted + Log Check Postcondition Subscription is deleted + GET individual Subscription + Check HTTP Response Status Code Is 404 + +Check resource existence and get CallbackUri + Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 200 + Validate Json response body PolicySubscription.schema.json + Set Global Variable ${callbackResp} response body callbackUri + +POST Policy Change Notification + log Trying to perform a POST to deliver notification. + Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + ${template} = Get File jsons/PolicyChangeNotification.json + ${body}= Format String ${template} subscriptionId=${subscriptionId} + Post ${callbackResp} ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +POST Policy Conflict Notification + log Trying to perform a POST to deliver notification. + Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + ${template} = Get File jsons/PolicyConflictNotification.json + ${body}= Format String ${template} subscriptionId=${subscriptionId} policyId1=${policyId1} policyId2=${policyId2} + Post ${callbackResp} ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET reach the notification endpoint + Log Trying to reach the notification endpoint using GET method. + Set Headers {"Accept": "${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${callbackResp} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET reach an unreachable notification endpoint + Log Trying to reach the notification endpoint using GET method. + Set Headers {"Accept": "${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${unreachable_uri} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PUT notification endpoint + Log Trying to perform a PUT. This method should not be implemented. + Set Headers {"Accept": "${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Put ${callbackResp} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PATCH notification endpoint + Log Trying to perform a PATCH. This method should not be implemented. + Set Headers {"Accept": "${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Patch ${callbackResp} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +DELETE notification endpoint + Log Trying to perform a DELETE. This method should not be implemented. + Set Headers {"Accept": "${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Delete ${callbackResp} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + + +POST Policies + Log Create policy instance by POST to ${apiRoot}/${apiName}/${apiVersion}/policies + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + ${body}= Get File jsons/CreatePolicyRequest.json + Post ${apiRoot}/${apiName}/${apiVersion}/policies ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET Policies + Log Get the list of existing policies + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Log Execute Query and validate response + Get ${apiRoot}/${apiName}/${apiVersion}/policies + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET Policies with filter + Log Get the list of existing policies using a filter + Set Headers {"Accept": "${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiVersion}/policies?${sub_filter} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Get Policies - invalid filter + Log Get the list of existing policies using an invalid filter + Set Headers {"Accept": "${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiVersion}/policies?${sub_filter_invalid} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Get Policies with all_fields attribute selector + Log Get the list of existing policies, using fields + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiVersion}/policies?all_fields + ${output}= Output response + Set Suite Variable ${response} ${output} + +Get Policies with exclude_default attribute selector + Log Get the list of existing policies, using fields + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiVersion}/policies?exclude_default + ${output}= Output response + Set Suite Variable ${response} ${output} + +Get Policies with fields attribute selector + Log Get the list of existing policies, using fields + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiVersion}/policies?fields=${fields} + ${output}= Output response + Set Suite Variable ${response} ${output} + +Get Policies with exclude_fields attribute selector + Log Get the list of existing policies, using fields + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiVersion}/policies?exclude_fields=${fields} + ${output}= Output response + Set Suite Variable ${response} ${output} + +Get Policies with exclude_default and fields attribute selector + Log Get the list of existing policies, using fields + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiVersion}/policies?fields=${fields}&exclude_default + ${output}= Output response + Set Suite Variable ${response} ${output} + +GET Policies without Paging support + Run Keyword If ${PAGING_SUPPORTED} == 0 Get Policies + +GET Policies with Paging support + Run Keyword If ${PAGING_SUPPORTED} == 1 Get Policies + +PUT Policies + Log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Put ${apiRoot}/${apiName}/${apiVersion}/policies + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PATCH Policies + Log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/policies + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +DELETE Policies + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/policies + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Check Postcondition Policies Exist + Log Checking that Policies exist + Get Policies + +POST Individual Policy + log Trying to perform a POST. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Post ${apiRoot}/${apiName}/${apiVersion}/policies/${policyId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET Individual Policy + log Trying to get information about an individual policy + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/policies/${policyId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET Individual Policy with Invalid URI + log Trying to get information about an individual policy with invalid policy ID + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/policies/${invalidPolicyId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PUT Individual Policy + log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Put ${apiRoot}/${apiName}/${apiVersion}/policies/${policyId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PATCH Individual Policy + Log Modify individual policy instance by PATCH to ${apiRoot}/${apiName}/${apiVersion}/policies/${policyId} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + ${body}= Get File jsons/PolicyModifications.json + Patch ${apiRoot}/${apiName}/${apiVersion}/policies/${policyId} ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +DELETE Individual Policy + log Trying to delete an individual policy, no conflict + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/policies/${policyId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +DELETE Individual Policy in status ACTIVATED + Check Activation Status of Policy Is ACTIVATED + log Trying to delete an individual policy, no conflict + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/policies/${policyId} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + + +Check Postcondition Individual Policy is Deleted + Log Check Postcondition individual policy is deleted + GET individual Policy + Check HTTP Response Status Code Is 404 + +Check Activation Status of Policy Is + [Arguments] ${status} + Log Check Activation Status + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/policies/${policyIdInActivatedStatus} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is Policy + Should be equal as strings ${response['body']['activationStatus']} ${status} + +Check Postcondition Individual Policy is Not Deleted + Log Check Postcondition individual policy is not deleted + GET individual Policy + Check HTTP Response Status Code Is 200 + +POST Selected Version of an Individual Policy + Log Trying to perform a POST. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Post ${apiRoot}/${apiName}/${apiVersion}/policies/${policyId}/selected_version + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET Selected Version of an Individual Policy + log Trying to get information about the selected version of an individual policy + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/policies/${policyId}/selected_version + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET Selected Version of an Individual Policy in CREATED state + log Trying to get information about the selected version of an individual policy which is in CREATED state + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/policies/${policyIdInCreatedState}/selected_version + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PUT Selected Version of an Individual Policy + log Trying to perform a PUT. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Put ${apiRoot}/${apiName}/${apiVersion}/policies/${policyId}/selected_version + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PATCH Selected Version of an Individual Policy + log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/policies/${policyId}/selected_version + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +DELETE Selected Version of an Individual Policy + log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/policies/${policyId}/selected_version + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +POST Particular Version of an Individual Policy + Log Trying to perform a POST. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Post ${apiRoot}/${apiName}/${apiVersion}/policies/${policyId}/versions/${policyVersion} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET Particular Version of an Individual Policy + log Trying to get information about a particular version of an individual policy + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/policies/${policyId}/versions/${policyVersion} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET Particular Version of an Individual Policy with Invalid URI + log Trying to get information about a particular version of an individual policy with invalid policyId + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/policies/${invalidPolicyId}/versions/${policyVersion} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PUT Particular Version of an Individual Policy + Log Using PUT method to transfer the content of a particular version of an individual policy. + Set Headers {"Accept":"${ACCEPT}"} + Determine Policy Content Type + Set Headers {"Content-Type": "${POLICY_CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + ${body}= Get File ${POLICY_CONTENT_FILENAME} + Put ${apiRoot}/${apiName}/${apiVersion}/policies/${policyId}/versions/${policyVersion} ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PUT Particular Version of an Individual Policy CONFLICT + Log Using PUT method to transfer the content of a particular version of an already transferred policy. + Set Headers {"Accept":"${ACCEPT}"} + Determine Policy Content Type + Set Headers {"Content-Type": "${POLICY_CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + ${body}= Get File ${POLICY_CONTENT_FILENAME} + Put ${apiRoot}/${apiName}/${apiVersion}/policies/${policyIdAlreadyTransferred}/versions/${policyVersion} ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +PATCH Particular Version of an Individual Policy + log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Patch ${apiRoot}/${apiName}/${apiVersion}/policies/${policyId}/versions/${policyVersion} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +DELETE Particular Version of an Individual Policy + Log Trying to DELETE a particular version of an individual policy. + Set Headers {"Accept":"${ACCEPT}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/policies/${policyId}/versions/${policyVersion} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +Determine Policy Content Type + ${json}= Run keyword and return status Should end with ${POLICY_CONTENT_FILENAME} .json + ${yaml}= Run keyword and return status Should end with ${POLICY_CONTENT_FILENAME} .yaml + ${zip}= Run keyword and return status Should end with ${POLICY_CONTENT_FILENAME} .zip + Run Keyword If ${json} Set Global Variable ${POLICY_CONTENT_TYPE} application/json + Run Keyword If ${yaml} Set Global Variable ${POLICY_CONTENT_TYPE} application/yaml + Run Keyword If ${zip} Set Global Variable ${POLICY_CONTENT_TYPE} application/zip + +Check that the Content-Type Header Is Set + Determine Policy Content Type + Log Validating content type + Should Be Equal ${response['headers']['Content-Type']} ${POLICY_CONTENT_TYPE} + Log Content Type validated \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/SelectedVersionOfAnIndividualPolicy.robot b/SOL012/PolicyManagement-API/SelectedVersionOfAnIndividualPolicy.robot new file mode 100644 index 0000000000000000000000000000000000000000..8a3c163ab3f2b7d2a5c2e7c031f18043ab25c215 --- /dev/null +++ b/SOL012/PolicyManagement-API/SelectedVersionOfAnIndividualPolicy.robot @@ -0,0 +1,91 @@ +*** Settings *** +Resource environment/variables.txt +Resource PolicyManagementKeywords.robot + +*** Test Cases *** +POST Selected Version of an Individual Policy - Method not implemented + [Documentation] Test ID: 10.3.1.4.1 + ... Test title: POST Selected Version of an Individual Policy - Method not implemented + ... Test objective: The objective is to test that POST method is not implemented for this resource. + ... Pre-conditions: none + ... Reference: Clause 5.5.5.3.1 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + POST Selected Version of an Individual Policy + Check HTTP Response Status Code Is 405 + +GET Information about the Selected Version of an Individual Policy - Successful + [Documentation] Test ID: 10.3.1.4.2 + ... Test title: GET Information about the Selected Version of an Individual Policy - Successful + ... Test objective: The objective is to test The GET method fetches contents of the selected version of an individual policy and check that the HTTP Content-Type header is set according to the type of content. + ... Pre-conditions: Individual policy is available in the NFV-MANO. Policy contents are provided in the json/PolicyContent folder. + ... Reference: Clause 5.5.5.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: The policy content type is either JSON, YAML or ZIP. + ... Post-Conditions: none + GET Selected Version of an Individual Policy + Check HTTP Response Status Code Is 200 + Check that the Content-Type Header Is Set + +GET Information about the Selected Version of an Individual Policy - NOT FOUND + [Documentation] Test ID: 10.3.1.4.3 + ... Test title: GET Information about the Selected Version of an Individual Policy - NOT FOUND + ... Test objective: The objective is to test that the information about the selected version of an individual policy fails when using an invalid resource identifier. + ... Pre-conditions: The API producer did not find the current representation for the target resource. + ... Reference: Clause 5.5.5.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + GET Selected Version of an Individual Policy + Check HTTP Response Status Code Is 404 + Check HTTP Response Body Json Schema Is ProblemDetails + +GET Information about the Selected Version of an Individual Policy - CREATED STATE + [Documentation] Test ID: 10.3.1.4.4 + ... Test title: GET Information about the Selected Version of an Individual Policy - NOT FOUND + ... Test objective: The objective is to test that the information about the selected version of an individual policy is not retrieved when it is in CREATED state. + ... Pre-conditions: none + ... Reference: Clause 5.5.5.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + GET Selected Version of an Individual Policy in CREATED STATE + Check HTTP Response Status Code Is 404 + Check HTTP Response Body Json Schema Is ProblemDetails + +PUT Selected Version of an individual policy - Method not implemented + [Documentation] Test ID: 10.3.1.4.5 + ... Test title: PUT Selected Version of an individual policy - Method not implemented + ... Test objective: The objective is to test that PUT method is not implemented for this resource. + ... Pre-conditions: none + ... Reference: Clause 5.5.5.3.3 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + PUT Selected Version of an Individual Policy + Check HTTP Response Status Code Is 405 + +PATCH Selected Version of an individual policy - Method not implemented + [Documentation] Test ID: 10.3.1.4.6 + ... Test title: PATCH Selected Version of an individual policy - Method not implemented + ... Test objective: The objective is to test that PATCH method is not implemented for this resource. + ... Pre-conditions: none + ... Reference: Clause 5.5.5.3.4 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + PATCH Selected Version of an Individual Policy + Check HTTP Response Status Code Is 405 + +DELETE Selected Version of an individual policy - Method not implemented + [Documentation] Test ID: 10.3.1.4.7 + ... Test title: DELETE Selected Version of an individual policy - Method not implemented + ... Test objective: The objective is to test that DELETE method is not implemented for this resource. + ... Pre-conditions: none + ... Reference: Clause 5.5.5.3.5 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + DELETE Selected Version of an Individual Policy + Check HTTP Response Status Code Is 405 diff --git a/SOL012/PolicyManagement-API/Subscriptions.robot b/SOL012/PolicyManagement-API/Subscriptions.robot new file mode 100644 index 0000000000000000000000000000000000000000..2e10d4b8953d7cafec8cd1e4a18d7059a1887903 --- /dev/null +++ b/SOL012/PolicyManagement-API/Subscriptions.robot @@ -0,0 +1,217 @@ +*** Settings *** +Suite Setup Create Sessions +Suite Teardown Terminate All Processes kill=true +Library Process +Resource environment/variables.txt +Resource PolicyManagementKeywords.robot + +*** Test Cases *** +POST Create a new subscription + [Documentation] Test ID: 10.3.1.6.1 + ... Test title: POST Create a new subscription + ... Test objective: The objective is to test that POST method creates a subscription. + ... Pre-conditions: none + ... Reference: Clause 5.5.7.3.1 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: Policy subscription is created. + POST subscriptions + Check HTTP Response Status Code Is 201 + Check HTTP Response Body Json Schema Is PolicySubscription + Check HTTP Response Header Contains Location + Check Postcondition Policy subscription is created + +POST Create a new Subscription - DUPLICATION NOT ALLOWED + [Documentation] Test ID: 10.3.1.6.2 + ... Test title: POST Create a new subscription - DUPLICATION NOT ALLOWED + ... Test objective: The objective is to test that POST method cannot create a duplicate subscription. + ... Pre-conditions: A subscription shall already exist. + ... Reference: Clause 5.5.7.3.1 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: Duplication is not supported by NFVMANO. + ... Post-Conditions: Individual subscription resource returned in the location header is available. + POST subscriptions NO DUPLICATION + Check Subscription Existence + Check HTTP Response Status Code Is 303 + Check HTTP Response Header Contains Location + Check Postcondition Individual Subscription Resource Returned in Location Header Is Available + +POST Create a new Subscription - UNPROCESSABLE ENTITY + [Documentation] Test ID: 10.3.1.6.3 + ... Test title: POST Create a new Subscription - UNPROCESSABLE ENTITY + ... Test objective: The objective is to test that correct error code is generated when data in the request body cannot be processed. + ... Pre-conditions: none + ... Reference: Clause 5.5.7.3.1 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: Callback URI is not reachable by the API producer. + ... Post-Conditions: none + POST subscriptions with Invalid Request + Check HTTP Response Status Code Is 422 + Check HTTP Response Body Json Schema Is ProblemDetails + +GET Subscriptions + [Documentation] Test ID: 10.3.1.6.4 + ... Test title: GET Subscriptions + ... Test objective: The objective is to test that GET method retrieves the list of existing subscriptions. + ... Pre-conditions: none + ... Reference: Clause 5.5.7.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + GET Subscriptions + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is subscriptions + +GET Subscription - Filter + [Documentation] Test ID: 10.3.1.6.5 + ... Test title: GET Subscription - Filter + ... Test objective: The objective is to GET the list of active subscriptions using a filter. + ... Pre-conditions: none + ... Reference: Clause 5.5.7.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + GET Subscriptions with filter + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is subscriptions + +GET subscriptions - Bad Request Invalid attribute-based filtering parameters + [Documentation] Test ID: 10.3.1.6.6 + ... Test title: GET subscriptions - Bad Request Invalid attribute-based filtering parameters + ... Test objective: The objective is to GET the list of active subscriptions using an invalid filter. + ... Pre-conditions: none + ... Reference: Clause 5.5.7.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + Get subscriptions - invalid filter + Check HTTP Response Status Code Is 400 + Check HTTP Response Body Json Schema Is ProblemDetails + +GET subscriptions - Bad Request Response too Big + [Documentation] Test ID: 10.3.1.6.7 + ... Test title: GET subscriptions - Bad Request Response too Big + ... Test objective: The objective is test that the retrieval of active subscriptions list fails because response is too big, and perform the JSON schema validation of the failed operation HTTP response. + ... Pre-conditions: none + ... Reference: Clause 5.5.7.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: NFV-MANO does not support paged response. + ... Post-Conditions: none + GET Subscriptions without Paging support + Check HTTP Response Status Code Is 400 + Check HTTP Response Body Json Schema Is ProblemDetails + +GET subscriptions with "all_fields" attribute selector + [Documentation] Test ID: 10.3.1.6.8 + ... Test title: GET subscriptions with "all_fields" attribute selector + ... Test objective: The objective is to retrieve the list of active subscriptions with "all_fields" attribute selector + ... Pre-conditions: none + ... Reference: Clause 5.5.7.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + Get subscriptions with all_fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is subscriptions + +GET subscriptions with "exclude_default" attribute selector + [Documentation] Test ID: 10.3.1.6.9 + ... Test title: GET subscriptions with "exclude_default" attribute selector + ... Test objective: The objective is to retrieve the list of active subscriptions with "exclude_default"s attribute selector + ... Pre-conditions: none + ... Reference: Clause 5.5.7.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + Get subscriptions with exclude_default attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is subscriptions + +GET subscriptions with "fields" attribute selector + [Documentation] Test ID: 10.3.1.6.10 + ... Test title: GET subscriptions with "fields" attribute selector + ... Test objective: The objective is to retrieve the list of active subscriptions with "fields" attribute selector + ... Pre-conditions: none + ... Reference: Clause 5.5.7.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + Get subscriptions with fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is subscriptions + +GET subscriptions with "exclude_fields" attribute selector + [Documentation] Test ID: 10.3.1.6.11 + ... Test title: GET subscriptions with "exclude_fields" attribute selector + ... Test objective: The objective is to retrieve the list of active subscriptions with "exclude_fields" attribute selector + ... Pre-conditions: none + ... Reference: Clause 5.5.7.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + Get subscriptions with exclude_fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is subscriptions + +GET Subscriptions as Paged Response + [Documentation] Test ID: 10.3.1.6.12 + ... Test title: GET Subscriptions as Paged Response + ... Test objective: The objective is to test that GET method retrieves the list of existing subscriptions as paged response. + ... Pre-conditions: none + ... Reference: Clause 5.5.7.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: NFV-MANO supports paged response. + ... Post-Conditions: none + GET Subscriptions with Paging support + Check HTTP Response Status Code Is 200 + Check HTTP Response Header Contains Link + +GET subscriptions with "exclude_default" and "fields" attribute selector + [Documentation] Test ID: 10.3.1.6.13 + ... Test title: GET subscriptions with "exclude_default" and "fields" attribute selector + ... Test objective: The objective is to retrieve the list of active subscriptions with "exclude_default" and "fields" attribute selector + ... Pre-conditions: + ... Reference: Clause 5.5.7.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + Get subscriptions with exclude_default and fields attribute selector + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is subscriptions + +PUT subscriptions - Method not implemented + [Documentation] Test ID: 10.3.1.6.14 + ... Test title: PUT subscriptions - Method not implemented + ... Test objective: The objective is to test that PUT method cannot modify a policy management subscription. + ... Pre-conditions: none + ... Reference: Clause 5.5.7.3.3 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + PUT subscriptions + Check HTTP Response Status Code Is 405 + +PATCH subscriptions - Method not implemented + [Documentation] Test ID: 10.3.1.6.15 + ... Test title: PATCH subscriptions - Method not implemented + ... Test objective: The objective is to test that PATCH method cannot modify a policy management subscription. + ... Pre-conditions: none + ... Reference: Clause 5.5.7.3.4 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: none + PATCH subscriptions + Check HTTP Response Status Code Is 405 + +DELETE subscriptions - Method not implemented + [Documentation] Test ID: 10.3.1.6.16 + ... Test title: DELETE subscriptions - Method not implemented + ... Test objective: The objective is to test that DELETE method cannot delete a policy management subscription. + ... Pre-conditions: none + ... Reference: Clause 5.5.7.3.5 - ETSI GS NFV-SOL 012 [7] v3.4.1 + ... Config ID: Config_prod_NFV-MANO + ... Applicability: none + ... Post-Conditions: Subscriptions are not deleted + DELETE subscriptions + Check HTTP Response Status Code Is 405 + Check Postcondition Subscriptions Exist \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/environment/variables.txt b/SOL012/PolicyManagement-API/environment/variables.txt new file mode 100644 index 0000000000000000000000000000000000000000..edba991e99ddc7395f83ae250a20bf858c40efe5 --- /dev/null +++ b/SOL012/PolicyManagement-API/environment/variables.txt @@ -0,0 +1,59 @@ +*** Variables *** +${NFVMANO_HOST} localhost # Hostname of the NFVO +${NFVMANO_PORT} 8081 # Listening port of the NFVO +${NFVMANO_SCHEMA} https +${AUTHORIZATION_HEADER} Authorization +${AUTHORIZATION_TOKEN} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ== +${CONTENT_TYPE} application/json +${CONTENT_TYPE_JSON} application/json +${ACCEPT} application/json +${ACCEPT_JSON} application/json +${AUTH_USAGE} 1 + +${apiRoot} / +${apiName} nfvpolicy +${apiVersion} v1 + +#Add file name along with the full path containing policy contents +${POLICY_CONTENT_FILENAME} jsons/PolicyContent/policyContent.json +${POLICY_CONTENT_TYPE} application/json + +${response} {} + +${NFVMANO_DUPLICATION} 1 +${PAGING_SUPPORTED} 1 + +${sub_filter} filter +${sub_filter_invalid} filter_invalid +${fields} criteria,objectInstanceIds +${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f +${invalidSubscriptionId} invalid-subscription-id + +${notification_ep} notification +${VrQuotaAvailNotification} {} + +${callback_uri} http://localhost +${callback_port} 9091 +${callback_endpoint} /endpoint +${callback_endpoint_fwd} /endpoint/check +${callback_endpoint_error} /endpoint_404 +${sleep_interval} 20s +${total_polling_time} 2 min +${polling_interval} 10 sec + +${unreachable_uri} http://not-reachable-uri +${notification_request} [] +${notification_response} [] + +${policyId} +${policyId1} +${policyId2} +${policyVersion} +${policyIdInActivatedStatus} +${policyIdInCreatedState} +${policyIdAlreadyTransferred} +${invalidPolicyId} invalid-policy-id + +${callbackResp} 127.0.0.1 + +${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar diff --git a/SOL012/PolicyManagement-API/jsons/CreatePolicyRequest.json b/SOL012/PolicyManagement-API/jsons/CreatePolicyRequest.json new file mode 100644 index 0000000000000000000000000000000000000000..4c0882406f844e46a18e736d95502dfc85c94ba3 --- /dev/null +++ b/SOL012/PolicyManagement-API/jsons/CreatePolicyRequest.json @@ -0,0 +1,6 @@ +{ + "designer": "", + "name": "", + "pfId": "", + "associations": [] +} \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/jsons/InvalidPolicySubscriptionRequest.json b/SOL012/PolicyManagement-API/jsons/InvalidPolicySubscriptionRequest.json new file mode 100644 index 0000000000000000000000000000000000000000..56d3a51dd4d92c3d69da583735b00b612339513c --- /dev/null +++ b/SOL012/PolicyManagement-API/jsons/InvalidPolicySubscriptionRequest.json @@ -0,0 +1,8 @@ +{ + "filter": { + "notificationTypes": "PolicyChangeNotification", + "policyIds": "", + "changeTypes": "CREATE_POLICY" + }, + "callbackUri": "http://not-reachable-uri" +} \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/jsons/PolicyChangeNotification.json b/SOL012/PolicyManagement-API/jsons/PolicyChangeNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..8c1d6417eb9a2d98605c657ae5f824c08ea088eb --- /dev/null +++ b/SOL012/PolicyManagement-API/jsons/PolicyChangeNotification.json @@ -0,0 +1,10 @@ +{{ + "id": "", + "notificationType": "PolicyChangeNotification", + "subscriptionId": "{subscriptionId}", + "timeStamp": "", + "changeType": "", + "_links": {{ + "subscription": "" + }} +}} \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/jsons/PolicyConflictNotification.json b/SOL012/PolicyManagement-API/jsons/PolicyConflictNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..f9ae3c61d019861313d86a9a630ec8466e68d3ad --- /dev/null +++ b/SOL012/PolicyManagement-API/jsons/PolicyConflictNotification.json @@ -0,0 +1,13 @@ +{{ + "id": "", + "notificationType": "PolicyConflictNotification", + "subscriptionId": "{subscriptionId}", + "timeStamp": "", + "policyIds": ["{policyId1}","{policyId2}"], + "selectedVersions": ["v1","v1"], + "conflictDescription": "", + "_links": {{ + "subscription": "", + "objectInstances": [] + }} +}} \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/jsons/PolicyContent/policyContent.json b/SOL012/PolicyManagement-API/jsons/PolicyContent/policyContent.json new file mode 100644 index 0000000000000000000000000000000000000000..825e64360751199935ce2f2f0b101ea5bc558a42 --- /dev/null +++ b/SOL012/PolicyManagement-API/jsons/PolicyContent/policyContent.json @@ -0,0 +1,10 @@ +{ + "description": "This is a JSON example template for Policy content. Replace with your specific policy content.", + "type": "object", + "properties": { + "id": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + } + } +} \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/jsons/PolicyContent/policyContent.yaml b/SOL012/PolicyManagement-API/jsons/PolicyContent/policyContent.yaml new file mode 100644 index 0000000000000000000000000000000000000000..07bb74b2ed83b97f062fb84d114429b9cc21db58 --- /dev/null +++ b/SOL012/PolicyManagement-API/jsons/PolicyContent/policyContent.yaml @@ -0,0 +1,10 @@ +--- + name: "use you own yaml policy content" + designer: "just replace this YAML structure with your policy content" + policy-id: 12345 + some-flag: true + some-paramter: 3 + associations: + - a1 + - a2 + - a3 \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/jsons/PolicyModifications.json b/SOL012/PolicyManagement-API/jsons/PolicyModifications.json new file mode 100644 index 0000000000000000000000000000000000000000..b04b5736463bd75b1096640ecb3a962098a24e39 --- /dev/null +++ b/SOL012/PolicyManagement-API/jsons/PolicyModifications.json @@ -0,0 +1,7 @@ +{ + "activationStatus": "ACTIVATED", + "selectedVersion": "", + "addAssociations": [], + "removeAssociations": [], + "removeAllAssociations": "FALSE" +} \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/jsons/PolicySubscriptionRequest.json b/SOL012/PolicyManagement-API/jsons/PolicySubscriptionRequest.json new file mode 100644 index 0000000000000000000000000000000000000000..a743a5540a12b0f340d78e15a29424209e2796a4 --- /dev/null +++ b/SOL012/PolicyManagement-API/jsons/PolicySubscriptionRequest.json @@ -0,0 +1,8 @@ +{ + "filter": { + "notificationTypes": "PolicyChangeNotification", + "policyIds": "", + "changeTypes": "CREATE_POLICY" + }, + "callbackUri": "${callback_uri}:${callback_port$}{callback_endpoint}" +} \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/schemas/Policies.schema.json b/SOL012/PolicyManagement-API/schemas/Policies.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..3e095ed9ba92228fb2f4c4b59ccf497c9b465fb9 --- /dev/null +++ b/SOL012/PolicyManagement-API/schemas/Policies.schema.json @@ -0,0 +1,121 @@ +{ "type": "array", + "items": + { + "description": "This type represents an individual policy. It shall comply with the provisions defined in table 5.6.2.3-1.", + "type": "object", + "properties": { + "id": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "designer": { + "description": "Human readable name of the designer of the policy.\n", + "type": "string" + }, + "name": { + "description": "Human readable name of the policy.\n", + "type": "string" + }, + "pfId": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "versions": { + "description": "Versions of the policy. Shall be present if at least one version of the policy has been transferred.\n", + "type": "array", + "items": { + "description": "A version.\n", + "type": "string" + } + }, + "selectedVersion": { + "description": "A version.\n", + "type": "string" + }, + "activationStatus": { + "description": "The enumeration ActivationStatus shall comply with the provisions defined in table 5.6.4.3-1. It indicates the activation status of a policy.\n", + "type": "string", + "enum": [ + "ACTIVATED", + "DEACTIVATED" + ] + }, + "transferStatus": { + "description": "The enumeration TransferStatus shall comply with the provisions defined in table 5.6.4.4-1. It indicates the transfer status of a policy\n", + "type": "string", + "enum": [ + "CREATED", + "TRANSFERRED" + ] + }, + "associations": { + "description": "Identifiers of the entities that the PF manages and to which the policy associates to. Shall be absent when the association feature is not applicable for the PF. The associations refer to identifiers of entities that the PF manages. E.g., if the PF is a VNFM, the policy can associate to VNF instances; if the PF is NFVO, the policy can associate to an NS instances. How the PF determines the scope of applicability of the policy when this attribute is absent is outside the scope of the present document.\n", + "type": "array", + "items": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + } + }, + "_links": { + "description": "Links for this resource\n", + "type": "object", + "properties": { + "self": { + "description": "This type represents a link to a resource using an absolute URI.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "String formatted according to IETF RFC 3986.\n", + "type": "string" + } + } + }, + "selected": { + "description": "This type represents a link to a resource using an absolute URI.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "String formatted according to IETF RFC 3986.\n", + "type": "string" + } + } + }, + "versions": { + "description": "URIs of all the transferred versions of this policy, if exists.\n", + "type": "array", + "items": { + "description": "This type represents a link to a resource using an absolute URI.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "String formatted according to IETF RFC 3986.\n", + "type": "string" + } + } + } + } + }, + "required": [ + "self" + ] + } + }, + "required": [ + "id", + "designer", + "name", + "activationStatus", + "transferStatus", + "_links" + ] + } +} \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/schemas/Policy.schema.json b/SOL012/PolicyManagement-API/schemas/Policy.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..fdcdea95a697b56140ec9aa1fa9aedda5a9296b6 --- /dev/null +++ b/SOL012/PolicyManagement-API/schemas/Policy.schema.json @@ -0,0 +1,118 @@ +{ + "description": "This type represents an individual policy. It shall comply with the provisions defined in table 5.6.2.3-1.", + "type": "object", + "properties": { + "id": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "designer": { + "description": "Human readable name of the designer of the policy.\n", + "type": "string" + }, + "name": { + "description": "Human readable name of the policy.\n", + "type": "string" + }, + "pfId": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "versions": { + "description": "Versions of the policy. Shall be present if at least one version of the policy has been transferred.\n", + "type": "array", + "items": { + "description": "A version.\n", + "type": "string" + } + }, + "selectedVersion": { + "description": "A version.\n", + "type": "string" + }, + "activationStatus": { + "description": "The enumeration ActivationStatus shall comply with the provisions defined in table 5.6.4.3-1. It indicates the activation status of a policy.\n", + "type": "string", + "enum": [ + "ACTIVATED", + "DEACTIVATED" + ] + }, + "transferStatus": { + "description": "The enumeration TransferStatus shall comply with the provisions defined in table 5.6.4.4-1. It indicates the transfer status of a policy\n", + "type": "string", + "enum": [ + "CREATED", + "TRANSFERRED" + ] + }, + "associations": { + "description": "Identifiers of the entities that the PF manages and to which the policy associates to. Shall be absent when the association feature is not applicable for the PF. The associations refer to identifiers of entities that the PF manages. E.g., if the PF is a VNFM, the policy can associate to VNF instances; if the PF is NFVO, the policy can associate to an NS instances. How the PF determines the scope of applicability of the policy when this attribute is absent is outside the scope of the present document.\n", + "type": "array", + "items": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + } + }, + "_links": { + "description": "Links for this resource\n", + "type": "object", + "properties": { + "self": { + "description": "This type represents a link to a resource using an absolute URI.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "String formatted according to IETF RFC 3986.\n", + "type": "string" + } + } + }, + "selected": { + "description": "This type represents a link to a resource using an absolute URI.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "String formatted according to IETF RFC 3986.\n", + "type": "string" + } + } + }, + "versions": { + "description": "URIs of all the transferred versions of this policy, if exists.\n", + "type": "array", + "items": { + "description": "This type represents a link to a resource using an absolute URI.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "String formatted according to IETF RFC 3986.\n", + "type": "string" + } + } + } + } + }, + "required": [ + "self" + ] + } + }, + "required": [ + "id", + "designer", + "name", + "activationStatus", + "transferStatus", + "_links" + ] +} \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/schemas/PolicyChangeNotification.schema.json b/SOL012/PolicyManagement-API/schemas/PolicyChangeNotification.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..83c9979505a3d22baef8310dcff396839f376a50 --- /dev/null +++ b/SOL012/PolicyManagement-API/schemas/PolicyChangeNotification.schema.json @@ -0,0 +1,127 @@ +{ + "description": "This type represents a notification about policy change. It shall comply with the provisions defined in table 5.6.2.7-1. This notification shall be triggered by the API producer when a policy has been changed as the result of an operation of creating, transferring, deleting or modifying a policy.\n", + "type": "object", + "properties": { + "id": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "notificationType": { + "description": "A string defined in IETF RFC 8259.\n", + "type": "string" + }, + "subscriptionId": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "timeStamp": { + "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n", + "type": "string", + "format": "date-time" + }, + "policyId": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "affectedVersion": { + "description": "A version.\n", + "type": "string" + }, + "previousSelectedVersion": { + "description": "A version.\n", + "type": "string" + }, + "policyModifications": { + "description": "This type represents the parameters for modifying a policy. It shall comply with the provisions defined in table 5.6.2.4-1\n", + "type": "object", + "properties": { + "activationStatus": { + "description": "The enumeration ActivationStatus shall comply with the provisions defined in table 5.6.4.3-1. It indicates the activation status of a policy.\n", + "type": "string", + "enum": [ + "ACTIVATED", + "DEACTIVATED" + ] + }, + "selectedVersion": { + "description": "A version.\n", + "type": "string" + }, + "addAssociations": { + "description": "Identifiers of entities to be added to the “associations” attribute in the “Policy” data structure which represents the policy. The API producer shall ignore the identifiers that already exist in the \"associations\" attribute in the “Policy” data structure. Shall be absent when the association feature is not applicable for the PF.\n", + "type": "array", + "items": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + } + }, + "removeAssociations": { + "description": "Identifiers of entities to be removed from the “associations” attribute in the “Policy” data structure which represents the policy. The API producer shall ignore the identifiers that do not exist in the \"associations\" attribute in the “Policy” data structure. Shall be absent when the association feature is not applicable for the PF.\n", + "type": "array", + "items": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + } + }, + "removeAllAssociations": { + "description": "Shall be set to TRUE if the policy is no longer associated to any specific entities managed by the PF. Shall be absent when the association feature is not applicable for the PF. If \"removeAllAssociations\" is set to TRUE, neither \"addAssociations\" nor “removeAssociations” attributes shall be present. Once all associations have been removed, how the PF determines the scope of applicability of the policy is outside the scope of the present document.\n", + "type": "boolean" + } + } + }, + "changeType": { + "description": "The enumeration PolicyOperationType shall comply with the provisions defined in table 5.6.4.4-1. It indicates the type of the policy change. Permitted values: * CREATE_POLICY:\tThe policy is created. * TRANSFER_POLICY:\tThe policy is transferred. * DELETE_POLICY:\tThe policy is deleted. * MODIFY_POLICY:\tThe policy is modified.\n", + "type": "string", + "enum": [ + "CREATE_POLICY", + "TRANSFER_POLICY", + "DELETE_POLICY", + "MODIFY_POLICY" + ] + }, + "_links": { + "description": "Links to resources related to this notification.\n", + "type": "object", + "properties": { + "subscription": { + "description": "This type represents a link to a resource in a notification, using an absolute or relative URI.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "String formatted according to IETF RFC 3986.\n", + "type": "string" + } + } + }, + "objectInstance": { + "description": "This type represents a link to a resource in a notification, using an absolute or relative URI.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "String formatted according to IETF RFC 3986.\n", + "type": "string" + } + } + } + }, + "required": [ + "subscription" + ] + } + }, + "required": [ + "id", + "notificationType", + "subscriptionId", + "timeStamp", + "policyId", + "changeType", + "_links" + ] +} \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/schemas/PolicyConflictNotification.schema.json b/SOL012/PolicyManagement-API/schemas/PolicyConflictNotification.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..38809bf97bd9014585e435c1ac671012824535c7 --- /dev/null +++ b/SOL012/PolicyManagement-API/schemas/PolicyConflictNotification.schema.json @@ -0,0 +1,96 @@ +{ + "description": "This type represents a notification about policy conflict. It shall comply with the provisions defined in table 5.6.2.8-1. This notification shall be triggered by the API producer when a policy conflict is detected, and any of the policies specified in an associated notification subscription is impacted by the conflict.\n", + "type": "object", + "properties": { + "id": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "notificationType": { + "description": "A string defined in IETF RFC 8259.\n", + "type": "string" + }, + "subscriptionId": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "timeStamp": { + "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n", + "type": "string", + "format": "date-time" + }, + "policyIds": { + "description": "Identifiers of the conflicting policies. The policy identifier and the corresponding selected version are mapped by the order in the array.\n", + "type": "array", + "items": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "minItems": 2 + }, + "selectedVersions": { + "description": "Selected versions of the conflicting policies. The policy identifier and the corresponding selected version are mapped by the order in the array.\n", + "type": "array", + "items": { + "description": "A version.\n", + "type": "string" + }, + "minItems": 2 + }, + "conflictDescription": { + "description": "A string defined in IETF RFC 8259.\n", + "type": "string" + }, + "_links": { + "description": "Links to resources related to this notification.\n", + "type": "object", + "properties": { + "subscription": { + "description": "This type represents a link to a resource in a notification, using an absolute or relative URI.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "String formatted according to IETF RFC 3986.\n", + "type": "string" + } + } + }, + "objectInstances": { + "description": "Link to the resources representing the policies to which the notified conflict applies.\n", + "type": "array", + "items": { + "description": "This type represents a link to a resource in a notification, using an absolute or relative URI.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "String formatted according to IETF RFC 3986.\n", + "type": "string" + } + } + }, + "minItems": 2 + } + }, + "required": [ + "subscription", + "objectInstances" + ] + } + }, + "required": [ + "id", + "notificationType", + "subscriptionId", + "timeStamp", + "policyIds", + "selectedVersions", + "conflictDescription", + "_links" + ] +} \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/schemas/PolicyModifications.schema.json b/SOL012/PolicyManagement-API/schemas/PolicyModifications.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..163171af84aa07f0a8ae9e61b6f5ddd951940be9 --- /dev/null +++ b/SOL012/PolicyManagement-API/schemas/PolicyModifications.schema.json @@ -0,0 +1,45 @@ +{ + "description": "The parameter for the policy modifications, as defined in clause 5.6.2.4.\n", + "content": { + "application/json": { + "schema": { + "description": "This type represents the parameters for modifying a policy. It shall comply with the provisions defined in table 5.6.2.4-1\n", + "type": "object", + "properties": { + "activationStatus": { + "description": "The enumeration ActivationStatus shall comply with the provisions defined in table 5.6.4.3-1. It indicates the activation status of a policy.\n", + "type": "string", + "enum": [ + "ACTIVATED", + "DEACTIVATED" + ] + }, + "selectedVersion": { + "description": "A version.\n", + "type": "string" + }, + "addAssociations": { + "description": "Identifiers of entities to be added to the “associations” attribute in the “Policy” data structure which represents the policy. The API producer shall ignore the identifiers that already exist in the \"associations\" attribute in the “Policy” data structure. Shall be absent when the association feature is not applicable for the PF.\n", + "type": "array", + "items": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + } + }, + "removeAssociations": { + "description": "Identifiers of entities to be removed from the “associations” attribute in the “Policy” data structure which represents the policy. The API producer shall ignore the identifiers that do not exist in the \"associations\" attribute in the “Policy” data structure. Shall be absent when the association feature is not applicable for the PF.\n", + "type": "array", + "items": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + } + }, + "removeAllAssociations": { + "description": "Shall be set to TRUE if the policy is no longer associated to any specific entities managed by the PF. Shall be absent when the association feature is not applicable for the PF. If \"removeAllAssociations\" is set to TRUE, neither \"addAssociations\" nor “removeAssociations” attributes shall be present. Once all associations have been removed, how the PF determines the scope of applicability of the policy is outside the scope of the present document.\n", + "type": "boolean" + } + } + } + } + } +} \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/schemas/PolicySubscription.schema.json b/SOL012/PolicyManagement-API/schemas/PolicySubscription.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..388e5f92cc982b90fd4f15d6a4363ef4065220af --- /dev/null +++ b/SOL012/PolicyManagement-API/schemas/PolicySubscription.schema.json @@ -0,0 +1,80 @@ +{ + "description": "This type represents a subscription related to notifications about policy changes and policy conflicts. It shall comply with the provisions defined in table 5.6.2.6-1.\n", + "type": "object", + "properties": { + "id": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + }, + "filter": { + "description": "This type represents a subscription filter related to notifications about policy changes and policy conflicts. It shall comply with the provisions defined in table 5.6.3.2-1. At a particular nesting level in the filter structure, the following applies: All attributes shall match in order for the filter to match (logical \"and\" between different filter attributes). If an attribute is an array, the attribute shall match if at least one of the values in the array matches (logical \"or\" between the values of one filter attribute).\n", + "type": "object", + "properties": { + "notificationTypes": { + "description": "Match particular notification types. Permitted values: -\tPolicyChangeNotification -\tPolicyConflictNotification The permitted values of the \"notificationTypes\" attribute are spelled exactly as the names of the notification types to facilitate automated code generation systems.\n", + "type": "array", + "items": { + "type": "string", + "enum": [ + "PolicyChangeNotification", + "PolicyConflictNotification" + ] + } + }, + "policyIds": { + "description": "Match particular policy identifiers. For \"PolicyConflictNotification\", the notification is sent if any of the policies specified in the subscription is impacted by the conflict, as defined in clause 5.6.2.8.\n", + "type": "array", + "items": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + } + }, + "changeTypes": { + "description": "Match particular policy management operation types that cause the change of the policy.\n", + "type": "array", + "items": { + "description": "The enumeration PolicyOperationType shall comply with the provisions defined in table 5.6.4.4-1. It indicates the type of the policy change. Permitted values: * CREATE_POLICY:\tThe policy is created. * TRANSFER_POLICY:\tThe policy is transferred. * DELETE_POLICY:\tThe policy is deleted. * MODIFY_POLICY:\tThe policy is modified.\n", + "type": "string", + "enum": [ + "CREATE_POLICY", + "TRANSFER_POLICY", + "DELETE_POLICY", + "MODIFY_POLICY" + ] + } + } + } + }, + "callbackUri": { + "description": "String formatted according to IETF RFC 3986.\n", + "type": "string" + }, + "_links": { + "description": "Links for this resource.\n", + "type": "object", + "properties": { + "self": { + "description": "This type represents a link to a resource using an absolute URI.\n", + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "description": "String formatted according to IETF RFC 3986.\n", + "type": "string" + } + } + } + }, + "required": [ + "self" + ] + } + }, + "required": [ + "id", + "callbackUri", + "_links" + ] +} \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/schemas/PolicySubscriptionRequest.schema.json b/SOL012/PolicyManagement-API/schemas/PolicySubscriptionRequest.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..48e0587c954c6de9f49a257ed02edacad89a3753 --- /dev/null +++ b/SOL012/PolicyManagement-API/schemas/PolicySubscriptionRequest.schema.json @@ -0,0 +1,104 @@ +{ + "description": "This type represents a subscription request related to notifications about policy changes and policy conflicts. It shall comply with the provisions defined in table 5.6.2.5-1.\n", + "type": "object", + "properties": { + "filter": { + "description": "This type represents a subscription filter related to notifications about policy changes and policy conflicts. It shall comply with the provisions defined in table 5.6.3.2-1. At a particular nesting level in the filter structure, the following applies: All attributes shall match in order for the filter to match (logical \"and\" between different filter attributes). If an attribute is an array, the attribute shall match if at least one of the values in the array matches (logical \"or\" between the values of one filter attribute).\n", + "type": "object", + "properties": { + "notificationTypes": { + "description": "Match particular notification types. Permitted values: -\tPolicyChangeNotification -\tPolicyConflictNotification The permitted values of the \"notificationTypes\" attribute are spelled exactly as the names of the notification types to facilitate automated code generation systems.\n", + "type": "array", + "items": { + "type": "string", + "enum": [ + "PolicyChangeNotification", + "PolicyConflictNotification" + ] + } + }, + "policyIds": { + "description": "Match particular policy identifiers. For \"PolicyConflictNotification\", the notification is sent if any of the policies specified in the subscription is impacted by the conflict, as defined in clause 5.6.2.8.\n", + "type": "array", + "items": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + } + }, + "changeTypes": { + "description": "Match particular policy management operation types that cause the change of the policy.\n", + "type": "array", + "items": { + "description": "The enumeration PolicyOperationType shall comply with the provisions defined in table 5.6.4.4-1. It indicates the type of the policy change. Permitted values: * CREATE_POLICY:\tThe policy is created. * TRANSFER_POLICY:\tThe policy is transferred. * DELETE_POLICY:\tThe policy is deleted. * MODIFY_POLICY:\tThe policy is modified.\n", + "type": "string", + "enum": [ + "CREATE_POLICY", + "TRANSFER_POLICY", + "DELETE_POLICY", + "MODIFY_POLICY" + ] + } + } + } + }, + "callbackUri": { + "description": "String formatted according to IETF RFC 3986.\n", + "type": "string" + }, + "authentication": { + "type": "object", + "required": [ + "authType" + ], + "properties": { + "authType": { + "description": "Defines the types of Authentication / Authorization which the API consumer is willing to accept when receiving a notification. Permitted values: * BASIC: In every HTTP request to the notification endpoint, use\n HTTP Basic authentication with the client credentials.\n* OAUTH2_CLIENT_CREDENTIALS: In every HTTP request to the\n notification endpoint, use an OAuth 2.0 Bearer token, obtained\n using the client credentials grant type.\n* TLS_CERT: Every HTTP request to the notification endpoint is sent\n over a mutually authenticated TLS session, i.e. not only the\n server is authenticated, but also the client is authenticated\n during the TLS tunnel setup.\n", + "type": "array", + "items": { + "type": "string", + "enum": [ + "BASIC", + "OAUTH2_CLIENT_CREDENTIALS", + "TLS_CERT" + ] + } + }, + "paramsBasic": { + "description": "Parameters for authentication/authorization using BASIC. Shall be present if authType is \"BASIC\" and the contained information has not been provisioned out of band. Shall be absent otherwise.\n", + "type": "object", + "properties": { + "userName": { + "description": "Username to be used in HTTP Basic authentication. Shall be present if it has not been provisioned out of band.\n", + "type": "string" + }, + "password": { + "description": "Password to be used in HTTP Basic authentication. Shall be present if it has not been provisioned out of band.\n", + "type": "string" + } + } + }, + "paramsOauth2ClientCredentials": { + "description": "Parameters for authentication/authorization using OAUTH2_CLIENT_CREDENTIALS. Shall be present if authType is \"OAUTH2_CLIENT_CREDENTIALS\" and the contained information has not been provisioned out of band. Shall be absent otherwise.\n", + "type": "object", + "properties": { + "clientId": { + "description": "Client identifier to be used in the access token request of the OAuth 2.0 client credentials grant type. Shall be present if it has not been provisioned out of band. The clientId and clientPassword passed in a subscription shall not be the same as the clientId and clientPassword that are used to obtain authorization for API requests. Client credentials may differ between subscriptions. The value of clientPassword should be generated by a random process.\n", + "type": "string" + }, + "clientPassword": { + "description": "Client password to be used in the access token request of the OAuth 2.0 client credentials grant type. Shall be present if it has not been provisioned out of band. The clientId and clientPassword passed in a subscription shall not be the same as the clientId and clientPassword that are used to obtain authorization for API requests. Client credentials may differ between subscriptions. The value of clientPassword should be generated by a random process.\n", + "type": "string" + }, + "tokenEndpoint": { + "description": "String formatted according to IETF RFC 3986.\n", + "type": "string" + } + } + } + } + } + }, + "required": [ + "callbackUri" + ] +} \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/schemas/ProblemDetails.schema.json b/SOL012/PolicyManagement-API/schemas/ProblemDetails.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..62f17612725e72a6cb3c3a6379aa697f5fc1ae08 --- /dev/null +++ b/SOL012/PolicyManagement-API/schemas/ProblemDetails.schema.json @@ -0,0 +1,34 @@ +{ + "definitions": {}, + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n", + "properties": { + "type": { + "type": "string", + "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n", + "format": "URI" + }, + "title": { + "type": "string", + "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n" + }, + "status": { + "type": "integer", + "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n" + }, + "detail": { + "type": "string", + "description": "A human-readable explanation specific to this occurrence of the problem.\n" + }, + "instance": { + "type": "string", + "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n", + "format": "URI" + } + }, + "required": [ + "status", + "detail" + ] +} \ No newline at end of file diff --git a/SOL012/PolicyManagement-API/schemas/subscriptions.schema.json b/SOL012/PolicyManagement-API/schemas/subscriptions.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..6cae848c333700450aff26b3d0dcfadc02844a13 --- /dev/null +++ b/SOL012/PolicyManagement-API/schemas/subscriptions.schema.json @@ -0,0 +1,109 @@ +{ + "type": "array", + "items": + { + "description": "This type represents a subscription request related to notifications about policy changes and policy conflicts. It shall comply with the provisions defined in table 5.6.2.5-1.\n", + "type": "object", + "properties": { + "filter": { + "description": "This type represents a subscription filter related to notifications about policy changes and policy conflicts. It shall comply with the provisions defined in table 5.6.3.2-1. At a particular nesting level in the filter structure, the following applies: All attributes shall match in order for the filter to match (logical \"and\" between different filter attributes). If an attribute is an array, the attribute shall match if at least one of the values in the array matches (logical \"or\" between the values of one filter attribute).\n", + "type": "object", + "properties": { + "notificationTypes": { + "description": "Match particular notification types. Permitted values: -\tPolicyChangeNotification -\tPolicyConflictNotification The permitted values of the \"notificationTypes\" attribute are spelled exactly as the names of the notification types to facilitate automated code generation systems.\n", + "type": "array", + "items": { + "type": "string", + "enum": [ + "PolicyChangeNotification", + "PolicyConflictNotification" + ] + } + }, + "policyIds": { + "description": "Match particular policy identifiers. For \"PolicyConflictNotification\", the notification is sent if any of the policies specified in the subscription is impacted by the conflict, as defined in clause 5.6.2.8.\n", + "type": "array", + "items": { + "description": "An identifier with the intention of being globally unique.\n", + "type": "string" + } + }, + "changeTypes": { + "description": "Match particular policy management operation types that cause the change of the policy.\n", + "type": "array", + "items": { + "description": "The enumeration PolicyOperationType shall comply with the provisions defined in table 5.6.4.4-1. It indicates the type of the policy change. Permitted values: * CREATE_POLICY:\tThe policy is created. * TRANSFER_POLICY:\tThe policy is transferred. * DELETE_POLICY:\tThe policy is deleted. * MODIFY_POLICY:\tThe policy is modified.\n", + "type": "string", + "enum": [ + "CREATE_POLICY", + "TRANSFER_POLICY", + "DELETE_POLICY", + "MODIFY_POLICY" + ] + } + } + } + }, + "callbackUri": { + "description": "String formatted according to IETF RFC 3986.\n", + "type": "string" + }, + "authentication": { + "type": "object", + "required": [ + "authType" + ], + "properties": { + "authType": { + "description": "Defines the types of Authentication / Authorization which the API consumer is willing to accept when receiving a notification. Permitted values: * BASIC: In every HTTP request to the notification endpoint, use\n HTTP Basic authentication with the client credentials.\n* OAUTH2_CLIENT_CREDENTIALS: In every HTTP request to the\n notification endpoint, use an OAuth 2.0 Bearer token, obtained\n using the client credentials grant type.\n* TLS_CERT: Every HTTP request to the notification endpoint is sent\n over a mutually authenticated TLS session, i.e. not only the\n server is authenticated, but also the client is authenticated\n during the TLS tunnel setup.\n", + "type": "array", + "items": { + "type": "string", + "enum": [ + "BASIC", + "OAUTH2_CLIENT_CREDENTIALS", + "TLS_CERT" + ] + } + }, + "paramsBasic": { + "description": "Parameters for authentication/authorization using BASIC. Shall be present if authType is \"BASIC\" and the contained information has not been provisioned out of band. Shall be absent otherwise.\n", + "type": "object", + "properties": { + "userName": { + "description": "Username to be used in HTTP Basic authentication. Shall be present if it has not been provisioned out of band.\n", + "type": "string" + }, + "password": { + "description": "Password to be used in HTTP Basic authentication. Shall be present if it has not been provisioned out of band.\n", + "type": "string" + } + } + }, + "paramsOauth2ClientCredentials": { + "description": "Parameters for authentication/authorization using OAUTH2_CLIENT_CREDENTIALS. Shall be present if authType is \"OAUTH2_CLIENT_CREDENTIALS\" and the contained information has not been provisioned out of band. Shall be absent otherwise.\n", + "type": "object", + "properties": { + "clientId": { + "description": "Client identifier to be used in the access token request of the OAuth 2.0 client credentials grant type. Shall be present if it has not been provisioned out of band. The clientId and clientPassword passed in a subscription shall not be the same as the clientId and clientPassword that are used to obtain authorization for API requests. Client credentials may differ between subscriptions. The value of clientPassword should be generated by a random process.\n", + "type": "string" + }, + "clientPassword": { + "description": "Client password to be used in the access token request of the OAuth 2.0 client credentials grant type. Shall be present if it has not been provisioned out of band. The clientId and clientPassword passed in a subscription shall not be the same as the clientId and clientPassword that are used to obtain authorization for API requests. Client credentials may differ between subscriptions. The value of clientPassword should be generated by a random process.\n", + "type": "string" + }, + "tokenEndpoint": { + "description": "String formatted according to IETF RFC 3986.\n", + "type": "string" + } + } + } + } + } + }, + "required": [ + "callbackUri" + ] +} + +} \ No newline at end of file