blob: f9cef4d38c4ac634a2d7557713fc96f5a952d2ee [file] [log] [blame]
daniel park128c52c2017-09-04 13:15:51 +09001/*
2 * Copyright 2017-present Open Networking Foundation
3 *
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 */
16package org.onosproject.openstacknetworkingui.cli;
17
18import org.apache.karaf.shell.commands.Argument;
19import org.apache.karaf.shell.commands.Command;
20import org.onosproject.cli.AbstractShellCommand;
21import org.onosproject.openstacknetworkingui.OpenstackNetworkingUiService;
22
23/**
24 * Sets the REST server ip address.
25 */
26@Command(scope = "onos", name = "openstacknetworking-ui-set-restserver-ip",
27 description = "Sets the REST server ip address")
28public class SetRestServerCommand extends AbstractShellCommand {
29
30 @Argument(index = 0, name = "restServerIp", description = "REST server ip address",
31 required = true, multiValued = false)
32 private String restServerIp = null;
33
34 @Override
35 protected void execute() {
36 OpenstackNetworkingUiService service = AbstractShellCommand.get(OpenstackNetworkingUiService.class);
37 service.setRestServerIp(restServerIp);
38 print("The REST server url is set to %s", service.restServerUrl());
39 }
40}