blob: 1925003cc5ce9042d035e1ba01c515a657bd57aa [file] [log] [blame]
Kalhee Kimba366062017-11-07 16:32:09 +00001/*
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 */
16
17package org.onosproject.dhcprelay.cli;
18
Ray Milkey86ad7bb2018-09-27 12:32:28 -070019import org.apache.karaf.shell.api.action.Command;
Ray Milkey7a2dee52018-09-28 10:58:28 -070020import org.apache.karaf.shell.api.action.lifecycle.Service;
Kalhee Kimba366062017-11-07 16:32:09 +000021import org.onosproject.cli.AbstractShellCommand;
Ray Milkey86ad7bb2018-09-27 12:32:28 -070022import org.apache.karaf.shell.api.action.Argument;
Kalhee Kimba366062017-11-07 16:32:09 +000023import org.onlab.packet.IpPrefix;
24import org.onosproject.dhcprelay.api.DhcpRelayService;
25
26/**
27 * Prints Dhcp FPM Routes information.
28 */
Ray Milkey7a2dee52018-09-28 10:58:28 -070029@Service
Kalhee Kimba366062017-11-07 16:32:09 +000030@Command(scope = "onos", name = "dhcp-fpm-delete",
31 description = "delete DHCP FPM prefix in dhcp-fpm-store")
32public class DhcpFpmDeleteCommand extends AbstractShellCommand {
33
34 private static final DhcpRelayService DHCP_RELAY_SERVICE = get(DhcpRelayService.class);
35
36 @Argument(index = 0, name = "prefix",
37 description = "prefix",
38 required = true, multiValued = false)
39 String prefixString = null;
40
41 @Override
Ray Milkey86ad7bb2018-09-27 12:32:28 -070042 protected void doExecute() {
Kalhee Kimba366062017-11-07 16:32:09 +000043 IpPrefix prefix = IpPrefix.valueOf(prefixString);
44
45 DHCP_RELAY_SERVICE.removeFpmRecord(prefix);
46 }
47}