blob: 08b8883c8c2ff06ce018e7757bfba51030864c73 [file] [log] [blame]
Brian O'Connorabafb502014-12-02 22:26:20 -08001package org.onosproject.sdnip.cli;
Jonathan Hartec2df012014-10-23 16:40:24 -07002
3import org.apache.karaf.shell.commands.Argument;
4import org.apache.karaf.shell.commands.Command;
Brian O'Connorabafb502014-12-02 22:26:20 -08005import org.onosproject.cli.AbstractShellCommand;
6import org.onosproject.sdnip.SdnIpService;
Jonathan Hartec2df012014-10-23 16:40:24 -07007
8/**
9 * Command to change whether this SDNIP instance is primary or not.
10 */
11@Command(scope = "onos", name = "sdnip-set-primary",
12 description = "Changes the primary status of this SDN-IP instance")
13public class PrimaryChangeCommand extends AbstractShellCommand {
14
15 @Argument(index = 0, name = "isPrimary",
16 description = "True if this instance should be primary, false if not",
17 required = true, multiValued = false)
18 boolean isPrimary = false;
19
20 @Override
21 protected void execute() {
22 get(SdnIpService.class).modifyPrimary(isPrimary);
23 }
24
25}