}
@Override
- public ResponseEntity<RestOutputPublicCmHandleProperties> getCmHandlePublicPropertiesByCmHandleId(
+ public ResponseEntity<RestOutputPublicCmHandleProperties> getPublicCmHandlePropertiesByCmHandleId(
final String cmHandle) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
tags:
- network-cm-proxy
summary: Get CM handle properties
- operationId: getCmHandlePublicPropertiesByCmHandleId
+ operationId: getPublicCmHandlePropertiesByCmHandleId
parameters:
- $ref: 'components.yaml#/components/parameters/cmHandleReferenceInPath'
responses:
* @return cm handle properties
*/
@Override
- public ResponseEntity<RestOutputPublicCmHandleProperties> getCmHandlePublicPropertiesByCmHandleId(
+ public ResponseEntity<RestOutputPublicCmHandleProperties> getPublicCmHandlePropertiesByCmHandleId(
final String cmHandleReference) {
- final List<Map<String, String>> cmHandlePublicProperties = new ArrayList<>(1);
- cmHandlePublicProperties.add(networkCmProxyInventoryFacade.getCmHandlePublicProperties(cmHandleReference));
+ final List<Map<String, String>> publicCmHandleProperties = new ArrayList<>(1);
+ publicCmHandleProperties.add(networkCmProxyInventoryFacade.getPublicCmHandleProperties(cmHandleReference));
final RestOutputPublicCmHandleProperties restOutputPublicCmHandleProperties =
new RestOutputPublicCmHandleProperties();
- restOutputPublicCmHandleProperties.setPublicCmHandleProperties(cmHandlePublicProperties);
+ restOutputPublicCmHandleProperties.setPublicCmHandleProperties(publicCmHandleProperties);
return ResponseEntity.ok(restOutputPublicCmHandleProperties);
}
import org.onap.cps.ncmp.impl.NetworkCmProxyInventoryFacadeImpl
import org.onap.cps.ncmp.api.inventory.models.CompositeState
import org.onap.cps.ncmp.api.inventory.models.NcmpServiceCmHandle
-import org.onap.cps.ncmp.api.inventory.models.TrustLevel
import org.onap.cps.ncmp.impl.data.NetworkCmProxyFacade
import org.onap.cps.ncmp.api.inventory.DataStoreSyncState
import org.onap.cps.ncmp.api.inventory.models.CmHandleState
and: 'some cm handle public properties'
def publicProperties = ['public prop': 'some public property']
and: 'the service method is invoked with the cm handle id returning the cm handle public properties'
- 1 * mockNetworkCmProxyInventoryFacade.getCmHandlePublicProperties('some-cm-handle-reference') >> publicProperties
+ 1 * mockNetworkCmProxyInventoryFacade.getPublicCmHandleProperties('some-cm-handle-reference') >> publicProperties
when: 'the cm handle properties api is invoked'
def response = mvc.perform(get(cmHandlePropertiesEndpoint)).andReturn().response
then: 'the correct response is returned'
* @param cmHandleReference cm handle or alternate identifier
* @return cm handle public properties
*/
- Map<String, String> getCmHandlePublicProperties(final String cmHandleReference);
+ Map<String, String> getPublicCmHandleProperties(final String cmHandleReference);
/**
* Get cm handle composite state for a given cm handle id.
}
@Override
- public Map<String, String> getCmHandlePublicProperties(final String cmHandleReference) {
+ public Map<String, String> getPublicCmHandleProperties(final String cmHandleReference) {
final String cmHandleId = alternateIdMatcher.getCmHandleId(cmHandleReference);
final YangModelCmHandle yangModelCmHandle = inventoryPersistence.getYangModelCmHandle(cmHandleId);
return YangDataConverter.toPropertiesMap(yangModelCmHandle.getPublicProperties());
* @param outputAlternateId boolean for cm handle reference type either cmHandleId (false) or AlternateId (true)
* @return CmHandles which have these public properties
*/
- Collection<String> queryCmHandlePublicProperties(Map<String, String> publicPropertyQueryPairs,
+ Collection<String> queryPublicCmHandleProperties(Map<String, String> publicPropertyQueryPairs,
boolean outputAlternateId);
/**
}
@Override
- public Collection<String> queryCmHandlePublicProperties(final Map<String, String> publicPropertyQueryPairs,
+ public Collection<String> queryPublicCmHandleProperties(final Map<String, String> publicPropertyQueryPairs,
final boolean outputAlternateId) {
return queryCmHandleAnyProperties(publicPropertyQueryPairs, PropertyType.PUBLIC, outputAlternateId);
}
if (publicPropertyQueryPairs.isEmpty()) {
return NO_QUERY_TO_EXECUTE;
}
- return cmHandleQueryService.queryCmHandlePublicProperties(publicPropertyQueryPairs, outputAlternateId);
+ return cmHandleQueryService.queryPublicCmHandleProperties(publicPropertyQueryPairs, outputAlternateId);
}
private Collection<String> queryCmHandlesByTrustLevel(final CmHandleQueryServiceParameters
given: 'the DataNodes queried for a given cpsPath are returned from the persistence service.'
mockResponses()
when: 'a query on cmhandle public properties is performed with a public property pair'
- def result = objectUnderTest.queryCmHandlePublicProperties(publicPropertyPairs, outputAlternateId)
+ def result = objectUnderTest.queryPublicCmHandleProperties(publicPropertyPairs, outputAlternateId)
then: 'the correct cm handle data objects are returned'
result.containsAll(expectedCmHandleReferences)
result.size() == expectedCmHandleReferences.size()
def 'Query CmHandles using empty public properties query pair.'() {
when: 'a query on CmHandle public properties is executed using an empty map'
- def result = objectUnderTest.queryCmHandlePublicProperties([:], false)
+ def result = objectUnderTest.queryPublicCmHandleProperties([:], false)
then: 'no cm handles are returned'
result.size() == 0
}
and: 'the system returns this yang modelled cm handle'
1 * mockInventoryPersistence.getYangModelCmHandle(cmHandleId) >> yangModelCmHandle
when: 'getting cm handle public properties for a given cm handle reference from ncmp service'
- def result = objectUnderTest.getCmHandlePublicProperties(cmHandleRef)
+ def result = objectUnderTest.getPublicCmHandleProperties(cmHandleRef)
then: 'the result returns the correct data'
assert result == [ 'public prop' : 'some public prop' ]
where: 'following cm handle reference is used'
def conditionProperties = createConditionProperties(conditionName, [['some-key': 'some-value']])
cmHandleQueryParameters.setCmHandleQueryParameters([conditionProperties])
and: 'the inventoryPersistence returns different CmHandleIds'
- partiallyMockedCmHandleQueries.queryCmHandlePublicProperties(*_) >> cmHandlesWithMatchingPublicProperties
+ partiallyMockedCmHandleQueries.queryPublicCmHandleProperties(*_) >> cmHandlesWithMatchingPublicProperties
partiallyMockedCmHandleQueries.queryCmHandleAdditionalProperties(*_) >> cmHandlesWithMatchingPrivateProperties
when: 'the query executed'
def result = objectUnderTestWithPartiallyMockedQueries.queryCmHandleIdsForInventory(cmHandleQueryParameters, false)
/v1/ch/{cm-handle}/properties:
get:
description: Get CM handle properties by cm handle id
- operationId: getCmHandlePublicPropertiesByCmHandleId
+ operationId: getPublicCmHandlePropertiesByCmHandleId
parameters:
- description: "The identifier (cmHandle or alternate) for a network function,\
\ network element, subnetwork or any other cm object by managed Network\