blob: eadaa7d11e3732d2dd022eb4478a25e90041ae3d [file] [log] [blame]
Thomas Vachuska90b453f2015-01-30 18:57:14 -08001/*
2 * Copyright 2015 Open Networking Laboratory
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.cli.app;
17
18import org.apache.karaf.shell.commands.Argument;
19import org.apache.karaf.shell.commands.Command;
20import org.onosproject.app.ApplicationAdminService;
21import org.onosproject.cli.AbstractShellCommand;
22import org.onosproject.core.ApplicationId;
23
24/**
25 * Activates an installed application.
26 */
Thomas Vachuska1dcb0482015-02-18 18:21:28 -080027@Deprecated
Thomas Vachuska90b453f2015-01-30 18:57:14 -080028@Command(scope = "onos", name = "app-activate",
29 description = "Activates an installed application")
30public class ApplicationActivateCommand extends AbstractShellCommand {
31
32 @Argument(index = 0, name = "name", description = "Application name",
33 required = true, multiValued = false)
34 String name = null;
35
36 @Override
37 protected void execute() {
38 ApplicationAdminService service = get(ApplicationAdminService.class);
39 ApplicationId appId = service.getId(name);
40 if (appId != null) {
41 service.activate(appId);
42 } else {
43 print("No such application: %s", name);
44 }
45 }
46
47}