use of org.ovirt.engine.core.common.action.ManageNetworkClustersParameters in project ovirt-engine by oVirt.
the class JsonImmutableSerializeDeserializeTest method serializeCollectionsSingletonList.
@Test
public void serializeCollectionsSingletonList() {
ManageNetworkClustersParameters params = new ManageNetworkClustersParameters(Collections.singletonList(new NetworkCluster(Guid.newGuid(), Guid.newGuid(), NetworkStatus.NON_OPERATIONAL, false, false, false, false, false, false)));
JsonObjectSerializer serializer = new JsonObjectSerializer();
String json = serializer.serialize(params);
assertTrue(json.length() > 0);
ManageNetworkClustersParameters deserializedParams = new JsonObjectDeserializer().deserialize(json, ManageNetworkClustersParameters.class);
assertEquals(params.getExecutionReason(), deserializedParams.getExecutionReason());
}
use of org.ovirt.engine.core.common.action.ManageNetworkClustersParameters in project ovirt-engine by oVirt.
the class JsonImmutableSerializeDeserializeTest method serializeCollectionsSingleton.
@Test
public void serializeCollectionsSingleton() {
ManageNetworkClustersParameters params = new ManageNetworkClustersParameters(Collections.singleton(new NetworkCluster(Guid.createGuidFromString("f455686a-79cc-11e6-8c65-54ee755c6cc7"), Guid.createGuidFromString("f970c5f6-79cc-11e6-bc8f-54ee755c6cc7"), NetworkStatus.NON_OPERATIONAL, false, false, false, false, false, false)));
JsonObjectSerializer serializer = new JsonObjectSerializer();
String json = serializer.serialize(params);
assertTrue(json.length() > 0);
ManageNetworkClustersParameters deserializedParams = new JsonObjectDeserializer().deserialize(json, ManageNetworkClustersParameters.class);
assertEquals(params.getExecutionReason(), deserializedParams.getExecutionReason());
}
use of org.ovirt.engine.core.common.action.ManageNetworkClustersParameters in project ovirt-engine by oVirt.
the class PropagateNetworksToClusterHostsCommand method executeCommand.
@Override
protected void executeCommand() {
final Map<Guid, ManageNetworkClustersParameters> paramsByClusterId = mapParametersByClusterId();
for (ManageNetworkClustersParameters param : paramsByClusterId.values()) {
processSingleClusterChanges(param);
}
setSucceeded(true);
}
use of org.ovirt.engine.core.common.action.ManageNetworkClustersParameters in project ovirt-engine by oVirt.
the class AttachNetworkToClusterCommand method attachLabeledNetwork.
private void attachLabeledNetwork() {
final AttachNetworkToClusterParameter attachNetworkToClusterParameter = getParameters();
runInternalAction(ActionType.PropagateNetworksToClusterHosts, new ManageNetworkClustersParameters(new ArrayList<>(Collections.singleton(attachNetworkToClusterParameter.getNetworkCluster()))));
}
use of org.ovirt.engine.core.common.action.ManageNetworkClustersParameters in project ovirt-engine by oVirt.
the class DetachNetworkToClusterCommand method detachLabeledNetworksFromClusterHosts.
private void detachLabeledNetworksFromClusterHosts() {
final AttachNetworkToClusterParameter attachNetworkToClusterParameter = getParameters();
runInternalAction(ActionType.PropagateNetworksToClusterHosts, new ManageNetworkClustersParameters(Collections.emptyList(), new ArrayList<>(Collections.singleton(attachNetworkToClusterParameter.getNetworkCluster()))));
}
Aggregations