Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 26 Next »

This page details the test specification for ACM for all new and existing functionality.


Prerequisites

  • Access to a development laptop capable of running many docker containers
  • Access to a Kubernetes cluster, either locally or remotely (if carrying out kubernetes participant tests)

Environment Setup

The immediate components like, acm, participants, databases etc will be deployed in your local environment using docker compose configurations from the policy/docker repo details are in the documentation here. However, we want to add mock participants for http, k8s and policy participants. So, we have to replace the docker-compose.yaml  in the policy/docker `/compose` directory with this one

Once this change is made, we can bring up all our required components with `./start-compose.sh policy-clamp-runtime-acm`

Test Group Setup Steps


Steps for Scenario SetupScenario Finish Steps
Successful Endpoint Interaction

Non-Successful Endpoint Interaction

Failure Handling Scenario
  1. Deploy relevant policy components with instructions give in the above section
  2. In this case, we will be testing that the behaviour of the participant is correct in failure situations
  3. The mock participant can be used for http, k8s and policy participants
  4. Mock participant is also deployed with the policy docker compose.
  5. There is a postman collection specifically for the failure handling scenario here
  6. Once the docker containers are deployed, you can confirm their health with the healthcheck calls specified in the collection for acm and the participants.
  7. After each test or set of tests, the relevant calls in directory "Cleanup ACs" should be run. e.g. undeploy, deprime etc.

Participant Set Properties Scenario
  1. Deploy relevant policy components with instructions give in the above section
  2. In this case, we will be testing that the behaviour of the participant is correct when the participant is used to set properties in "outProperties"
  3. The mock participant can be used for http, k8s and policy participants - the example will be for the http participant
  4. Mock participant is also deployed with the policy docker compose.
  5. There is a postman collection specifically for the participant set properties scenario here
  6. Once the docker containers are deployed, you can confirm their health with the healthcheck calls specified in the collection for acm and the participants.
  7. After each test or set of tests, the relevant calls in directory "Cleanup ACs" should be run. e.g. undeploy, deprime etc.

Participant Restart Scenario

Multiple Simultaneous Message Scenario

Timeout Scenario
  1. Deploy relevant policy components with instructions give in the above section
  2. In this case, we will be testing that the behaviour of the acm timeout functionality is correct.
  3. The mock participant can be used for http, k8s and policy participants - the example will be for the http participant
  4. Mock participant is also deployed with the policy docker compose.
  5. As the timeout is specifically set in the properties file of the ACM runtime, a special properties file is added here, which must be supplied to the docker-compose.yaml file.
  6. There is a postman collection specifically for the timeout scenario here
  7. Once the docker containers are deployed, you can confirm their health with the healthcheck calls specified in the collection for acm and the participants.
  8. After each test or set of tests, the relevant calls in directory "Cleanup ACs" should be run.
  9. Note that, by default, the timeout threshold is set to 30 seconds. The participant time to carry out different operations (priming, deploying etc) is set to 100 seconds by default.
  10. Once the state of the instance or definition is in TIMEOUT, that means the user can cancel the operation with a rest call. For example, if the PRIME is in TIMEOUT, the user can DEPRIME.

Update Scenario

Check Validation Scenario




Test Cases

In all test cases, that are calling rest endpoints, it is the ACM rest API that is being called. The url prefix to each rest call is: IP_ADDRESS:RUNTIME_PORT/onap/policy/clamp/acm/v2/. Use the provided POSTMAN collection to make the relevant calls.

Functionality Being TestedTitleTest caseStepsExpected ResultTest Result
PASS/FAIL
NotesMock Participant
Failure HandlingPrime AC Def and confirm test failure from from http, k8s and policy participantsPrime AC def - http, k8s and policy participants should send back error message
  1. Call each put request in the "Prime Failure Scenario" directory - each should return 200
  2. Call "Create AC Definition" - response should be 201
  3. Call "Priming AC definition" - response should be 202
  4. Finally call "Get commission"

200 response

In the response json, we should see – "state": "PRIMING" – and also a message in each element "Prime failed!"


HTTP Participant, K8s Participant, Policy ParticipantY
Failure HandlingDeprime AC Def and confirm test failure from from http, k8s and policy participantsDeprime AC def - http, k8s and policy participants should send back error message
  1. Call each put request in the "Deprime Failure Scenario" directory - each should return 200
  2. Call "Create AC Definition" - response should be 201
  3. Call "Priming AC definition" - response should be 202
  4. Call "Depriming AC definition" - response should be 202
  5. Finally call "Get commission"

200 response

In the response json, we should see – "state": "PRIMED" – and also a message in each element "Deprime failed!"


HTTP Participant, K8s Participant, Policy ParticipantY
Failure HandlingDeploy AC instance and confirm test failure from http, k8s and policy participantsDeploy AC instance - http, k8s and policy participants should send back error message
  1. Call each put request in the "Deploy Failure Scenario" directory - each should return 200
  2. Call "Create AC Definition" - response should be 201
  3. Call "Priming AC definition" - response should be 202
  4. Call "Instantiation AC" - response should be 201
  5. Call "Deploy Instantiated" - response should be 202
  6. Finally, we call "Get Instantiated List" and should get a 200 response

200 response with an "automationCompositionList"

In the JSON returned, the instance deployState should be "DEPLOYING"

Each element should contain the message "Deploy failed!"


HTTP Participant, K8s Participant, Policy ParticipantY
Failure HandlingUndeploy AC instance and confirm test failure from from http, k8s and policy participantsUndeploy AC instance - http, k8s and policy participants should send back error message
  1. Call each put request in the "Undeploy Failure Scenario" directory - each should return 200
  2. Call "Create AC Definition" - response should be 201
  3. Call "Priming AC definition" - response should be 202
  4. Call "Instantiation AC" - response should be 201
  5. Call "Deploy Instantiated" - response should be 202
  6. Call "Get Instantiated List" and should get a 200 response and we should see the "deployState: DEPLOYED" for the overall AC.
  7. Now, we call the "Undeploy Instantiated" call from the collection and should get a 202 response
  8. Call "Get Instantiated List" once again

200 response

we should see the overall "deployState: UNDEPLOYING" with a message in each element that says "Deployed"


HTTP Participant, K8s Participant, Policy ParticipantY
Failure HandlingDelete AC instance and confirm test failure from from http, k8s and policy participantsDelete AC instance - http, k8s and policy participants should send back error message
  1. Call each put request in the "Delete Failure Scenario" directory - each should return 200
  2. Call "Create AC Definition" - response should be 201
  3. Call "Priming AC definition" - response should be 202
  4. Call "Instantiation AC" - response should be 201
  5. Call "Deploy Instantiated" - response should be 202
  6. Call "Get Instantiated List" and should get a 200 response and we should see the "deployState: DEPLOYED" for the overall AC.
  7. Now, we call the "Undeploy Instantiated" call from the collection and should get a 202 response
  8. Then, we can call "Delete Instantiated" - should get a 202
  9. Finally, Call "Get Instantiated List" once again

200 response with an "automationCompositionList"

In the JSON returned, the instance deployState should be "DELETING"

Each element should contain the message "Undeployed"


HTTP Participant, K8s Participant, Policy ParticipantY
Failure HandlingUpdate AC instance and confirm test failure from from http, k8s and policy participantsUpdate AC instance - http, k8s and policy participants should send back error message
  1. Call each put request in the "Update Failure Scenario" directory - each should return 200
  2. Call "Create AC Definition" - response should be 201
  3. Call "Priming AC definition" - response should be 202
  4. Call "Instantiation AC" - response should be 201
  5. Call "Deploy Instantiated" - response should be 202
  6. Call "Get Instantiated List" and should get a 200 response and we should see the "deployState: DEPLOYED" for the overall AC.
  7. Now, we call the "Update Instantiation AC" call from the collection and should get a 200 response
  8. Finally, Call "Get Instantiated List" once again

200 response with an "automationCompositionList"

In the JSON returned, the instance deployState should be "UPDATING"

Each element should contain the message "Update failed!"


HTTP Participant, K8s Participant, Policy Participant


