use of org.projectfloodlight.openflow.protocol.OFGroupDelete in project open-kilda by telstra.
the class OfGroupConverterTest method testConvertDeleteGroupCommand.
@Test
public void testConvertDeleteGroupCommand() {
List<Bucket> buckets = new ArrayList<>();
buckets.add(Bucket.builder().watchPort(WatchPort.ANY).watchGroup(WatchGroup.ALL).writeActions(Sets.newHashSet(new PortOutAction(new PortNumber(2, null)))).build());
buckets.add(Bucket.builder().watchPort(WatchPort.ANY).watchGroup(WatchGroup.ALL).writeActions(Sets.newHashSet(new PortOutAction(new PortNumber(1, null)))).build());
GroupSpeakerData groupSpeakerData = GroupSpeakerData.builder().groupId(new GroupId(GROUP_ID)).type(GroupType.ALL).buckets(buckets).build();
OFFactoryVer13 factory = new OFFactoryVer13();
OFGroupDelete ofGroupDelete = OfGroupConverter.INSTANCE.convertDeleteGroupCommand(groupSpeakerData, factory);
assertEquals(OFGroup.of(GROUP_ID), ofGroupDelete.getGroup());
assertEquals(OFGroupType.ALL, ofGroupDelete.getGroupType());
}
use of org.projectfloodlight.openflow.protocol.OFGroupDelete in project open-kilda by telstra.
the class SwitchManager method deleteGroup.
private void deleteGroup(IOFSwitch sw, int groupId) throws OfInstallException {
OFGroupDelete groupDelete = sw.getOFFactory().buildGroupDelete().setGroup(OFGroup.of(groupId)).setGroupType(OFGroupType.ALL).build();
pushFlow(sw, "--DeleteGroup--", groupDelete);
sendBarrierRequest(sw);
}
use of org.projectfloodlight.openflow.protocol.OFGroupDelete in project open-kilda by telstra.
the class GroupRemoveCommand method makeExecutePlan.
@Override
protected CompletableFuture<GroupRemoveReport> makeExecutePlan(SpeakerCommandProcessor commandProcessor) throws Exception {
ensureSwitchSupportGroups();
IOFSwitch sw = getSw();
OFGroupDelete groupDelete = sw.getOFFactory().buildGroupDelete().setGroup(OFGroup.of(groupId.intValue())).setGroupType(OFGroupType.ALL).build();
try (Session session = getSessionService().open(messageContext, sw)) {
return session.write(groupDelete).thenApply(ignore -> makeSuccessReport());
}
}
Aggregations