blob: a73d6e484a1e7a6a9928d7ec7c6f8c33654aeb13 [file] [log] [blame]
Sean Condon87b78502018-09-17 20:53:24 +01001/*
2 * Copyright 2018-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.faultmanagement.alarms.cli;
18
Ray Milkeydf521292018-10-04 15:13:33 -070019import org.apache.karaf.shell.api.action.Argument;
20import org.apache.karaf.shell.api.action.Command;
Sean Condon87b78502018-09-17 20:53:24 +010021import org.onosproject.cli.AbstractShellCommand;
22import org.onosproject.faultmanagement.api.AlarmStore;
Thomas Vachuska52f2cd12018-11-08 21:20:04 -080023import org.onosproject.alarm.AlarmId;
Sean Condon87b78502018-09-17 20:53:24 +010024
25/**
26 * Remove an alarm from the Alarm Store.
27 */
28@Command(scope = "onos", name = "alarm-remove",
29 description = "Removes an alarm")
30public class RemoveAlarm extends AbstractShellCommand {
31 @Argument(index = 0, name = "alarmId", description = "Unique alarm id",
32 required = true, multiValued = false)
33 String alarmId = null;
34
35 private AlarmStore alarmStore = AbstractShellCommand.get(AlarmStore.class);
36
37 @Override
Ray Milkeydf521292018-10-04 15:13:33 -070038 protected void doExecute() {
Sean Condon87b78502018-09-17 20:53:24 +010039 alarmStore.removeAlarm(AlarmId.alarmId(alarmId));
40 }
41}