Search in sources :

Example 1 with OpenstackHaService

use of org.onosproject.openstacknetworking.api.OpenstackHaService in project onos by opennetworkinglab.

the class OpenstackHaConfigCommand method doExecute.

@Override
protected void doExecute() {
    OpenstackHaService service = get(OpenstackHaService.class);
    if (FLAG_TRUE.equalsIgnoreCase(active)) {
        service.setActive(true);
    } else if (FLAG_FALSE.equalsIgnoreCase(active)) {
        service.setActive(false);
    } else {
        error("The input value is not correct");
        return;
    }
    String role = service.isActive() ? "ACTIVE" : "STANDBY";
    print("Node is configured as " + role);
}
Also used : OpenstackHaService(org.onosproject.openstacknetworking.api.OpenstackHaService)

Example 2 with OpenstackHaService

use of org.onosproject.openstacknetworking.api.OpenstackHaService in project onos by opennetworkinglab.

the class OpenstackHaActiveIpCommand method doExecute.

@Override
protected void doExecute() {
    OpenstackHaService service = get(OpenstackHaService.class);
    service.setActiveIp(IpAddress.valueOf(ip));
    print("Active node IP address " + ip + " is configured");
}
Also used : OpenstackHaService(org.onosproject.openstacknetworking.api.OpenstackHaService)

Example 3 with OpenstackHaService

use of org.onosproject.openstacknetworking.api.OpenstackHaService in project onos by opennetworkinglab.

the class OpenstackHaShowCommand method doExecute.

@Override
protected void doExecute() {
    OpenstackHaService service = get(OpenstackHaService.class);
    print(FORMAT, "Status", "Active Node IP");
    print(FORMAT, service.isActive() ? "Active" : "Standby", service.getActiveIp() == null ? "None" : service.getActiveIp().toString());
}
Also used : OpenstackHaService(org.onosproject.openstacknetworking.api.OpenstackHaService)

Aggregations

OpenstackHaService (org.onosproject.openstacknetworking.api.OpenstackHaService)3