Y
Failure HandlingUnlock AC instance and confirm test failure from from http, k8s and policy participantsUnlock AC instance - http, k8s and policy participants should send back error message
  1. Call each put request in the "Unlock Failure Scenario" directory - each should return 200
  2. Call "Create AC Definition" - response should be 201
  3. Call "Priming AC definition" - response should be 202
  4. Call "Instantiation AC" - response should be 201
  5. Call "Deploy Instantiated" - response should be 202
  6. Call "Get Instantiated List" and should get a 200 response and we should see the "deployState: DEPLOYED" for the overall AC.
  7. Now, we call the "Unlock Instantiated" call from the collection and should get a 202 response
  8. Finally, Call "Get Instantiated List" once again

200 response with an "automationCompositionList"

In the JSON returned, the instance deployState should be "UNLOCKING"

Each element should contain the message "Unlock failed!"


HTTP Participant, K8s Participant, Policy ParticipantY
Failure HandlingLock AC instance and confirm test failure from from http, k8s and policy participantsLock AC instance - http, k8s and policy participants should send back error message
  1. Call each put request in the "Unlock Failure Scenario" directory - each should return 200
  2. Call "Create AC Definition" - response should be 201
  3. Call "Priming AC definition" - response should be 202
  4. Call "Instantiation AC" - response should be 201
  5. Call "Deploy Instantiated" - response should be 202
  6. Call "Get Instantiated List" and should get a 200 response and we should see the "deployState: DEPLOYED" for the overall AC.
  7. Now, we call the "Unlock Instantiated" call from the collection and should get a 202 response
  8. Then, call "Lock Instantiated" from the collection - should get a 202 response
  9. Finally, Call "Get Instantiated List" once again

200 response with an "automationCompositionList"

In the JSON returned, the instance deployState should be "LOCKING"

Each element should contain the message "Unlocked"


HTTP Participant, K8s Participant, Policy ParticipantY








TimeoutPrime AC Def and confirm timeout from from http, k8s and policy participantsPrime AC def - http, k8s and policy participants operation should timeout after 30 seconds
  1. Call each put request in the "Prime Timeout Scenario" directory - each should return 200
  2. Call "Create AC Definition" - response should be 201
  3. Call "Priming AC definition" - response should be 202
  4. Wait 30 seconds.
  5. Call "Get commission" - should have a 200 response. In the response json, we should see – "state": "PRIMING" – and also a stateChangeResult: TIMEOUT.
  6. At this stage, because the operation timed out (after 30 seconds), we can deprime (should be before the 100 second priming success time). Call "Depriming AC definition" - response should be 202.
  7. Call "GET Commission" once again.

200 response

In the response json, we should see – "state": "COMMISSIONED" – and also a stateChangeResult: NO_ERROR - so depriming has worked after the timeout.


HTTP Participant, K8s Participant, Policy ParticipantY
TimeoutDeprime AC Def and confirm timeout from from http, k8s and policy participantsDeprime AC def - http, k8s and policy participants should timeout after 30 seconds
  1. Call each put request in the "Deprime Timeout Scenario" directory - each should return 200
  2. Call "Create AC Definition" - response should be 201
  3. Call "Priming AC definition" - response should be 202
  4. Call "Depriming AC definition" - response should be 202
  5. Wait 30 seconds
  6. Call "Get commission" - should have a 200 response. In the response json, we should see – "state": "DEPRIMING" – and also a stateChangeResult: TIMEOUT.
  7. At this stage, because the operation timed out (after 30 seconds), we can re-prime (should be before the 100 second depriming success time). Call "Priming AC definition" - response should be 202.
  8. Call "Get commission"

200 response

In the response json, we should see – "state": "PRIMED" – and also a stateChangeResult: NO_ERROR


HTTP Participant, K8s Participant, Policy ParticipantY
TimeoutDeploy AC instance and confirm timeout from http, k8s and policy participantsDeploy AC instance - http, k8s and policy participants should timeout after 30 seconds
  1. Call each put request in the "Deploy Timeout Scenario" directory - each should return 200
  2. Call "Create AC Definition" - response should be 201
  3. Call "Priming AC definition" - response should be 202
  4. Call "Instantiation AC" - response should be 201
  5. Call "Deploy Instantiated" - response should be 202
  6. Wait 30 seconds
  7. Call "Get Instantiated List" and should get a 200 response. The stateChangeResult should be TIMEOUT.
  8. At this stage, because the operation timed out (after 30 seconds), we can undeploy (should be before the 100 second undeploy success time). Call "Undeploy Instantiated" - response should be 202.
  9. Call "Get Instantiated List"

200 response with an "automationCompositionList"

In the JSON returned, the instance deployState should be "UNDEPLOYED"


HTTP Participant, K8s Participant, Policy ParticipantY
TimeoutUndeploy AC instance and confirm timeout from from http, k8s and policy participantsUndeploy AC instance - http, k8s and policy participants should timeout after 30 seconds
  1. Call each put request in the "Undeploy Timeout Scenario" directory - each should return 200
  2. Call "Create AC Definition" - response should be 201
  3. Call "Priming AC definition" - response should be 202
  4. Call "Instantiation AC" - response should be 201
  5. Call "Deploy Instantiated" - response should be 202
  6. Call "Undeploy Instantiated" - response should be 202
  7. Wait 30 seconds
  8. Call "Get Instantiated List" and should get a 200 response The stateChangeResult should be TIMEOUT.
  9. At this stage, because the operation timed out (after 30 seconds), we can deploy (should be before the 100 second undeploy success time). Call "Deploy Instantiated" - response should be 202.
  10. Call "Get Instantiated List" once again

200 response

we should see the overall "deployState: DEPLOYED" with a message in each element that says "Deployed"


HTTP Participant, K8s Participant, Policy ParticipantY
TimeoutDelete AC instance and confirm test failure from from http, k8s and policy participantsDelete AC instance - http, k8s and policy participants should send back error message
  1. Call each put request in the "Delete Failure Scenario" directory - each should return 200
  2. Call "Create AC Definition" - response should be 201
  3. Call "Priming AC definition" - response should be 202
  4. Call "Instantiation AC" - response should be 201
  5. Call "Deploy Instantiated" - response should be 202
  6. Call "Get Instantiated List" and should get a 200 response and we should see the "deployState: DEPLOYED" for the overall AC.
  7. Now, we call the "Undeploy Instantiated" call from the collection and should get a 202 response
  8. Then, we can call "Delete Instantiated" - should get a 202
  9. Finally, Call "Get Instantiated List" once again

200 response with an "automationCompositionList"

In the JSON returned, the instance deployState should be "DELETING"

Each element should contain the message "Undeployed"


HTTP Participant, K8s Participant, Policy ParticipantY
TimeoutUpdate AC instance and confirm test failure from from http, k8s and policy participantsUpdate AC instance - http, k8s and policy participants should send back error message
  1. Call each put request in the "Update Failure Scenario" directory - each should return 200
  2. Call "Create AC Definition" - response should be 201
  3. Call "Priming AC definition" - response should be 202
  4. Call "Instantiation AC" - response should be 201
  5. Call "Deploy Instantiated" - response should be 202
  6. Call "Get Instantiated List" and should get a 200 response and we should see the "deployState: DEPLOYED" for the overall AC.
  7. Now, we call the "Update Instantiation AC" call from the collection and should get a 200 response
  8. Finally, Call "Get Instantiated List" once again

200 response with an "automationCompositionList"

In the JSON returned, the instance deployState should be "UPDATING"

Each element should contain the message "Update failed!"


HTTP Participant, K8s Participant, Policy Participant


Y
TimeoutUnlock AC instance and confirm test failure from from http, k8s and policy participantsUnlock AC instance - http, k8s and policy participants should send back error message
  1. Call each put request in the "Unlock Failure Scenario" directory - each should return 200
  2. Call "Create AC Definition" - response should be 201
  3. Call "Priming AC definition" - response should be 202
  4. Call "Instantiation AC" - response should be 201
  5. Call "Deploy Instantiated" - response should be 202
  6. Call "Get Instantiated List" and should get a 200 response and we should see the "deployState: DEPLOYED" for the overall AC.
  7. Now, we call the "Unlock Instantiated" call from the collection and should get a 202 response
  8. Finally, Call "Get Instantiated List" once again

200 response with an "automationCompositionList"

In the JSON returned, the instance deployState should be "UNLOCKING"

Each element should contain the message "Unlock failed!"


