use of org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkrequestinputNetworkRequestInput in project so by onap.
the class NetworkTopologyOperationRequestMapper method reqMapper.
public GenericResourceApiNetworkOperationInformation reqMapper(SDNCSvcOperation svcOperation, SDNCSvcAction svcAction, GenericResourceApiRequestActionEnumeration reqAction, L3Network network, ServiceInstance serviceInstance, Customer customer, RequestContext requestContext, CloudRegion cloudRegion) {
GenericResourceApiNetworkOperationInformation req = new GenericResourceApiNetworkOperationInformation();
String sdncReqId = UUID.randomUUID().toString();
String msoRequestId = UUID.randomUUID().toString();
if (requestContext != null && requestContext.getMsoRequestId() != null) {
msoRequestId = requestContext.getMsoRequestId();
}
GenericResourceApiSdncrequestheaderSdncRequestHeader sdncRequestHeader = generalTopologyObjectMapper.buildSdncRequestHeader(svcAction, sdncReqId);
GenericResourceApiRequestinformationRequestInformation requestInformation = generalTopologyObjectMapper.buildGenericResourceApiRequestinformationRequestInformation(msoRequestId, reqAction);
GenericResourceApiServiceinformationServiceInformation serviceInformation = generalTopologyObjectMapper.buildServiceInformation(serviceInstance, requestContext, customer, true);
GenericResourceApiNetworkinformationNetworkInformation networkInformation = generalTopologyObjectMapper.buildNetworkInformation(network);
GenericResourceApiNetworkrequestinputNetworkRequestInput networkRequestInput = buildNetworkRequestInput(network, serviceInstance, cloudRegion);
req.setRequestInformation(requestInformation);
req.setSdncRequestHeader(sdncRequestHeader);
req.setServiceInformation(serviceInformation);
req.setNetworkInformation(networkInformation);
if (requestContext != null && requestContext.getUserParams() != null) {
for (Map.Entry<String, Object> entry : requestContext.getUserParams().entrySet()) {
GenericResourceApiParam networkInputParameters = new GenericResourceApiParam();
GenericResourceApiParamParam paramItem = new GenericResourceApiParamParam();
paramItem.setName(entry.getKey());
paramItem.setValue(generalTopologyObjectMapper.mapUserParamValue(entry.getValue()));
networkInputParameters.addParamItem(paramItem);
networkRequestInput.setNetworkInputParameters(networkInputParameters);
}
}
req.setNetworkRequestInput(networkRequestInput);
return req;
}
use of org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkrequestinputNetworkRequestInput in project so by onap.
the class NetworkTopologyOperationRequestMapper method buildNetworkRequestInput.
/*
* Private helper to build GenericResourceApiNetworkrequestinputNetworkRequestInput
*/
private GenericResourceApiNetworkrequestinputNetworkRequestInput buildNetworkRequestInput(L3Network network, ServiceInstance serviceInstance, CloudRegion cloudRegion) {
GenericResourceApiNetworkrequestinputNetworkRequestInput networkRequestInput = new GenericResourceApiNetworkrequestinputNetworkRequestInput();
networkRequestInput.setTenant(cloudRegion.getTenantId());
networkRequestInput.setCloudOwner(cloudRegion.getCloudOwner());
networkRequestInput.setAicCloudRegion(cloudRegion.getLcpCloudRegionId());
if (network.getNetworkName() != null && !network.getNetworkName().equals("")) {
networkRequestInput.setNetworkName(network.getNetworkName());
}
if (serviceInstance.getCollection() != null && serviceInstance.getCollection().getInstanceGroup() != null) {
// set only for network created as part of the collection/instance since 1806
networkRequestInput.setNetworkInstanceGroupId(serviceInstance.getCollection().getInstanceGroup().getId());
}
return networkRequestInput;
}
Aggregations