Use of different version in composition definition element
Add a flag to support major versioning:
- insert this flag as a property "migrateMajorVersion" into the serviceTemplate similarly as startPhase with default false.
Code Block | ||
---|---|---|
| ||
org.onap.policy.clamp.acm.AutomationCompositionElement:
version: 1.0.1
derived_from: tosca.nodetypes.Root
properties:
provider:
type: string
required: false
migrateMajorVersion:
type: boolean
required: false
default: false
metadata:
common: true
description: Allow to migrate to major version
startPhase:
type: integer
required: false
constraints:
- greater-or-equal: 0
metadata:
common: true
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
|
Versioning Validation:
Composition Element definition | New Composition Element definition | Compatibility | Validation |
---|---|---|---|
Key 1.0.1 | Key 1.0.1 | IDENTICAL | OK |
Key 1.0.1 | Key 1.0.1+build1 | PATCH | OK |
Key 1.0.1 | Key 1.0.2 | PATCH | OK |
Key 1.0.1 | Key 1.1.0 | MINOR | OK and WARN log |
Key 1.0.1 | Key 2.0.1 | MAJOR | FAIL or OK based on flag and WARN log |
KeyDiff 1.0.1 | Key 1.0.1 | DIFFERENT | FAIL |
...
Code Block | ||
---|---|---|
| ||
var automationComposition = participantIntermediaryApi.getAutomationComposition(instanceId); var compositionId = automationComposition.getCompositionId(); var acElementDefinitionsFrom = participantIntermediaryApi.getAcElementsDefinitions(compositionId); var acElementDefinitionFrom = acElementsDefinitionsFrom.values().stream() .filter(el -> el.getAcElementDefinitionId().getName().equals(element.getDefinition().getName())).findFirst().get(); var outPropertiesFrom = acElementDefinitionFrom.getOutProperties(); var acElementDefinitionTo = participantIntermediaryApi.getAcElementDefinition(compositionTargetId, element.getDefinition()); var outPropertiesTo = acElementDefinitionTo.getOutProperties(); |
Migration precheck
Assumptions:
- Only the participants can execute a precheck.
- Precheck is executed before the migration, if it fail the migration will be not executed.
- User needs to receive the result of the precheck.
- Acm-runtime needs to handle the precheck fail in a different way it handles migration fail.
Solution 1: create a new flow for migration-precheck.
User can send the action migration-precheck POST. The user can do the action migration POST after that. The migration flow is still backwards-compatible.
- User send migration-precheck action
- Acm-runtime set the instance in "MIGRATING-PRECHECK" deployState
- Acm-runtime sends migration-precheck message to participants
- Participant receives migration-precheck message and executes the precheck and sends the result
- Acm-runtime receives precheck-result messages from all participants
- Acm-runtime shows this result into the stateChangeResult (deployState will be in "DEPLOYED" state)