|
4 | 4 |
|
5 | 5 |
|
6 | 6 | @click.command('note', short_help='Add note') |
7 | | -@click.option('--ids', '-i', metavar='ID', multiple=True, help='List of note IDs') |
8 | 7 | @click.option('--alert-ids', '-i', metavar='ID', multiple=True, help='List of alert IDs (can use short 8-char id)') |
9 | 8 | @click.option('--query', '-q', 'query', metavar='QUERY', help='severity:"warning" AND resource:web') |
10 | 9 | @click.option('--filter', '-f', 'filters', metavar='FILTER', multiple=True, help='KEY=VALUE eg. serverity=warning resource=web') |
11 | 10 | @click.option('--text', help='Note or message') |
12 | | -@click.option('--delete', '-D', metavar='ID', nargs=2, help='Delete note parent ID and note ID') |
| 11 | +@click.option('--delete', '-D', metavar='ID', nargs=2, help='Delete note, using alert ID and note ID') |
13 | 12 | @click.pass_obj |
14 | | -def cli(obj, ids, alert_ids, query, filters, text, delete): |
15 | | - """Add or delete note to alerts.""" |
| 13 | +def cli(obj, alert_ids, query, filters, text, delete): |
| 14 | + """ |
| 15 | + Add or delete note to alerts. |
| 16 | +
|
| 17 | + EXAMPLES |
| 18 | +
|
| 19 | + Add a note to an alert. |
| 20 | +
|
| 21 | + $ alerta note --alert-ids <alert-id> --text <note> |
| 22 | +
|
| 23 | + List notes for an alert. |
| 24 | +
|
| 25 | + $ alerta notes --alert-ids <alert-id> |
| 26 | +
|
| 27 | + Delete a note for an alert. |
| 28 | +
|
| 29 | + $ alerta note -D <alert-id> <note-id> |
| 30 | + """ |
16 | 31 | client = obj['client'] |
17 | 32 | if delete: |
18 | 33 | client.delete_alert_note(*delete) |
|
0 commit comments