HTTP Participant, K8s Participant, Policy ParticipantY
TimeoutLock AC instance and confirm test failure from from http, k8s and policy participantsLock AC instance - http, k8s and policy participants should send back error message
  1. Call each put request in the "Unlock Failure Scenario" directory - each should return 200
  2. Call "Create AC Definition" - response should be 201
  3. Call "Priming AC definition" - response should be 202
  4. Call "Instantiation AC" - response should be 201
  5. Call "Deploy Instantiated" - response should be 202
  6. Call "Get Instantiated List" and should get a 200 response and we should see the "deployState: DEPLOYED" for the overall AC.
  7. Now, we call the "Unlock Instantiated" call from the collection and should get a 202 response
  8. Then, call "Lock Instantiated" from the collection - should get a 202 response
  9. Finally, Call "Get Instantiated List" once again

200 response with an "automationCompositionList"

In the JSON returned, the instance deployState should be "LOCKING"

Each element should contain the message "Unlocked"


HTTP Participant, K8s Participant, Policy ParticipantY








Participant Out PropertiesSet outProperties using the participant and retrieve them from the databaseAny properties we set on the participant-side "outProperties" object should be retrievable from ACM
  1. Call "Create AC Definition" - response should be 201
  2. Call "Priming AC definition" - response should be 202
  3. Call "Instantiation AC" - response should be 201
  4. Call "Deploy Instantiated" - response should be 202
  5. Call "Get Instantiated List" and should get a 200 response and we should see the "deployState: DEPLOYED" for the overall AC. We should also be able to see an empty "outProperties" object under the http element.
  6. Call "Set outProperties in http-participant" - the response should be 200.
  7. Finally, Call "Get Instantiated List".

200 response with an "automationCompositionList"

The outProperties object should now look like the json illustrated in the next column



"outProperties": {
  "deleteAll": "true",
  "nest": {
    "birdone": "sparrow",
    "birdtwo": "cuckoo",
  "egg": 4
  },
  "list": [
    {
      "id": 1
    },
    {
      "id": 2
    }
  ]
}

Y
Participant Out PropertiesTry to Set outProperties using the participant and retrieve them from the database before the instance is deployedAny properties we set on the participant-side "outProperties" object should not be retrievable from ACM before the instance is deployed
  1. Call "Create AC Definition" - response should be 201
  2. Call "Priming AC definition" - response should be 202
  3. Call "Instantiation AC" - response should be 201
  4. Call "Get Instantiated List" and should get a 200 response and we should see the "deployState: DEPLOYED" for the overall AC. We should also be able to see an empty "outProperties" object under the http element.
  5. Call "Set outProperties in http-participant" - the response should be 200.
  6. Finally, Call "Get Instantiated List".

200 response with an "automationCompositionList"

The outProperties object should be empty as before




Y








Multiple Messages Scenario
LOCK the instance in "DEPLOYING/UNLOCKING"
 state
Execute PUT request on runtime acm.
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId}}/instances/{{instanceId}}
200 Response
The runtime should allow undeploy operation and deleting the instance when one or more element is stuck in DEPLOYING state



Non-Successful Endpoint InteractionDelete AC defintion after primingDelete the commissioned defintion type2 after
priming
Execute DELETE request on runtime acm endpoint
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId2}}
400 Bad Request response.
Should not allow to delete when primed

"ACM not in COMMISSIONED state, Update of ACM Definition not allowed"
Non-Successful Endpoint InteractionUpdate AC definition after primingUpdate AC definition type 2 after primingExecute PUT request on runtime acm endpoint
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId2}}
406 Not acceptable response
Should not allow to update when primed



Non-Successful Endpoint InteractionShut down participant and DeployShutdown one of the participants and trigger
deployment
Remove one of the participant.
Execute PUT request on runtime acm endpoint
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId1}}/instances/{{instanceId1}}
406 Not acceptable response.
Verify if runtime is restricting the deploy operation when one
or more associated particpant is OFFLINE

Needs updating because of new validation that ppnt is online
Non-Successful Endpoint InteractionDelete AC instance with OFFLINE
participant
Delete the AC instance after removing
participant
Execute DELETE request on runtime-acm
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId2}}/instances/{{instanceId2}}
202 Response
Verify if runtime accepts the delete  AC instance request when the associated participant is in OFFLINE state
The overall state is stuck in DELETING and updated to TIMEOUT after the configured timeout is reached
Verify the user is allowed to order a state change after TIMEOUT is reached

Needs updating because of new validation that ppnt is online
Non-Successful Endpoint InteractionDeprime AC defintion with
 OFFLINE participant
Deprime AC defintion when the participant is
OFFLINE

Make sure the AC instance is deleted and shutdown the participant again.
Execute PUT request on runtime acm endpoint
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId}}
202 Response
Verify the runtime allows to Deprime the definitions from all
the participants when one of the participant is OFFLINE
Verify the AC state is stuck in DEPRIMING and updated to TIMEOUT after the configured timeout is reached.

Needs updating because of new validation that ppnt is online
Non-Successful Endpoint Interaction
Verify restricted operations in deployed stateTry to perform the following operations
Delete the AC instance2
Deprime the Ac definition 2
Update the AC instance 2
All the perfomed operations should return 400 response. The instances should not be allowed to get
deleted or deprimed in Deployed state. Update IS allowed now



Non-Successful Endpoint InteractionUpdate AC instance property after participant shutdownShutdown participant and trigger UPDATEShutdown the participant and trigger the update
property event on the runtime as per the steps specified above
Verify if the rest request is accepted with 202 response
Verify the PROPERTIES_UPDATE event is sent to the participants from runtime-acm.
The ACM instance state should be "UPDATING" until the properties update is completed in the participant.
The AC state should be updated as TIMEOUT after the configured timeout in runtime

This should be updated because the operation will no longer be allowed by ACM if the participant is OFFLINE
Non-Successful Endpoint InteractionShut down participant on
UNLOCKED state
Shut down one of the participants on UNLOCKED stateManually stop one of the participants ???
Verify the behaviour of runtime when the participant is OFFLINE and the instances are deployed(it depend how restart will be implemented)

This should be updated because the operation will no longer be allowed by ACM if the participant is OFFLINE
Restart TestingRestart acm runtimeRestart runtime applicationManually restart the container or mvn applicationVerify if the runtime comes up and running and get synced with the
database. Retrieve participants and compositions from runtime endpoint.

microk8s kubectl delete pod policy-clamp-runtime-acm-7ff68ff9fd-kllb7
pod "policy-clamp-runtime-acm-7ff68ff9fd-kllb7" deleted

Restart TestingShut down participant after
priming
Restart any of the participantManually restart the container or mvn application
Execute GET request on the runtime-acm endpoint
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/participants/
Participants should get registered and get the primed definitions  from runtime once they are up again.


Restart Testing
Shut down any of the participantDelete one of the participants permanently.
Execute GET request on the runtime-acm endpoint
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/participants/
Verify the removed participants should have been marked OFFLINE by the runtime.
Verify fetching the automation compositions where the element of removed participants should not have participant ids associated. (it depend how restart will be implemented)

It needs 10 minutes on my deployment after requesting a Participant Report from all participants
Restart TestingRestart participant after PrimingRestart any of the participantManually restart the container or mvn applicationFetch participants list from runtime, restarted participant should get reregistered with runtime again.
Fetch commisioned defintions, it should have elements with restarted participant id associated



Successful Endpoint InteractionVerify Participant RegistrationVerify all the participantsExecute GET request on the runtime-acm endpoint
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/participants/
Verify all the deployed participants with their Ids and current status  are retrieved


Successful Endpoint InteractionCRUD
Automation Composition Types
Create Automation Composition Type 1Execute POST request on the runtime-acm endpoint to create AC
definition via Tosca service template
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions
201 Response with compositionId


Successful Endpoint Interaction
Create Automation composition Type 2Execute POST request on the runtime-acm endpoint to create a different AC definition via Tosca service template
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions
201 Response with compositionId


Successful Endpoint InteractionUpdate AC defintionUpdate the AC type 1 with some changes
in the common properties
Execute PUT request on runtime acm endpoint
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId1}}
201 Response with composition Id


