blob: 6bbb1a656dabb4fe13a2e0685393aaed13f2e0aa [file] [log] [blame]
Xin Jin313708b2015-07-09 13:43:04 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Xin Jin313708b2015-07-09 13:43:04 -07003 *
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.net;
17
18import org.apache.karaf.shell.commands.Argument;
19import org.apache.karaf.shell.commands.Command;
20import org.onosproject.cli.AbstractShellCommand;
21import org.onosproject.net.flowobjective.FlowObjectiveService;
22
23/**
24 * Manages FlowObjectiveComposition policy.
25 */
26@Command(scope = "onos", name = "policy",
27 description = "Manages FlowObjectiveComposition policy")
28public class FlowObjectiveCompositionCommand extends AbstractShellCommand {
29
30 @Argument(index = 0, name = "command",
31 description = "Command name (install)",
32 required = true, multiValued = false)
33 String command = null;
34
35 @Argument(index = 1, name = "names", description = "policy string",
36 required = true, multiValued = true)
37 String[] policies = null;
38
39 @Override
40 protected void execute() {
41 FlowObjectiveService service = get(FlowObjectiveService.class);
42 service.initPolicy(policies[0]);
43 print("Policy %s installed", policies[0]);
44 }
45}