class MsoNeutronUtils extends MsoCommonUtils {

    public NetworkInfo updateNetwork(String cloudSiteId, String tenantId, String networkId, NetworkType type,
            String provider, List<Integer> vlans) throws MsoException {
        // Obtain the cloud site information where we will create the stack
        CloudSite cloudSite =
                cloudConfig.getCloudSite(cloudSiteId).orElseThrow(() -> new MsoCloudSiteNotFound(cloudSiteId));
        Quantum neutronClient = getNeutronClient(cloudSite, tenantId);

        // Check that the network exists
        Network network = findNetworkById(neutronClient, networkId);

        if (network == null) {
            // Network not found. Throw an exception
            logger.error("{} Network {} on Cloud site {} for Tenant {} not found {}", MessageEnum.RA_NETWORK_NOT_FOUND,
                    networkId, cloudSiteId, tenantId, ErrorCode.DataError.getValue());
            throw new MsoNetworkNotFound(networkId, tenantId, cloudSiteId);
        }

        // Overwrite the properties to be updated
        if (type == NetworkType.PROVIDER) {
            if (provider != null && vlans != null && vlans.size() > 0) {
                network.setProviderPhysicalNetwork(provider);
                network.setProviderNetworkType("vlan");
                network.setProviderSegmentationId(vlans.get(0));
            }
        } else if (type == NetworkType.MULTI_PROVIDER) {
            if (provider != null && vlans != null && vlans.size() > 0) {
                List<Segment> segments = new ArrayList<>(vlans.size());
                for (int vlan : vlans) {
                    Segment segment = new Segment();
                    segment.setProviderPhysicalNetwork(provider);
                    segment.setProviderNetworkType("vlan");
                    segment.setProviderSegmentationId(vlan);

                    segments.add(segment);
                }
                network.setSegments(segments);
            }
        }

        try {
            OpenStackRequest<Network> request = neutronClient.networks().update(network);
            Network newNetwork = executeAndRecordOpenstackRequest(request);
            return new NetworkInfoMapper(newNetwork).map();
        } catch (OpenStackBaseException e) {
            // Convert Neutron exception to an MsoOpenstackException
            MsoException me = neutronExceptionToMsoException(e, "UpdateNetwork");
            throw me;
        } catch (RuntimeException e) {
            // Catch-all
            MsoException me = runtimeExceptionToMsoException(e, "UpdateNetwork");
            throw me;
        }
    }

}