use of org.onosproject.net.DeviceId in project trellis-control by opennetworkinglab.
the class PhasedRecoverySetCommand method doExecute.
@Override
protected void doExecute() {
DeviceId deviceId = DeviceId.deviceId(deviceIdStr);
Phase newPhase = Phase.valueOf(phaseStr);
PhasedRecoveryService prService = get(PhasedRecoveryService.class);
prService.setPhase(deviceId, newPhase);
}
use of org.onosproject.net.DeviceId in project trellis-control by opennetworkinglab.
the class PortsCommand method doExecute.
@Override
protected void doExecute() {
PhasedRecoveryService prService = get(PhasedRecoveryService.class);
DeviceId deviceId = DeviceId.deviceId(deviceIdStr);
boolean enabled;
switch(actionStr.toUpperCase()) {
case "ENABLE":
enabled = true;
break;
case "DISABLE":
enabled = false;
break;
default:
print("Action should be either ENABLE or DISABLE");
return;
}
Set<PortNumber> portsChanged;
switch(portsStr.toUpperCase()) {
case "ALL":
portsChanged = prService.changeAllPorts(deviceId, enabled);
break;
case "PAIR":
portsChanged = prService.changePairPort(deviceId, enabled);
break;
case "INFRA":
portsChanged = prService.changeInfraPorts(deviceId, enabled);
break;
case "EDGE":
portsChanged = prService.changeEdgePorts(deviceId, enabled);
break;
default:
print("Ports should be ALL, PAIR, INFRA, EDGE");
return;
}
print("Ports set to %s: %s", enabled ? "enabled" : "disabled", portsChanged.stream().map(PortNumber::toLong).collect(Collectors.toSet()));
}
use of org.onosproject.net.DeviceId in project trellis-control by opennetworkinglab.
the class ShouldProgramCommand method doExecute.
@Override
protected void doExecute() {
SegmentRoutingService srService = AbstractShellCommand.get(SegmentRoutingService.class);
Map<DeviceId, NodeId> shouldProgram = srService.getShouldProgramLeaders();
print("shouldProgram");
shouldProgram.forEach((k, v) -> print("%s -> %s", k, v));
}
use of org.onosproject.net.DeviceId in project trellis-control by opennetworkinglab.
the class XconnectAddCommand method doExecute.
@Override
protected void doExecute() {
DeviceId deviceId = DeviceId.deviceId(deviceIdStr);
VlanId vlanId = VlanId.vlanId(vlanIdStr);
XconnectEndpoint ep1 = XconnectEndpoint.fromString(ep1Str);
XconnectEndpoint ep2 = XconnectEndpoint.fromString(ep2Str);
Set<XconnectEndpoint> endpoints = Sets.newHashSet(ep1, ep2);
XconnectService xconnectService = get(XconnectService.class);
xconnectService.addOrUpdateXconnect(deviceId, vlanId, endpoints);
}
use of org.onosproject.net.DeviceId in project trellis-control by opennetworkinglab.
the class XconnectRemoveCommand method doExecute.
@Override
protected void doExecute() {
DeviceId deviceId = DeviceId.deviceId(deviceIdStr);
VlanId vlanId = VlanId.vlanId(vlanIdStr);
XconnectService xconnectService = get(XconnectService.class);
xconnectService.removeXonnect(deviceId, vlanId);
}
Aggregations