Search in sources :

Example 1 with UpgradeAdminService

use of org.onosproject.upgrade.UpgradeAdminService in project onos by opennetworkinglab.

the class IssuCommand method doExecute.

@Override
protected void doExecute() {
    UpgradeService upgradeService = get(UpgradeService.class);
    UpgradeAdminService upgradeAdminService = get(UpgradeAdminService.class);
    if (command == null) {
        print("source=%s, target=%s, status=%s, upgraded=%b, active=%b", upgradeService.getState().source(), upgradeService.getState().target(), upgradeService.getState().status(), upgradeService.isLocalUpgraded(), upgradeService.isLocalActive());
    } else if (command.equals(INIT)) {
        upgradeAdminService.initialize();
        print("Initialized");
    } else if (command.equals(UPGRADE)) {
        upgradeAdminService.upgrade();
        print("Upgraded");
    } else if (command.equals(COMMIT)) {
        upgradeAdminService.commit();
        print("Committed version %s", upgradeService.getVersion());
    } else if (command.equals(ROLLBACK)) {
        upgradeAdminService.rollback();
        print("Rolled back to version %s", upgradeService.getVersion());
    } else if (command.equals(RESET)) {
        upgradeAdminService.reset();
        print("Reset version %s", upgradeService.getVersion());
    } else if (command.equals(STATUS)) {
        print("%s", upgradeService.getState().status());
    } else if (command.equals(VERSION)) {
        print("%s", upgradeService.getVersion());
    } else {
        print("Unsupported command: %s", command);
    }
}
Also used : UpgradeService(org.onosproject.upgrade.UpgradeService) UpgradeAdminService(org.onosproject.upgrade.UpgradeAdminService)

Aggregations

UpgradeAdminService (org.onosproject.upgrade.UpgradeAdminService)1 UpgradeService (org.onosproject.upgrade.UpgradeService)1