Successful Endpoint InteractionDelete AC defintionDelete the Ac type 2 Execute DELETE request on runtime acm endpoint
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId2}}
200 Response 


Successful Endpoint InteractionFetch Commisioned definition before PrimingGet all the commisioned definitions from  dbExecute GET request on the runtime-acm endpoint
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions
Verify two AC definitions are  retrieved with all the elements.
 No participant Ids should have been associated with the elements yet before priming

{
    "service_templates": [
        {
            "tosca_definitions_version": "tosca_simple_yaml_1_3",
            "data_types": {
                "onap.datatypes.ToscaConceptIdentifier": {
                    "properties": {
                        "name": {
                            "name": "name",
                            "type": "string",
                            "type_version": "0.0.0",
                            "required": true
                        },
                        "version": {
                            "name": "version",
                            "type": "string",
                            "type_version": "0.0.0",
                            "required": true
                        }
                    },
                    "name": "onap.datatypes.ToscaConceptIdentifier",
                    "version": "0.0.0",
                    "derived_from": "tosca.datatypes.Root",
                    "metadata": {}
                },
                "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.RestRequest": {
                    "properties": {
                        "restRequestId": {
                            "name": "restRequestId",
                            "type": "onap.datatypes.ToscaConceptIdentifier",
                            "type_version": "0.0.0",
                            "description": "The name and version of a REST request to be sent to a REST endpoint",
                            "required": true
                        },
                        "httpMethod": {
                            "name": "httpMethod",
                            "type": "string",
                            "type_version": "0.0.0",
                            "description": "The REST method to use",
                            "required": true,
                            "constraints": [
                                {
                                    "valid_values": [
                                        "POST",
                                        "PUT",
                                        "GET",
                                        "DELETE"
                                    ]
                                }
                            ]
                        },
                        "path": {
                            "name": "path",
                            "type": "string",
                            "type_version": "0.0.0",
                            "description": "The path of the REST request relative to the base URL",
                            "required": true
                        },
                        "body": {
                            "name": "body",
                            "type": "string",
                            "type_version": "0.0.0",
                            "description": "The body of the REST request for PUT and POST requests",
                            "required": false
                        },
                        "expectedResponse": {
                            "name": "expectedResponse",
                            "type": "integer",
                            "type_version": "0.0.0",
                            "description": "THe expected HTTP status code for the REST request",
                            "required": true,
                            "constraints": []
                        }
                    },
                    "name": "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.RestRequest",
                    "version": "1.0.0",
                    "derived_from": "tosca.datatypes.Root",
                    "metadata": {}
                },
                "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.ConfigurationEntity": {
                    "properties": {
                        "configurationEntityId": {
                            "name": "configurationEntityId",
                            "type": "onap.datatypes.ToscaConceptIdentifier",
                            "type_version": "0.0.0",
                            "description": "The name and version of a Configuration Entity to be handled by the HTTP Automation Composition Element",
                            "required": true
                        },
                        "restSequence": {
                            "name": "restSequence",
                            "type": "list",
                            "type_version": "0.0.0",
                            "description": "A sequence of REST commands to send to the REST endpoint",
                            "required": false,
                            "entry_schema": {
                                "type": "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.RestRequest",
                                "type_version": "1.0.0"
                            }
                        }
                    },
                    "name": "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.ConfigurationEntity",
                    "version": "1.0.0",
                    "derived_from": "tosca.datatypes.Root",
                    "metadata": {}
                }
            },
            "node_types": {
                "org.onap.policy.clamp.acm.Participant": {
                    "properties": {
                        "provider": {
                            "name": "provider",
                            "type": "string",
                            "type_version": "0.0.0",
                            "required": false
                        }
                    },
                    "name": "org.onap.policy.clamp.acm.Participant",
                    "version": "1.0.1",
                    "derived_from": "tosca.nodetypes.Root",
                    "metadata": {}
                },
                "org.onap.policy.clamp.acm.AutomationCompositionElement": {
                    "properties": {
                        "provider": {
                            "name": "provider",
                            "type": "string",
                            "type_version": "0.0.0",
                            "description": "Specifies the organization that provides the automation composition element",
                            "required": false,
                            "metadata": {
                                "common": "true"
                            }
                        },
                        "startPhase": {
                            "name": "startPhase",
                            "type": "integer",
                            "type_version": "0.0.0",
                            "description": "A value indicating the start phase in which this automation composition element will be started, the first start phase is zero. Automation Composition Elements are started in their start_phase order and stopped in reverse start phase order. Automation Composition Elements with the same start phase are started and stopped simultaneously",
                            "required": false,
                            "constraints": [
                                {
                                    "greater_or_equal": "0"
                                }
                            ],
                            "metadata": {
                                "common": "true"
                            }
                        },
                        "uninitializedToPassiveTimeout": {
                            "name": "uninitializedToPassiveTimeout",
                            "type": "integer",
                            "type_version": "0.0.0",
                            "description": "The maximum time in seconds to wait for a state chage from uninitialized to passive",
                            "default": 60.0,
                            "required": false,
                            "constraints": [
                                {
                                    "greater_or_equal": "0"
                                }
                            ],
                            "metadata": {
                                "common": "true"
                            }
                        },
                        "passiveToRunningTimeout": {
                            "name": "passiveToRunningTimeout",
                            "type": "integer",
                            "type_version": "0.0.0",
                            "description": "The maximum time in seconds to wait for a state chage from passive to running",
                            "default": 60.0,
                            "required": false,
                            "constraints": [
                                {
                                    "greater_or_equal": "0"
                                }
                            ],
                            "metadata": {
                                "common": "true"
                            }
                        },
                        "runningToPassiveTimeout": {
                            "name": "runningToPassiveTimeout",
                            "type": "integer",
                            "type_version": "0.0.0",
                            "description": "The maximum time in seconds to wait for a state chage from running to passive",
                            "default": 60.0,
                            "required": false,
                            "constraints": [
                                {
                                    "greater_or_equal": "0"
                                }
                            ],
                            "metadata": {
                                "common": "true"
                            }
                        },
                        "passiveToUninitializedTimeout": {
                            "name": "passiveToUninitializedTimeout",
                            "type": "integer",
                            "type_version": "0.0.0",
                            "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized",
                            "default": 60.0,
                            "required": false,
                            "constraints": [
                                {
                                    "greater_or_equal": "0"
                                }
                            ],
                            "metadata": {
                                "common": "true"
                            }
                        }
                    },
                    "name": "org.onap.policy.clamp.acm.AutomationCompositionElement",
                    "version": "1.0.1",
                    "derived_from": "tosca.nodetypes.Root",
                    "metadata": {}
                },
                "org.onap.policy.clamp.acm.AutomationComposition": {
                    "properties": {
                        "provider": {
                            "name": "provider",
                            "type": "string",
                            "type_version": "0.0.0",
                            "description": "Specifies the organization that provides the automation composition element",
                            "required": false,
                            "metadata": {
                                "common": "true"
                            }
                        },
                        "elements": {
                            "name": "elements",
                            "type": "list",
                            "type_version": "0.0.0",
                            "description": "Specifies a list of automation composition element definitions that make up this automation composition definition",
                            "required": true,
                            "entry_schema": {
                                "type": "onap.datatypes.ToscaConceptIdentifier",
                                "type_version": "0.0.0"
                            },
                            "metadata": {
                                "common": "true"
                            }
                        }
                    },
                    "name": "org.onap.policy.clamp.acm.AutomationComposition",
                    "version": "1.0.1",
                    "derived_from": "tosca.nodetypes.Root",
                    "metadata": {}
                },
                "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement": {
                    "properties": {
                        "chart": {
                            "name": "chart",
                            "type": "string",
                            "type_version": "0.0.0",
                            "required": true
                        },
                        "configs": {
                            "name": "configs",
                            "type": "list",
                            "type_version": "0.0.0",
                            "required": false
                        },
                        "requirements": {
                            "name": "requirements",
                            "type": "string",
                            "type_version": "0.0.0",
                            "required": false
                        },
                        "templates": {
                            "name": "templates",
                            "type": "list",
                            "type_version": "0.0.0",
                            "required": false
                        },
                        "values": {
                            "name": "values",
                            "type": "string",
                            "type_version": "0.0.0",
                            "required": true
                        }
                    },
                    "name": "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement",
                    "version": "1.0.0",
                    "derived_from": "org.onap.policy.clamp.acm.AutomationCompositionElement",
                    "metadata": {}
                },
                "org.onap.policy.clamp.acm.HttpAutomationCompositionElement": {
                    "properties": {
                        "baseUrl": {
                            "name": "baseUrl",
                            "type": "string",
                            "type_version": "0.0.0",
                            "description": "The base URL to be prepended to each path, identifies the host for the REST endpoints.",
                            "required": true
                        },
                        "httpHeaders": {
                            "name": "httpHeaders",
                            "type": "map",
                            "type_version": "0.0.0",
                            "description": "HTTP headers to send on REST requests",
                            "required": false,
                            "entry_schema": {
                                "type": "string",
                                "type_version": "0.0.0"
                            }
                        },
                        "configurationEntities": {
                            "name": "configurationEntities",
                            "type": "map",
                            "type_version": "0.0.0",
                            "description": "The connfiguration entities the Automation Composition Element is managing and their associated REST requests",
                            "required": true,
                            "entry_schema": {
                                "type": "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.ConfigurationEntity",
                                "type_version": "1.0.0"
                            }
                        }
                    },
                    "name": "org.onap.policy.clamp.acm.HttpAutomationCompositionElement",
                    "version": "1.0.0",
                    "derived_from": "org.onap.policy.clamp.acm.AutomationCompositionElement",
                    "metadata": {}
                }
            },
            "topology_template": {
                "node_templates": {
                    "org.onap.k8s.acm.K8SAutomationCompositionParticipant": {
                        "type": "org.onap.policy.clamp.acm.Participant",
                        "type_version": "1.0.1",
                        "properties": {
                            "provider": "ONAP"
                        },
                        "name": "org.onap.k8s.acm.K8SAutomationCompositionParticipant",
                        "version": "2.3.4",
                        "metadata": {},
                        "description": "Participant for K8S"
                    },
                    "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement": {
                        "type": "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement",
                        "type_version": "1.0.0",
                        "properties": {
                            "provider": "ONAP",
                            "startPhase": 0,
                            "uninitializedToPassiveTimeout": 300,
                            "podStatusCheckInterval": 30
                        },
                        "name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement",
                        "version": "1.2.3",
                        "metadata": {},
                        "description": "Automation composition element for the K8S microservice for AC Element Starter"
                    },
                    "onap.policy.clamp.ac.element.K8S_BridgeAutomationCompositionElement": {
                        "type": "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement",
                        "type_version": "1.0.0",
                        "properties": {
                            "provider": "ONAP",
                            "startPhase": 0,
                            "uninitializedToPassiveTimeout": 300,
                            "podStatusCheckInterval": 30
                        },
                        "name": "onap.policy.clamp.ac.element.K8S_BridgeAutomationCompositionElement",
                        "version": "1.2.3",
                        "metadata": {},
                        "description": "Automation composition element for the K8S microservice for AC Element Bridge"
                    },
                    "onap.policy.clamp.ac.element.K8S_SinkAutomationCompositionElement": {
                        "type": "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement",
                        "type_version": "1.0.0",
                        "properties": {
                            "provider": "ONAP",
                            "startPhase": 0,
                            "uninitializedToPassiveTimeout": 300,
                            "podStatusCheckInterval": 30
                        },
                        "name": "onap.policy.clamp.ac.element.K8S_SinkAutomationCompositionElement",
                        "version": "1.2.3",
                        "metadata": {},
                        "description": "Automation composition element for the K8S microservice for AC Element Sink"
                    },
                    "org.onap.policy.clamp.acm.HttpParticipant": {
                        "type": "org.onap.policy.clamp.acm.Participant",
                        "type_version": "1.0.1",
                        "properties": {
                            "provider": "ONAP"
                        },
                        "name": "org.onap.policy.clamp.acm.HttpParticipant",
                        "version": "2.3.4",
                        "metadata": {},
                        "description": "Participant for Http requests"
                    },
                    "onap.policy.clamp.ac.element.Http_StarterAutomationCompositionElement": {
                        "type": "org.onap.policy.clamp.acm.HttpAutomationCompositionElement",
                        "type_version": "1.0.0",
                        "properties": {
                            "provider": "ONAP",
                            "uninitializedToPassiveTimeout": 300,
                            "startPhase": 1
                        },
                        "name": "onap.policy.clamp.ac.element.Http_StarterAutomationCompositionElement",
                        "version": "1.2.3",
                        "metadata": {},
                        "description": "Automation composition element for the http requests of AC Element Starter microservice"
                    },
                    "onap.policy.clamp.ac.element.Http_BridgeAutomationCompositionElement": {
                        "type": "org.onap.policy.clamp.acm.HttpAutomationCompositionElement",
                        "type_version": "1.0.0",
                        "properties": {
                            "provider": "ONAP",
                            "uninitializedToPassiveTimeout": 300,
                            "startPhase": 1
                        },
                        "name": "onap.policy.clamp.ac.element.Http_BridgeAutomationCompositionElement",
                        "version": "1.2.3",
                        "metadata": {},
                        "description": "Automation composition element for the http requests of AC Element Bridge microservice"
                    },
                    "onap.policy.clamp.ac.element.Http_SinkAutomationCompositionElement": {
                        "type": "org.onap.policy.clamp.acm.HttpAutomationCompositionElement",
                        "type_version": "1.0.0",
                        "properties": {
                            "provider": "ONAP",
                            "uninitializedToPassiveTimeout": 300,
                            "startPhase": 1
                        },
                        "name": "onap.policy.clamp.ac.element.Http_SinkAutomationCompositionElement",
                        "version": "1.2.3",
                        "metadata": {},
                        "description": "Automation composition element for the http requests of AC Element Sink microservice"
                    },
                    "onap.policy.clamp.ac.element.AutomationCompositionDefinition": {
                        "type": "org.onap.policy.clamp.acm.AutomationComposition",
                        "type_version": "1.0.1",
                        "properties": {
                            "provider": "ONAP",
                            "elements": [
                                {
                                    "name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement",
                                    "version": "1.2.3"
                                },
                                {
                                    "name": "onap.policy.clamp.ac.element.K8S_BridgeAutomationCompositionElement",
                                    "version": "1.2.3"
                                },
                                {
                                    "name": "onap.policy.clamp.ac.element.K8S_SinkAutomationCompositionElement",
                                    "version": "1.2.3"
                                },
                                {
                                    "name": "onap.policy.clamp.ac.element.Http_StarterAutomationCompositionElement",
                                    "version": "1.2.3"
                                },
                                {
                                    "name": "onap.policy.clamp.ac.element.Http_BridgeAutomationCompositionElement",
                                    "version": "1.2.3"
                                },
                                {
                                    "name": "onap.policy.clamp.ac.element.Http_SinkAutomationCompositionElement",
                                    "version": "1.2.3"
                                }
                            ]
                        },
                        "name": "onap.policy.clamp.ac.element.AutomationCompositionDefinition",
                        "version": "1.2.3",
                        "metadata": {},
                        "description": "Automation composition for Demo"
                    }
                },
                "policies": []
            },
            "name": "tosca",
            "version": "1.0.0",
            "metadata": {
                "compositionId": "8c3f8b69-7464-40dc-b034-0f73f200729f"
            }
        }
    ]
}

