blob: 5b20238afb323f1804f78c42af3247da7f37af68 [file] [log] [blame]
Jonathan Hartec2df012014-10-23 16:40:24 -07001package org.onlab.onos.sdnip.cli;
2
3import org.apache.karaf.shell.commands.Argument;
4import org.apache.karaf.shell.commands.Command;
5import org.onlab.onos.cli.AbstractShellCommand;
6import org.onlab.onos.sdnip.SdnIpService;
7
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}