use of org.onosproject.segmentrouting.phasedrecovery.api.PhasedRecoveryService in project trellis-control by opennetworkinglab.
the class PhasedRecoveryListCommand method doExecute.
@Override
protected void doExecute() {
PhasedRecoveryService prService = get(PhasedRecoveryService.class);
print(prService.getPhases().toString());
}
use of org.onosproject.segmentrouting.phasedrecovery.api.PhasedRecoveryService 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.segmentrouting.phasedrecovery.api.PhasedRecoveryService 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()));
}
Aggregations