Successful Endpoint InteractionPrimingPrime AC definition 1Make sure both AC type 1 and 2 are commissioned.
Execute PUT request on the runtime-acm endpoint
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId1}}
Note: {{compositionId1}} is retrieved from the previous test response
202 response


Successful Endpoint Interaction
Prime AC definition 2Execute PUT request on the runtime-acm endpoint
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId2}}
Note: {{compositionId2}} is retrieved from the previous test response
202 response
Create the composition Type 2 again after it was deleted earlier
Successful Endpoint InteractionFetch Commisioned definition after  PrimingGet all the commisioned definitions from  dbExecute GET request on the runtime-acm endpoint
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions
Two AC definitions retrieved with all the elements.
 Participant Ids should have been associated for each element

{
    "service_templates": [
        {
            "tosca_definitions_version": "tosca_simple_yaml_1_3",
            "data_types": {
                "onap.datatypes.ToscaConceptIdentifier": {
                    "properties": {
                        "name": {
                            "name": "name",
                            "type": "string",
                            "type_version": "0.0.0",
                            "required": true
                        },
                        "version": {
                            "name": "version",
                            "type": "string",
                            "type_version": "0.0.0",
                            "required": true
                        }
                    },
                    "name": "onap.datatypes.ToscaConceptIdentifier",
                    "version": "0.0.0",
                    "derived_from": "tosca.datatypes.Root",
                    "metadata": {}
                },
                "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.RestRequest": {
                    "properties": {
                        "restRequestId": {
                            "name": "restRequestId",
                            "type": "onap.datatypes.ToscaConceptIdentifier",
                            "type_version": "0.0.0",
                            "description": "The name and version of a REST request to be sent to a REST endpoint",
                            "required": true
                        },
                        "httpMethod": {
                            "name": "httpMethod",
                            "type": "string",
                            "type_version": "0.0.0",
                            "description": "The REST method to use",
                            "required": true,
                            "constraints": [
                                {
                                    "valid_values": [
                                        "POST",
                                        "PUT",
                                        "GET",
                                        "DELETE"
                                    ]
                                }
                            ]
                        },
                        "path": {
                            "name": "path",
                            "type": "string",
                            "type_version": "0.0.0",
                            "description": "The path of the REST request relative to the base URL",
                            "required": true
                        },
                        "body": {
                            "name": "body",
                            "type": "string",
                            "type_version": "0.0.0",
                            "description": "The body of the REST request for PUT and POST requests",
                            "required": false
                        },
                        "expectedResponse": {
                            "name": "expectedResponse",
                            "type": "integer",
                            "type_version": "0.0.0",
                            "description": "THe expected HTTP status code for the REST request",
                            "required": true,
                            "constraints": []
                        }
                    },
                    "name": "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.RestRequest",
                    "version": "1.0.0",
                    "derived_from": "tosca.datatypes.Root",
                    "metadata": {}
                },
                "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.ConfigurationEntity": {
                    "properties": {
                        "configurationEntityId": {
                            "name": "configurationEntityId",
                            "type": "onap.datatypes.ToscaConceptIdentifier",
                            "type_version": "0.0.0",
                            "description": "The name and version of a Configuration Entity to be handled by the HTTP Automation Composition Element",
                            "required": true
                        },
                        "restSequence": {
                            "name": "restSequence",
                            "type": "list",
                            "type_version": "0.0.0",
                            "description": "A sequence of REST commands to send to the REST endpoint",
                            "required": false,
                            "entry_schema": {
                                "type": "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.RestRequest",
                                "type_version": "1.0.0"
                            }
                        }
                    },
                    "name": "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.ConfigurationEntity",
                    "version": "1.0.0",
                    "derived_from": "tosca.datatypes.Root",
                    "metadata": {}
                }
            },
            "node_types": {
                "org.onap.policy.clamp.acm.Participant": {
                    "properties": {
                        "provider": {
                            "name": "provider",
                            "type": "string",
                            "type_version": "0.0.0",
                            "required": false
                        }
                    },
                    "name": "org.onap.policy.clamp.acm.Participant",
                    "version": "1.0.1",
                    "derived_from": "tosca.nodetypes.Root",
                    "metadata": {}
                },
                "org.onap.policy.clamp.acm.AutomationCompositionElement": {
                    "properties": {
                        "provider": {
                            "name": "provider",
                            "type": "string",
                            "type_version": "0.0.0",
                            "description": "Specifies the organization that provides the automation composition element",
                            "required": false,
                            "metadata": {
                                "common": "true"
                            }
                        },
                        "startPhase": {
                            "name": "startPhase",
                            "type": "integer",
                            "type_version": "0.0.0",
                            "description": "A value indicating the start phase in which this automation composition element will be started, the first start phase is zero. Automation Composition Elements are started in their start_phase order and stopped in reverse start phase order. Automation Composition Elements with the same start phase are started and stopped simultaneously",
                            "required": false,
                            "constraints": [
                                {
                                    "greater_or_equal": "0"
                                }
                            ],
                            "metadata": {
                                "common": "true"
                            }
                        },
                        "uninitializedToPassiveTimeout": {
                            "name": "uninitializedToPassiveTimeout",
                            "type": "integer",
                            "type_version": "0.0.0",
                            "description": "The maximum time in seconds to wait for a state chage from uninitialized to passive",
                            "default": 60.0,
                            "required": false,
                            "constraints": [
                                {
                                    "greater_or_equal": "0"
                                }
                            ],
                            "metadata": {
                                "common": "true"
                            }
                        },
                        "passiveToRunningTimeout": {
                            "name": "passiveToRunningTimeout",
                            "type": "integer",
                            "type_version": "0.0.0",
                            "description": "The maximum time in seconds to wait for a state chage from passive to running",
                            "default": 60.0,
                            "required": false,
                            "constraints": [
                                {
                                    "greater_or_equal": "0"
                                }
                            ],
                            "metadata": {
                                "common": "true"
                            }
                        },
                        "runningToPassiveTimeout": {
                            "name": "runningToPassiveTimeout",
                            "type": "integer",
                            "type_version": "0.0.0",
                            "description": "The maximum time in seconds to wait for a state chage from running to passive",
                            "default": 60.0,
                            "required": false,
                            "constraints": [
                                {
                                    "greater_or_equal": "0"
                                }
                            ],
                            "metadata": {
                                "common": "true"
                            }
                        },
                        "passiveToUninitializedTimeout": {
                            "name": "passiveToUninitializedTimeout",
                            "type": "integer",
                            "type_version": "0.0.0",
                            "description": "The maximum time in seconds to wait for a state chage from passive to uninitialized",
                            "default": 60.0,
                            "required": false,
                            "constraints": [
                                {
                                    "greater_or_equal": "0"
                                }
                            ],
                            "metadata": {
                                "common": "true"
                            }
                        }
                    },
                    "name": "org.onap.policy.clamp.acm.AutomationCompositionElement",
                    "version": "1.0.1",
                    "derived_from": "tosca.nodetypes.Root",
                    "metadata": {}
                },
                "org.onap.policy.clamp.acm.AutomationComposition": {
                    "properties": {
                        "provider": {
                            "name": "provider",
                            "type": "string",
                            "type_version": "0.0.0",
                            "description": "Specifies the organization that provides the automation composition element",
                            "required": false,
                            "metadata": {
                                "common": "true"
                            }
                        },
                        "elements": {
                            "name": "elements",
                            "type": "list",
                            "type_version": "0.0.0",
                            "description": "Specifies a list of automation composition element definitions that make up this automation composition definition",
                            "required": true,
                            "entry_schema": {
                                "type": "onap.datatypes.ToscaConceptIdentifier",
                                "type_version": "0.0.0"
                            },
                            "metadata": {
                                "common": "true"
                            }
                        }
                    },
                    "name": "org.onap.policy.clamp.acm.AutomationComposition",
                    "version": "1.0.1",
                    "derived_from": "tosca.nodetypes.Root",
                    "metadata": {}
                },
                "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement": {
                    "properties": {
                        "chart": {
                            "name": "chart",
                            "type": "string",
                            "type_version": "0.0.0",
                            "required": true
                        },
                        "configs": {
                            "name": "configs",
                            "type": "list",
                            "type_version": "0.0.0",
                            "required": false
                        },
                        "requirements": {
                            "name": "requirements",
                            "type": "string",
                            "type_version": "0.0.0",
                            "required": false
                        },
                        "templates": {
                            "name": "templates",
                            "type": "list",
                            "type_version": "0.0.0",
                            "required": false
                        },
                        "values": {
                            "name": "values",
                            "type": "string",
                            "type_version": "0.0.0",
                            "required": true
                        }
                    },
                    "name": "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement",
                    "version": "1.0.0",
                    "derived_from": "org.onap.policy.clamp.acm.AutomationCompositionElement",
                    "metadata": {}
                },
                "org.onap.policy.clamp.acm.HttpAutomationCompositionElement": {
                    "properties": {
                        "baseUrl": {
                            "name": "baseUrl",
                            "type": "string",
                            "type_version": "0.0.0",
                            "description": "The base URL to be prepended to each path, identifies the host for the REST endpoints.",
                            "required": true
                        },
                        "httpHeaders": {
                            "name": "httpHeaders",
                            "type": "map",
                            "type_version": "0.0.0",
                            "description": "HTTP headers to send on REST requests",
                            "required": false,
                            "entry_schema": {
                                "type": "string",
                                "type_version": "0.0.0"
                            }
                        },
                        "configurationEntities": {
                            "name": "configurationEntities",
                            "type": "map",
                            "type_version": "0.0.0",
                            "description": "The connfiguration entities the Automation Composition Element is managing and their associated REST requests",
                            "required": true,
                            "entry_schema": {
                                "type": "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.ConfigurationEntity",
                                "type_version": "1.0.0"
                            }
                        }
                    },
                    "name": "org.onap.policy.clamp.acm.HttpAutomationCompositionElement",
                    "version": "1.0.0",
                    "derived_from": "org.onap.policy.clamp.acm.AutomationCompositionElement",
                    "metadata": {}
                }
            },
            "topology_template": {
                "node_templates": {
                    "org.onap.k8s.acm.K8SAutomationCompositionParticipant": {
                        "type": "org.onap.policy.clamp.acm.Participant",
                        "type_version": "1.0.1",
                        "properties": {
                            "provider": "ONAP"
                        },
                        "name": "org.onap.k8s.acm.K8SAutomationCompositionParticipant",
                        "version": "2.3.4",
                        "metadata": {},
                        "description": "Participant for K8S"
                    },
                    "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement": {
                        "type": "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement",
                        "type_version": "1.0.0",
                        "properties": {
                            "provider": "ONAP",
                            "startPhase": 0,
                            "uninitializedToPassiveTimeout": 300,
                            "podStatusCheckInterval": 30
                        },
                        "name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement",
                        "version": "1.2.3",
                        "metadata": {},
                        "description": "Automation composition element for the K8S microservice for AC Element Starter"
                    },
                    "onap.policy.clamp.ac.element.K8S_BridgeAutomationCompositionElement": {
                        "type": "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement",
                        "type_version": "1.0.0",
                        "properties": {
                            "provider": "ONAP",
                            "startPhase": 0,
                            "uninitializedToPassiveTimeout": 300,
                            "podStatusCheckInterval": 30
                        },
                        "name": "onap.policy.clamp.ac.element.K8S_BridgeAutomationCompositionElement",
                        "version": "1.2.3",
                        "metadata": {},
                        "description": "Automation composition element for the K8S microservice for AC Element Bridge"
                    },
                    "onap.policy.clamp.ac.element.K8S_SinkAutomationCompositionElement": {
                        "type": "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement",
                        "type_version": "1.0.0",
                        "properties": {
                            "provider": "ONAP",
                            "startPhase": 0,
                            "uninitializedToPassiveTimeout": 300,
                            "podStatusCheckInterval": 30
                        },
                        "name": "onap.policy.clamp.ac.element.K8S_SinkAutomationCompositionElement",
                        "version": "1.2.3",
                        "metadata": {},
                        "description": "Automation composition element for the K8S microservice for AC Element Sink"
                    },
                    "org.onap.policy.clamp.acm.HttpParticipant": {
                        "type": "org.onap.policy.clamp.acm.Participant",
                        "type_version": "1.0.1",
                        "properties": {
                            "provider": "ONAP"
                        },
                        "name": "org.onap.policy.clamp.acm.HttpParticipant",
                        "version": "2.3.4",
                        "metadata": {},
                        "description": "Participant for Http requests"
                    },
                    "onap.policy.clamp.ac.element.Http_StarterAutomationCompositionElement": {
                        "type": "org.onap.policy.clamp.acm.HttpAutomationCompositionElement",
                        "type_version": "1.0.0",
                        "properties": {
                            "provider": "ONAP",
                            "uninitializedToPassiveTimeout": 300,
                            "startPhase": 1
                        },
                        "name": "onap.policy.clamp.ac.element.Http_StarterAutomationCompositionElement",
                        "version": "1.2.3",
                        "metadata": {},
                        "description": "Automation composition element for the http requests of AC Element Starter microservice"
                    },
                    "onap.policy.clamp.ac.element.Http_BridgeAutomationCompositionElement": {
                        "type": "org.onap.policy.clamp.acm.HttpAutomationCompositionElement",
                        "type_version": "1.0.0",
                        "properties": {
                            "provider": "ONAP",
                            "uninitializedToPassiveTimeout": 300,
                            "startPhase": 1
                        },
                        "name": "onap.policy.clamp.ac.element.Http_BridgeAutomationCompositionElement",
                        "version": "1.2.3",
                        "metadata": {},
                        "description": "Automation composition element for the http requests of AC Element Bridge microservice"
                    },
                    "onap.policy.clamp.ac.element.Http_SinkAutomationCompositionElement": {
                        "type": "org.onap.policy.clamp.acm.HttpAutomationCompositionElement",
                        "type_version": "1.0.0",
                        "properties": {
                            "provider": "ONAP",
                            "uninitializedToPassiveTimeout": 300,
                            "startPhase": 1
                        },
                        "name": "onap.policy.clamp.ac.element.Http_SinkAutomationCompositionElement",
                        "version": "1.2.3",
                        "metadata": {},
                        "description": "Automation composition element for the http requests of AC Element Sink microservice"
                    },
                    "onap.policy.clamp.ac.element.AutomationCompositionDefinition": {
                        "type": "org.onap.policy.clamp.acm.AutomationComposition",
                        "type_version": "1.0.1",
                        "properties": {
                            "provider": "ONAP",
                            "elements": [
                                {
                                    "name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement",
                                    "version": "1.2.3"
                                },
                                {
                                    "name": "onap.policy.clamp.ac.element.K8S_BridgeAutomationCompositionElement",
                                    "version": "1.2.3"
                                },
                                {
                                    "name": "onap.policy.clamp.ac.element.K8S_SinkAutomationCompositionElement",
                                    "version": "1.2.3"
                                },
                                {
                                    "name": "onap.policy.clamp.ac.element.Http_StarterAutomationCompositionElement",
                                    "version": "1.2.3"
                                },
                                {
                                    "name": "onap.policy.clamp.ac.element.Http_BridgeAutomationCompositionElement",
                                    "version": "1.2.3"
                                },
                                {
                                    "name": "onap.policy.clamp.ac.element.Http_SinkAutomationCompositionElement",
                                    "version": "1.2.3"
                                }
                            ]
                        },
                        "name": "onap.policy.clamp.ac.element.AutomationCompositionDefinition",
                        "version": "1.2.3",
                        "metadata": {},
                        "description": "Automation composition for Demo"
                    }
                },
                "policies": []
            },
            "name": "tosca",
            "version": "1.0.0",
            "metadata": {
                "compositionId": "19210df5-c5bf-4431-862a-82b148cfb668"
            }
        },
        {
            "tosca_definitions_version": "tosca_simple_yaml_1_3",
            "data_types": {
                "onap.datatypes.ToscaConceptIdentifier": {
                    "properties": {
                        "name": {
                            "name": "name",
                            "type": "string",
                            "type_version": "0.0.0",
                            "required": true
                        },
                        "version": {
                            "name": "version",
                            "type": "string",
                            "type_version": "0.0.0",
                            "required": true
                        }
                    },
                    "name": "onap.datatypes.ToscaConceptIdentifier",
                    "version": "0.0.0",
                    "derived_from": "tosca.datatypes.Root",
                    "metadata": {}
                },
                "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.RestRequest": {
                    "properties": {
                        "restRequestId": {
                            "name": "restRequestId",
                            "type": "onap.datatypes.ToscaConceptIdentifier",
                            "type_version": "0.0.0",
                            "description": "The name and version of a REST request to be sent to a REST endpoint",
                            "required": true
                        },
                        "httpMethod": {
                            "name": "httpMethod",
                            "type": "string",
                            "type_version": "0.0.0",
                            "description": "The REST method to use",
                            "required": true,
                            "constraints": [
                                {
                                    "valid_values": [
                                        "POST",
                                        "PUT",
                                        "GET",
                                        "DELETE"
                                    ]
                                }
                            ]
                        },
                        "path": {
                            "name": "path",
                            "type": "string",
                            "type_version": "0.0.0",
                            "description": "The path of the REST request relative to the base URL",
                            "required": true
                        },
                        "body": {
                            "name": "body",
                            "type": "string",
                            "type_version": "0.0.0",
                            "description": "The body of the REST request for PUT and POST requests",
                            "required": false
                        },
                        "expectedResponse": {
                            "name": "expectedResponse",
                            "type": "integer",
                            "type_version": "0.0.0",
                            "description": "THe expected HTTP status code for the REST request",
                            "required": true,
                            "constraints": []
                        }
                    },
                    "name": "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.RestRequest",
                    "version": "1.0.0",
                    "derived_from": "tosca.datatypes.Root",
                    "metadata": {}
                },
                "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.ConfigurationEntity": {
                    "properties": {
                        "configurationEntityId": {
                            "name": "configurationEntityId",
                            "type": "onap.datatypes.ToscaConceptIdentifier",
                            "type_version": "0.0.0",
                            "description": "The name and version of a Configuration Entity to be handled by the HTTP Automation Composition Element",
                            "required": true
                        },
                        "restSequence": {
                            "name": "restSequence",
                            "type": "list",
                            "type_version": "0.0.0",
                            "description": "A sequence of REST commands to send to the REST endpoint",
                            "required": false,
                            "entry_schema": {
                                "type": "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.RestRequest",
                                "type_version": "1.0.0"
                            }
                        }
                    },
                    "name": "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.ConfigurationEntity",
                    "version": "1.0.0",
                    "derived_from": "tosca.datatypes.Root",
                    "metadata": {}
                }
            },
            "node_types": {
                "org.onap.policy.clamp.acm.Participant": {
                    "properties": {
                        "provider": {
                            "name": "provider",
                            "type": "string",
                            "type_version": "0.0.0",
                            "required": false
                        }
                    },
                    "name": "org.onap.policy.clamp.acm.Participant",
                    "version": "1.0.1",
                    "derived_from": "tosca.nodetypes.Root",
                    "metadata": {}
                },
                "org.onap.policy.clamp.acm.AutomationCompositionElement": {
                    "properties": {
                        "provider": {
                            "name": "provider",
                            "type": "string",
                            "type_version": "0.0.0",
                            "description": "Specifies the organization that provides the automation composition element",
                            "required": false,
                            "metadata": {
                                "common": "true"
                            }
                        },
                        "startPhase": {
                            "name": "startPhase",
                            "type": "integer",
                            "type_version": "0.0.0",
                            "description": "A value indicating the start phase in which this automation composition element will be started, the first start phase is zero. Automation Composition Elements are started in their start_phase order and stopped in reverse start phase order. Automation Composition Elements with the same start phase are started and stopped simultaneously",
                            "required": false,
                            "constraints": [
                                {
                                    "greater_or_equal": "0"
                                }
                            ],
                            "metadata": {
                                "common": "true"
                            }
                        },
                        "uninitializedToPassiveTimeout": {
                            "name": "uninitializedToPassiveTimeout",
                            "type": "integer",
                            "type_version": "0.0.0",
                            "description": "The maximum time in seconds to wait for a state chage from uninitialized to passive",
                            "default": 60.0,
                            "required": false,
                            "constraints": [
                                {
                    

Successful Endpoint InteractionCreate AC instanceCreate AC instance 1Execute POST request on runtime-acm
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId1}}/instances
200 Response with InstanceId


Successful Endpoint Interaction
Create AC instance 2Execute POST request on runtime-acm
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId2}}/instances
200 Response with InstanceId


Successful Endpoint InteractionUpdate AC instanceUpdate AC instance1 with wrong paramterExecute PUT request on runtime-acm
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId1}}/instances
200 Response with Instance id


Successful Endpoint InteractionUndeploy AC instanceUndeploy AC instance 1Execute PUT request on runtime acm endpoint
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId1}}/instances/{{instanceId1}}

Execute GET request on runtime acm endpoint
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId1}}/instances/{{instanceId1}}
202 Response.
Verify the AC instance's is "UNDEPLOYED"



