cmHandleStatus:
type: string
example: "READY"
+ dmiProperties:
+ type: string
+ example: my-dmi-property
#Module upgrade schema
UpgradedCmHandles:
required:
cmHandleStatus:
type: string
example: "READY"
+ dmiProperties:
+ type: string
+ example: my-dmi-property
CmHandleCompositeState:
type: object
properties:
restOutputCmHandle.setAlternateId(ncmpServiceCmHandle.getAlternateId());
restOutputCmHandle.setDataProducerIdentifier(ncmpServiceCmHandle.getDataProducerIdentifier());
restOutputCmHandle.setCmHandleStatus(ncmpServiceCmHandle.getCmHandleStatus());
+ restOutputCmHandle.setDmiProperties(ncmpServiceCmHandle.getDmiProperties());
return restOutputCmHandle;
}
}
assert result.alternateId == 'alt-1'
assert result.cmHandle == 'ch-1'
assert result.cmHandleStatus == 'REPORTED STATE'
+ assert result.dmiProperties == 'dmi property'
where:
scenario | includeAdditionalProperties || trustLevel
'without additional properties' | false || null
return new NcmpServiceCmHandle(cmHandleId: 'ch-1', additionalProperties: ['additional property key': 'some value'],
currentTrustLevel: trustLevel,
publicProperties: ['public property key': 'public property value'],
- alternateId: 'alt-1', compositeState: new CompositeState(cmHandleState: 'ADVISED'), cmHandleStatus: 'REPORTED STATE')
+ alternateId: 'alt-1', compositeState: new CompositeState(cmHandleState: 'ADVISED'), cmHandleStatus: 'REPORTED STATE',
+ dmiProperties: 'dmi property')
}
}
@JsonSetter(nulls = Nulls.AS_EMPTY)
private String cmHandleStatus;
+ @JsonSetter(nulls = Nulls.AS_EMPTY)
+ private String dmiProperties;
+
}
ncmpServiceCmHandle.getModuleSetTag(),
ncmpServiceCmHandle.getAlternateId(),
ncmpServiceCmHandle.getDataProducerIdentifier(),
- ncmpServiceCmHandle.getCmHandleStatus());
+ ncmpServiceCmHandle.getCmHandleStatus(),
+ ncmpServiceCmHandle.getDmiProperties());
}
void removeAlternateIdsFromCache(final Collection<YangModelCmHandle> yangModelCmHandles) {
@JsonProperty("cm-handle-state")
private String cmHandleStatus;
+ @JsonProperty("dmi-properties")
+ private String dmiProperties;
+
/**
* Creates a deep copy of Yang Model Cm Handle.
*
copy.alternateId = original.getAlternateId();
copy.dataProducerIdentifier = original.getDataProducerIdentifier();
copy.cmHandleStatus = original.getCmHandleStatus();
+ copy.dmiProperties = original.getDmiProperties();
return copy;
}
* @param alternateId alternateId
* @param dataProducerIdentifier dataProducerIdentifier
* @param cmHandleStatus cm handle status
+ * @param dmiProperties dmi properties
* @return instance of yangModelCmHandle
*/
public static YangModelCmHandle toYangModelCmHandle(final String dmiServiceName,
final String moduleSetTag,
final String alternateId,
final String dataProducerIdentifier,
- final String cmHandleStatus) {
+ final String cmHandleStatus,
+ final String dmiProperties) {
final YangModelCmHandle yangModelCmHandle = new YangModelCmHandle();
yangModelCmHandle.setId(ncmpServiceCmHandle.getCmHandleId());
yangModelCmHandle.setDmiServiceName(dmiServiceName);
yangModelCmHandle.setPublicProperties(asYangModelCmHandleProperties(ncmpServiceCmHandle.getPublicProperties()));
yangModelCmHandle.setCompositeState(ncmpServiceCmHandle.getCompositeState());
yangModelCmHandle.setCmHandleStatus(cmHandleStatus);
+ yangModelCmHandle.setDmiProperties(dmiProperties);
+
return yangModelCmHandle;
}
ncmpServiceCmHandle.setAlternateId(yangModelCmHandle.getAlternateId());
ncmpServiceCmHandle.setDataProducerIdentifier(yangModelCmHandle.getDataProducerIdentifier());
ncmpServiceCmHandle.setCmHandleStatus(yangModelCmHandle.getCmHandleStatus());
+ ncmpServiceCmHandle.setDmiProperties(yangModelCmHandle.getDmiProperties());
setAdditionalProperties(additionalProperties, ncmpServiceCmHandle);
setPublicProperties(publicProperties, ncmpServiceCmHandle);
safeGetLeafValue(cmHandleDataNode, "module-set-tag"),
safeGetLeafValue(cmHandleDataNode, "alternate-id"),
safeGetLeafValue(cmHandleDataNode, "data-producer-identifier"),
- safeGetLeafValue(cmHandleDataNode, "cm-handle-state")
+ safeGetLeafValue(cmHandleDataNode, "cm-handle-state"),
+ safeGetLeafValue(cmHandleDataNode, "dmi-properties")
);
}
ncmpServiceCmHandle.setAdditionalProperties(additionalProperties);
ncmpServiceCmHandle.setPublicProperties(publicProperties);
ncmpServiceCmHandle.setCompositeState(compositeState);
+ ncmpServiceCmHandle.setDmiProperties(ncmpServiceCmHandle.getDmiProperties());
}
private static void addProperty(final DataNode propertyDataNode, final Map<String, String> propertiesAsMap) {
ncmpServiceCmHandle.cmHandleId = 'cm-handle-id01'
ncmpServiceCmHandle.additionalProperties = [myAdditionalProperty:'value1']
ncmpServiceCmHandle.publicProperties = [myPublicProperty:'value2']
+ ncmpServiceCmHandle.dmiProperties = [myDmiProperty:'value3']
and: 'with a composite state'
def compositeState = new CompositeStateBuilder()
.withCmHandleState(CmHandleState.LOCKED)
.withOperationalDataStores(DataStoreSyncState.SYNCHRONIZED, 'some-sync-time').build()
ncmpServiceCmHandle.setCompositeState(compositeState)
when: 'it is converted to a yang model cm handle'
- def objectUnderTest = YangModelCmHandle.toYangModelCmHandle('', '', '', ncmpServiceCmHandle,'my-module-set-tag', 'my-alternate-id', 'my-data-producer-identifier', 'ADVISED')
+ def objectUnderTest = YangModelCmHandle.toYangModelCmHandle('', '', '', ncmpServiceCmHandle,'my-module-set-tag', 'my-alternate-id', 'my-data-producer-identifier', 'ADVISED', 'my-dmi-property')
then: 'the result has the right size'
assert objectUnderTest.additionalProperties.size() == 1
and: 'the result has the correct values for module set tag, alternate ID, and data producer identifier'
objectUnderTest.getCompositeState() == ncmpServiceCmHandle.getCompositeState()
and: 'the cm-handle-state is correct'
assert objectUnderTest.cmHandleStatus == 'ADVISED'
+ and: 'the dmi-properties are correct'
+ assert objectUnderTest.dmiProperties == 'my-dmi-property'
}
def 'Resolve DMI service name: #scenario and #requiredService service require.'() {
given: 'a yang model cm handle'
def objectUnderTest = YangModelCmHandle.toYangModelCmHandle(dmiServiceName, dmiDataServiceName,
- dmiModelServiceName, new NcmpServiceCmHandle(cmHandleId: 'cm-handle-id-1'),'', '', '', '')
+ dmiModelServiceName, new NcmpServiceCmHandle(cmHandleId: 'cm-handle-id-1'),'', '', '', '', '')
expect:
assert objectUnderTest.resolveDmiServiceName(requiredService) == expectedService
where:
ncmpServiceCmHandle.setCompositeState(new CompositeStateBuilder().withLockReason(MODULE_UPGRADE, '').build())
def dmiServiceName = 'some service name'
ncmpServiceCmHandle.cmHandleId = 'upgraded-ch'
- def yangModelCmHandle = YangModelCmHandle.toYangModelCmHandle(dmiServiceName, '', '', ncmpServiceCmHandle,'', '', '', '')
+ def yangModelCmHandle = YangModelCmHandle.toYangModelCmHandle(dmiServiceName, '', '', ncmpServiceCmHandle,'', '', '', '', '')
and: 'DMI operations returns some module references for upgraded cm handle'
def moduleReferences = [ new ModuleReference('module1','1') ]
mockDmiModelOperations.getModuleReferences(yangModelCmHandle, NO_MODULE_SET_TAG) >> moduleReferences
def ncmpServiceCmHandle = new NcmpServiceCmHandle()
ncmpServiceCmHandle.setCompositeState(new CompositeStateBuilder().withLockReason(MODULE_UPGRADE, 'Upgrade to ModuleSetTag: ' + tagTo).build())
ncmpServiceCmHandle.setCmHandleId('cmHandleId-1')
- def yangModelCmHandle = YangModelCmHandle.toYangModelCmHandle('some service name', '', '', ncmpServiceCmHandle, tagFrom, '', '', '')
+ def yangModelCmHandle = YangModelCmHandle.toYangModelCmHandle('some service name', '', '', ncmpServiceCmHandle, tagFrom, '', '', '', '')
mockCmHandleQueries.cmHandleHasState('cmHandleId-1', CmHandleState.READY) >> true
and: 'the module tag (schemaset) exists is #schemaExists'
mockCpsModuleService.schemaSetExists(NFP_OPERATIONAL_DATASTORE_DATASPACE_NAME, tagTo) >> schemaExists
def ncmpServiceCmHandle = new NcmpServiceCmHandle()
ncmpServiceCmHandle.setCompositeState(new CompositeStateBuilder().withCmHandleState(CmHandleState.ADVISED).build())
ncmpServiceCmHandle.cmHandleId = 'ch-1'
- return YangModelCmHandle.toYangModelCmHandle('some service name', '', '', ncmpServiceCmHandle, moduleSetTag, '', '', '')
+ return YangModelCmHandle.toYangModelCmHandle('some service name', '', '', ncmpServiceCmHandle, moduleSetTag, '', '', '', '')
}
}
key: my-property
moduleSetTag: my-module-set-tag
trustLevel: COMPLETE
+ dmiProperties: my-dmi-property
- cmHandle: my-cm-handle
alternateId: "Subnetwork=Europe,ManagedElement=X123"
dataProducerIdentifier: my-data-producer-identifier
key: my-property
moduleSetTag: my-module-set-tag
trustLevel: COMPLETE
+ dmiProperties: my-dmi-property
createdCmHandles:
- cmHandle: my-cm-handle
alternateId: "Subnetwork=Europe,ManagedElement=X123"
key: my-property
moduleSetTag: my-module-set-tag
trustLevel: COMPLETE
+ dmiProperties: my-dmi-property
- cmHandle: my-cm-handle
alternateId: "Subnetwork=Europe,ManagedElement=X123"
dataProducerIdentifier: my-data-producer-identifier
key: my-property
moduleSetTag: my-module-set-tag
trustLevel: COMPLETE
+ dmiProperties: my-dmi-property
dmiPlugin: my-dmi-plugin
dmiModelPlugin: my-dmi-model-plugin
upgradedCmHandles:
key: my-property
moduleSetTag: my-module-set-tag
trustLevel: COMPLETE
+ dmiProperties: my-dmi-property
properties:
cmHandle:
example: my-cm-handle
cmHandleStatus:
example: READY
type: string
+ dmiProperties:
+ example: my-dmi-property
+ type: string
required:
- cmHandle
type: object
lastUpdateTime: 2022-12-31T20:30:40.000+0000
trustLevel: COMPLETE
moduleSetTag: my-module-set-tag
+ dmiProperties: my-dmi-property
properties:
cmHandle:
example: my-cm-handle1
cmHandleStatus:
example: READY
type: string
+ dmiProperties:
+ example: my-dmi-property
+ type: string
title: CM handle Details
type: object
CmHandleCompositeState:
lastUpdateTime: 2022-12-31T20:30:40.000+0000
trustLevel: COMPLETE
moduleSetTag: my-module-set-tag
+ dmiProperties: my-dmi-property
properties:
cmHandle:
example: my-cm-handle1
cmHandleStatus:
example: READY
type: string
+ dmiProperties:
+ example: my-dmi-property
+ type: string
title: CM handle Details
type: object
CmHandleCompositeState: