blob: 7ef8f4e38b2bb97d5db99387da90c2d6a08ccc37 [file] [log] [blame]
Thomas Vachuskae02e11c2014-11-24 16:13:52 -08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2014-present Open Networking Foundation
Thomas Vachuskae02e11c2014-11-24 16:13:52 -08003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.cli;
Thomas Vachuskae02e11c2014-11-24 16:13:52 -080017
Ray Milkeyd84f89b2018-08-17 14:54:17 -070018import org.apache.karaf.shell.api.action.Command;
19import org.apache.karaf.shell.api.action.lifecycle.Service;
Brian O'Connorabafb502014-12-02 22:26:20 -080020import org.onosproject.mastership.MastershipAdminService;
Thomas Vachuskae02e11c2014-11-24 16:13:52 -080021
22/**
23 * Forces device mastership rebalancing.
24 */
Ray Milkeyd84f89b2018-08-17 14:54:17 -070025@Service
Thomas Vachuskae02e11c2014-11-24 16:13:52 -080026@Command(scope = "onos", name = "balance-masters",
27 description = "Forces device mastership rebalancing")
28public class BalanceMastersCommand extends AbstractShellCommand {
29
30 @Override
Ray Milkeyd84f89b2018-08-17 14:54:17 -070031 protected void doExecute() {
Thomas Vachuska1e68bdd2014-11-29 13:53:10 -080032 get(MastershipAdminService.class).balanceRoles();
Thomas Vachuskae02e11c2014-11-24 16:13:52 -080033 }
34
35}