Successful Endpoint InteractionUpdate AC instanceUpdate AC instance1 with correct paramterExecute PUT request on runtime-acm
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId1}}/instances
200 Response with Instance id


Successful Endpoint InteractionDelete AC instanceDelete AC instance2Execute DELETE request on runtime-acm
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId2}}/instances/{{instanceId2}}
200 Response 


Successful Endpoint InteractionDeploy AC instanceDeploy AC instance 1Make sure AC instance 1 and 2 are created.
Execute PUT request on runtime acm endpoint
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId1}}/instances/{{instanceId1}}

Execute GET request on runtime acm endpoint
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId1}}/instances/{{instanceId1}}
202 Response.
Verify the AC instance's admin state is "LOCKED".
No operation has been carried out by the participants. Depending on the participant being used and whether it has a specific implementation of lock and unlock.



Successful Endpoint Interaction
Deploy AC instance 2Execute PUT request on runtime acm endpoint
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId2}}/instances/{{instanceId2}}
202 Response.
Verify the AC instance's admin state is "LOCKED".
No operation has been carried out by the participants. Depending on the participant being used and whether it has a specific implementation of lock and unlock.



Successful Endpoint Interaction
Get deployed instance by idExecute GET request on runtime ACM
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId}}/instances/{{instanceId}}
Verify the instance is retrieved and present in LOCKED state.


