blob: 6e8d3e9cf8804dac81fdbcd0fc6d53e8333a65bd [file] [log] [blame]
Charles Chand7844e52016-10-20 17:02:44 -07001/*
Brian O'Connor0947d7e2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Charles Chand7844e52016-10-20 17:02:44 -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 */
16
Saurav Das07c74602016-04-27 18:35:50 -070017package org.onosproject.segmentrouting.cli;
18
19
Ray Milkeydb38bc82018-09-27 12:32:28 -070020import org.apache.karaf.shell.api.action.Command;
Ray Milkey52ca4e92018-09-28 10:58:28 -070021import org.apache.karaf.shell.api.action.lifecycle.Service;
Saurav Das07c74602016-04-27 18:35:50 -070022import org.onosproject.cli.AbstractShellCommand;
23import org.onosproject.segmentrouting.SegmentRoutingService;
24
25/**
26 * Command to manually trigger routing and rule-population in the network.
27 *
28 */
Ray Milkey52ca4e92018-09-28 10:58:28 -070029@Service
Saurav Das07c74602016-04-27 18:35:50 -070030@Command(scope = "onos", name = "sr-reroute-network",
31 description = "Repopulate routing rules given current network state")
32public class RerouteNetworkCommand extends AbstractShellCommand {
33
34 @Override
Ray Milkeydb38bc82018-09-27 12:32:28 -070035 protected void doExecute() {
Saurav Das07c74602016-04-27 18:35:50 -070036 SegmentRoutingService srService =
37 AbstractShellCommand.get(SegmentRoutingService.class);
38 srService.rerouteNetwork();
39 }
40
41}