Successful Endpoint Interaction
UNLOCK the AC instanceExecute PUT request on runtime acm endpoint
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId2}}/instances/{{instanceId2}}
200 Response
Verify the k8s , http and policy participants have performed the intended operations on UNLOCKED state



Successful Endpoint Interaction
Verify the operational stateFetch the operational state of the AC instanceVerify the instance elements are reporting operational state "ACTIVE" in
UNLOCKED state



Successful Endpoint Interaction
Verify the usage stateFetch the usage state of the AC instanceVerify the instance elements are reporting usage state "IDLE/BUSY/AVAILABLE" in
UNLOCKED state



Successful Endpoint Interaction
Verify the operational stateFetch the operational state of the AC instanceVerify the instance elements are reporting operational state "INACTIVE" in LOCKED state


Successful Endpoint Interaction
Verify the usage stateFetch the usage state of the AC instanceVerify the instance elements are reporting usage state "IDLE/BUSY/AVAILABLE" in
LOCKED state



Successful Endpoint InteractionUndeploy AC instanceLOCK the AC instance with instanceidMake sure the AC instance is deployed and UNLOCKED successfully.
Execute PUT request on runtime acm.
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId}}/instances/{{instanceId}}
200 Response. The instance should be moved to LOCKED state. Participants should have removed the
corresponding deployments from the system



Successful Endpoint Interaction
Delete AC instanceExecute DELETE request on runtime acm
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId}}/instances/{{instanceId}}
202 Response. The AC instance should get deleted from the db.


Successful Endpoint Interaction
Deprime AC defintionExecute PUT request on runtime ACM
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId}}
Verify fetching the commisioned defintions and make sure the AC elements are unassigned from the participants
202 Response. The AC instance should get deleted from the db.


Successful Endpoint Interaction
Delete AC defintionExecute DELETE request on runtime ACM
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId}}
200 Response. The AC defintion should get deleted from the db


Timeout ScenarioDelay participant while
DEPLOYING
Delay the participant when instances are
deploying
Make sure the instance deployment takes longer time and
shutdown the participant when the instances are being deployed.
(Note: AcElement microservice can be used to alter the behaviour of deployment)

Verify the behaviour of runtime when the participant goes offline in the middle of deployment.
Verify the instance state  to go TIMEOUT after the configured timeout is reached. (it depend how restart will be implemented)

Mock participant must be called with configuration for how long to delay. Participant shoul be ONLINE
Update ScenarioUpdate AC instance property on the deployed
 instance
Verify updating of AC properties in runtimeExecute POST request  on runtime endpoint
{{address}}:{{runtimeport}}/onap/policy/clamp/acm/v2/compositions/{{compositionId1}}/instances
The properties to be updated is provided on the request body for the specified instance id
Verify if the rest request is accepted with 202 response
Verify the PROPERTIES_UPDATE event is sent to the participants from runtime-acm.
The ACM instance state should be "UPDATING" until the properties update is completed in the participant.
Verify the properties are updated in runtime database



  • No labels