-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
_dogshell
1503 lines (1477 loc) · 55.5 KB
/
_dogshell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#compdef dogshell dog
# -----------------------------------------------------------------------------
#
# Copyright 2023, The zsh-completions Authors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of que nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# -----------------------------------------------------------------------------
#
# https://github.com/DataDog/datadogpy
#
# -----------------------------------------------------------------------------
function _dogshell() {
local context curcontext=$curcontext state line expl ret=1
declare -A opt_args
local -a _commands
_commands=(
"comment:Post, update, and delete comments."
"search:search datadog"
"metric:Post metrics."
"tag:View and modify host tags."
"event:Post events, get event details, and view the event stream."
"monitor:Create, edit, and delete monitors"
"timeboard:Create, edit, and delete timeboards"
"dashboard:Create, edit, and delete dashboards"
"screenboard:Create, edit, and delete screenboards."
"dashboard_list:Create, edit, and delete dashboard lists"
"host:Mute, unmute hosts"
"downtime:Create, edit, and delete downtimes"
"service_check:Perform service checks"
"service_level_objective:Create, edit, and delete service level objectives"
)
_arguments -C \
"(: -)"{-h,--help}"[show this help message and exit]" \
"(: -)--config[location of your dogrc file]:config:_files" \
"(: -)--api-key[your API key]:API KEY" \
"(: -)--application-key[your Application key]:APP_KEY" \
"(: -)--pretty[pretty-print output]" \
"(: -)--raw[raw JSON as returned by the HTTP service]" \
"(: -)--timeout[time to wait in seconds before timing out an API call]:duration" \
"(: -)"{-v,--version}"[Dog API version]" \
"(: -)--api_host[Datadog site to send data]" \
\
"1: :{_describe '$words[0] commands' _commands}" \
"*:: :->args" \
&& ret=0
local global_flags flags="-h,--help"
global_flags=({-h,--help}"[show this help message and exit]")
case $state in
args)
case $words[1] in
(comment)
local -a _comment_commands
_comment_commands=(
"post:Post comments."
"update:Update existing comments."
"reply:Reply to existing comments."
"show:Show comment details."
)
_arguments \
"1: :{_describe '$words[1] commands' _comment_commands}" \
&& ret=0
case $words[2] in
(post)
_arguments \
$global_flags \
"($flags)2:handle\: handle to post as" \
"($flags)*:comment\: comment message to post. if unset, reads from stdin." \
&& ret=0
;;
(update|reply)
_arguments \
$global_flags \
"($flags)2:comment_id\: comment to update (by id)" \
"($flags)3:handle\: handle to post as" \
"($flags)*:comment\: comment message to post. if unset, reads from stdin." \
&& ret=0
;;
(show)
_arguments \
$global_flags \
"($flags)2:comment_id\: comment to show" \
&& ret=0
;;
esac
;;
(search)
_arguments \
$global_flags \
"($flags)-foo[subcommand1 -foo argument]" \
"($flags -)*:file:_files" \
&& ret=0
;;
(metric)
_arguments \
$global_flags \
"($flags)-foo[subcommand1 -foo argument]" \
"($flags -)*:file:_files" \
&& ret=0
;;
(tag)
_arguments \
$global_flags \
"($flags)-foo[subcommand1 -foo argument]" \
"($flags -)*:file:_files" \
&& ret=0
;;
(event)
_arguments \
$global_flags \
"($flags)-foo[subcommand1 -foo argument]" \
"($flags -)*:file:_files" \
&& ret=0
;;
(monitor)
_arguments \
$global_flags \
"($flags)-foo[subcommand1 -foo argument]" \
"($flags -)*:file:_files" \
&& ret=0
;;
(timeboard)
_arguments \
$global_flags \
"($flags)-foo[subcommand1 -foo argument]" \
"($flags -)*:file:_files" \
&& ret=0
;;
(dashboard)
_arguments \
$global_flags \
"($flags)-foo[subcommand1 -foo argument]" \
"($flags -)*:file:_files" \
&& ret=0
;;
(screenboard)
_arguments \
$global_flags \
"($flags)-foo[subcommand1 -foo argument]" \
"($flags -)*:file:_files" \
&& ret=0
;;
(dashboard_list)
_arguments \
$global_flags \
"($flags)-foo[subcommand1 -foo argument]" \
"($flags -)*:file:_files" \
&& ret=0
;;
(host)
_arguments \
$global_flags \
"($flags)-foo[subcommand1 -foo argument]" \
"($flags -)*:file:_files" \
&& ret=0
;;
(downtime)
_arguments \
$global_flags \
"($flags)-foo[subcommand1 -foo argument]" \
"($flags -)*:file:_files" \
&& ret=0
;;
(service_check)
_arguments \
$global_flags \
"($flags)-foo[subcommand1 -foo argument]" \
"($flags -)*:file:_files" \
&& ret=0
;;
(service_level_objective)
_arguments \
$global_flags \
"($flags)-foo[subcommand1 -foo argument]" \
"($flags -)*:file:_files" \
&& ret=0
;;
esac
;;
esac
return ret
}
_dogshell "$*"
# -----------------------------------------------------------------------------
#
# usage: dog [-h] [--config CONFIG] [--api-key API_KEY]
# [--application-key APP_KEY] [--pretty] [--raw] [--timeout TIMEOUT]
# [-v] [--api_host API_HOST]
# {comment,search,metric,tag,event,monitor,timeboard,dashboard,screenboard,dashboard_list,host,downtime,service_check,service_level_objective}
# ...
#
# Interact with the Datadog API
#
# options:
# -h, --help show this help message and exit
# --config CONFIG location of your dogrc file (default ~/.dogrc)
# (default: /Users/zchee/.dogrc)
# --api-key API_KEY your API key, from
# https://app.datadoghq.com/account/settings#api. You
# can also set the environment variables DATADOG_API_KEY
# or DD_API_KEY
# --application-key APP_KEY
# your Application key, from
# https://app.datadoghq.com/account/settings#api. You
# can also set the environment variables DATADOG_APP_KEY
# or DD_APP_KEY (default: None)
# --pretty pretty-print output (suitable for human consumption,
# less useful for scripting) (default: None)
# --raw raw JSON as returned by the HTTP service (default:
# None)
# --timeout TIMEOUT time to wait in seconds before timing out an API call
# (default 10) (default: 10)
# -v, --version Dog API version
# --api_host API_HOST Datadog site to send data, us (datadoghq.com), eu
# (datadoghq.eu), us3 (us3.datadoghq.com), us5
# (us5.datadoghq.com), ap1 (ap1.datadoghq.com), gov
# (ddog-gov.com), or custom url. default: us (default:
# None)
#
# Modes:
# {comment,search,metric,tag,event,monitor,timeboard,dashboard,screenboard,dashboard_list,host,downtime,service_check,service_level_objective}
# comment Post, update, and delete comments.
# search search datadog
# metric Post metrics.
# tag View and modify host tags.
# event Post events, get event details, and view the event
# stream.
# monitor Create, edit, and delete monitors
# timeboard Create, edit, and delete timeboards
# dashboard Create, edit, and delete dashboards
# screenboard Create, edit, and delete screenboards.
# dashboard_list Create, edit, and delete dashboard lists
# host Mute, unmute hosts
# downtime Create, edit, and delete downtimes
# service_check Perform service checks
# service_level_objective
# Create, edit, and delete service level objectives
#
# -----------------------------------------------------------------------------
#
# usage: dog comment [-h] {post,update,reply,show} ...
#
# options:
# -h, --help show this help message and exit
#
# Verbs:
# {post,update,reply,show}
# post Post comments.
# update Update existing comments.
# reply Reply to existing comments.
# show Show comment details.
#
# -----------------------------------------------------------------------------
#
# usage: dog comment post [-h] handle [comment]
#
# positional arguments:
# handle handle to post as.
# comment comment message to post. if unset, reads from stdin.
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog comment update [-h] comment_id handle [comment]
#
# positional arguments:
# comment_id comment to update (by id)
# handle handle to post as.
# comment comment message to post. if unset, reads from stdin.
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog comment reply [-h] comment_id handle [comment]
#
# positional arguments:
# comment_id comment to reply to (by id)
# handle handle to post as.
# comment comment message to post. if unset, reads from stdin.
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog comment show [-h] comment_id
#
# positional arguments:
# comment_id comment to show
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog search [-h] {query} ...
#
# options:
# -h, --help show this help message and exit
#
# Verbs:
# {query}
# query Search datadog.
#
# -----------------------------------------------------------------------------
#
# usage: dog search query [-h] query
#
# positional arguments:
# query optionally faceted search query
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog metric [-h] {post} ...
#
# options:
# -h, --help show this help message and exit
#
# Verbs:
# {post}
# post Post metrics
#
# -----------------------------------------------------------------------------
#
# usage: dog metric post [-h] [--host HOST] [--no_host] [--device DEVICE] [--tags TAGS] [--localhostname] [--type TYPE] name value
#
# positional arguments:
# name metric name
# value metric value (integer or decimal value)
#
# options:
# -h, --help show this help message and exit
# --host HOST scopes your metric to a specific host (default to the local host name)
# --no_host no host is associated with the metric (overrides --host))
# --device DEVICE scopes your metric to a specific device
# --tags TAGS comma-separated list of tags
# --localhostname deprecated, used to force `--host` to the local hostname (now default when no `--host` is specified)
# --type TYPE type of the metric - gauge(32bit float) or counter(64bit integer)
#
# -----------------------------------------------------------------------------
#
# usage: dog tag [-h] {add,replace,show,detach} ...
#
# options:
# -h, --help show this help message and exit
#
# Verbs:
# {add,replace,show,detach}
# add Add a host to one or more tags.
# replace Replace all tags with one or more new tags.
# show Show host tags.
# detach Remove a host from all tags.
#
# -----------------------------------------------------------------------------
#
# usage: dog tag add [-h] host tag [tag ...]
#
# Hosts can be specified by name or id.
#
# positional arguments:
# host host to add
# tag tag to add host to (one or more, space separated)
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog tag replace [-h] host tag [tag ...]
#
# Hosts can be specified by name or id.
#
# positional arguments:
# host host to modify
# tag list of tags to add host to
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog tag show [-h] host
#
# Hosts can be specified by name or id.
#
# positional arguments:
# host host to show (or 'all' to show all tags)
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog tag detach [-h] host
#
# Hosts can be specified by name or id.
#
# positional arguments:
# host host to detach
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog event [-h] {post,show,stream} ...
#
# options:
# -h, --help show this help message and exit
#
# Verbs:
# {post,show,stream}
# post Post events.
# show Show event details.
# stream Retrieve events from the Event Stream
#
# -----------------------------------------------------------------------------
#
# usage: dog event post [-h] [--date_happened DATE_HAPPENED] [--handle HANDLE] [--priority PRIORITY] [--related_event_id RELATED_EVENT_ID] [--tags TAGS] [--host HOST] [--no_host] [--device DEVICE] [--aggregation_key AGGREGATION_KEY] [--type TYPE] [--alert_type ALERT_TYPE] title [message]
#
# positional arguments:
# title event title
# message event message body. if unset, reads from stdin.
#
# options:
# -h, --help show this help message and exit
# --date_happened DATE_HAPPENED
# POSIX timestamp when the event occurred. if unset defaults to the current time.
# --handle HANDLE user to post as. if unset, submits as the generic API user.
# --priority PRIORITY "normal" or "low". defaults to "normal"
# --related_event_id RELATED_EVENT_ID
# event to post as a child of. if unset, posts a top-level event
# --tags TAGS comma separated list of tags
# --host HOST related host (default to the local host name)
# --no_host no host is associated with the event (overrides --host))
# --device DEVICE related device (e.g. eth0, /dev/sda1)
# --aggregation_key AGGREGATION_KEY
# key to aggregate the event with
# --type TYPE type of event, e.g. nagios, jenkins, etc.
# --alert_type ALERT_TYPE
# "error", "warning", "info" or "success". defaults to "info"
#
# -----------------------------------------------------------------------------
#
# usage: dog event show [-h] event_id
#
# positional arguments:
# event_id event to show
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog event stream [-h] [--priority PRIORITY] [--sources SOURCES] [--tags TAGS] start [end]
#
# Stream start and end times can be specified as either a POSIX timestamp (e.g. the output of `date +%s`) or as a period of time in the past (e.g. '5m', '6h', '3d').
#
# positional arguments:
# start start date for the stream request
# end end date for the stream request (defaults to 'now')
#
# options:
# -h, --help show this help message and exit
# --priority PRIORITY filter by priority. 'normal' or 'low'. defaults to 'normal'
# --sources SOURCES comma separated list of sources to filter by
# --tags TAGS comma separated list of tags to filter by
#
# -----------------------------------------------------------------------------
#
# usage: dog monitor [-h] [--string_ids] {post,fpost,update,fupdate,show,show_all,delete,mute_all,unmute_all,mute,unmute,can_delete,validate} ...
#
# options:
# -h, --help show this help message and exit
# --string_ids Represent monitor IDs as strings instead of ints in JSON
#
# Verbs:
# {post,fpost,update,fupdate,show,show_all,delete,mute_all,unmute_all,mute,unmute,can_delete,validate}
# post Create a monitor
# fpost Create a monitor from file
# update Update existing monitor
# fupdate Update existing monitor from file
# show Show a monitor definition
# show_all Show a list of all monitors
# delete Delete a monitor
# mute_all Globally mute monitors (downtime over *)
# unmute_all Globally unmute monitors (cancel downtime over *)
# mute Mute a monitor
# unmute Unmute a monitor
# can_delete Check if you can delete some monitors
# validate Validates if a monitor definition is correct
#
# -----------------------------------------------------------------------------
#
# usage: dog monitor post [-h] [--name NAME] [--message MESSAGE] [--tags TAGS] [--priority PRIORITY] [--options OPTIONS] type query
#
# positional arguments:
# type type of the monitor, e.g.'metric alert' 'service check'
# query query to notify on with syntax varying depending on what type of monitor you are creating
#
# options:
# -h, --help show this help message and exit
# --name NAME name of the alert
# --message MESSAGE message to include with notifications for this monitor
# --tags TAGS comma-separated list of tags
# --priority PRIORITY Integer from 1 (high) to 5 (low) indicating alert severity.
# --options OPTIONS json options for the monitor
#
# -----------------------------------------------------------------------------
#
# usage: dog monitor fpost [-h] file
#
# positional arguments:
# file json file holding all details
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog monitor update [-h] [--type TYPE_OPT] [--query QUERY_OPT] [--name NAME] [--tags TAGS] [--message MESSAGE] [--priority PRIORITY] [--options OPTIONS] monitor_id [type] [query]
#
# positional arguments:
# monitor_id monitor to replace with the new definition
# type [Deprecated] optional argument preferredtype of the monitor, e.g. 'metric alert' 'service check'
# query [Deprecated] optional argument preferredquery to notify on with syntax varying depending on monitor type
#
# options:
# -h, --help show this help message and exit
# --type TYPE_OPT type of the monitor, e.g. 'metric alert' 'service check'
# --query QUERY_OPT query to notify on with syntax varying depending on monitor type
# --name NAME name of the alert
# --tags TAGS comma-separated list of tags
# --message MESSAGE message to include with notifications for this monitor
# --priority PRIORITY Integer from 1 (high) to 5 (low) indicating alert severity.
# --options OPTIONS json options for the monitor
#
# -----------------------------------------------------------------------------
#
# usage: dog monitor fupdate [-h] file
#
# positional arguments:
# file json file holding all details
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog monitor show [-h] monitor_id
#
# positional arguments:
# monitor_id monitor to show
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog monitor show_all [-h] [--group_states GROUP_STATES] [--name NAME] [--tags TAGS] [--monitor_tags MONITOR_TAGS]
#
# options:
# -h, --help show this help message and exit
# --group_states GROUP_STATES
# comma separated list of group states to filter by(choose one or more from 'all', 'alert', 'warn', or 'no data')
# --name NAME string to filter monitors by name
# --tags TAGS comma separated list indicating what tags, if any, should be used to filter the list of monitors by scope (e.g. 'host:host0')
# --monitor_tags MONITOR_TAGS
# comma separated list indicating what service and/or custom tags, if any, should be used to filter the list of monitors
#
# -----------------------------------------------------------------------------
#
# usage: dog monitor delete [-h] monitor_id
#
# positional arguments:
# monitor_id monitor to delete
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog monitor mute_all [-h]
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog monitor unmute_all [-h]
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog monitor mute [-h] [--scope SCOPE] [--end END] monitor_id
#
# positional arguments:
# monitor_id monitor to mute
#
# options:
# -h, --help show this help message and exit
# --scope SCOPE scope to apply the mute to, e.g. role:db (optional)
# --end END POSIX timestamp for when the mute should end (optional)
#
# -----------------------------------------------------------------------------
#
# usage: dog monitor unmute [-h] [--scope SCOPE] [--all_scopes] monitor_id
#
# positional arguments:
# monitor_id monitor to unmute
#
# options:
# -h, --help show this help message and exit
# --scope SCOPE scope to unmute (must be muted), e.g. role:db
# --all_scopes clear muting across all scopes
#
# -----------------------------------------------------------------------------
#
# usage: dog monitor can_delete [-h] monitor_ids
#
# positional arguments:
# monitor_ids monitors to check if they can be deleted
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog timeboard [-h] [--string_ids] {post,update,show,show_all,pull,pull_all,push,new_file,web_view,delete} ...
#
# options:
# -h, --help show this help message and exit
# --string_ids Represent timeboard IDs as strings instead of ints in JSON
#
# Verbs:
# {post,update,show,show_all,pull,pull_all,push,new_file,web_view,delete}
# post Create timeboards
# update Update existing timeboards
# show Show a timeboard definition
# show_all Show a list of all timeboards
# pull Pull a timeboard on the server into a local file
# pull_all Pull all timeboards into files in a directory
# push Push updates to timeboards from local files to the server
# new_file Create a new timeboard and put its contents in a file
# web_view View the timeboard in a web browser
# delete Delete timeboards
#
# -----------------------------------------------------------------------------
#
# usage: dog timeboard post [-h] [--template_variables TEMPLATE_VARIABLES] title description [graphs]
#
# positional arguments:
# title title for the new timeboard
# description short description of the timeboard
# graphs graph definitions as a JSON string. if unset, reads from stdin.
#
# options:
# -h, --help show this help message and exit
# --template_variables TEMPLATE_VARIABLES
# a json list of template variable dicts, e.g. [{'name': 'host', 'prefix': 'host', 'default': 'host:my-host'}]'
#
# -----------------------------------------------------------------------------
#
# usage: dog timeboard update [-h] [--template_variables TEMPLATE_VARIABLES] timeboard_id title description [graphs]
#
# positional arguments:
# timeboard_id timeboard to replace with the new definition
# title new title for the timeboard
# description short description of the timeboard
# graphs graph definitions as a JSON string. if unset, reads from stdin
#
# options:
# -h, --help show this help message and exit
# --template_variables TEMPLATE_VARIABLES
# a json list of template variable dicts, e.g. [{'name': 'host', 'prefix': 'host', 'default': 'host:my-host'}]'
#
# -----------------------------------------------------------------------------
#
# usage: dog timeboard show [-h] timeboard_id
#
# positional arguments:
# timeboard_id timeboard to show
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog timeboard show_all [-h]
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog timeboard pull [-h] timeboard_id filename
#
# positional arguments:
# timeboard_id ID of timeboard to pull
# filename file to pull timeboard into
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog timeboard pull_all [-h] pull_dir
#
# positional arguments:
# pull_dir directory to pull timeboards into
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog timeboard push [-h] [--append_auto_text] file [file ...]
#
# positional arguments:
# file timeboard files to push to the server
#
# options:
# -h, --help show this help message and exit
# --append_auto_text When pushing to the server, appends filename and timestamp to the end of the timeboard description
#
# -----------------------------------------------------------------------------
#
# usage: dog timeboard new_file [-h] filename [graphs]
#
# positional arguments:
# filename name of file to create with empty timeboard
# graphs graph definitions as a JSON string. if unset, reads from stdin.
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog timeboard web_view [-h] file
#
# positional arguments:
# file timeboard file
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog timeboard delete [-h] timeboard_id
#
# positional arguments:
# timeboard_id timeboard to delete
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog monitor validate [-h] [--name NAME] [--message MESSAGE] [--tags TAGS] [--options OPTIONS] type query
#
# positional arguments:
# type type of the monitor, e.g.'metric alert' 'service check'
# query the monitor query
#
# options:
# -h, --help show this help message and exit
# --name NAME name of the alert
# --message MESSAGE message to include with notifications for this monitor
# --tags TAGS comma-separated list of tags
# --options OPTIONS json options for the monitor
#
# -----------------------------------------------------------------------------
#
# usage: dog dashboard [-h] {post,update,show,delete} ...
#
# options:
# -h, --help show this help message and exit
#
# Verbs:
# {post,update,show,delete}
# post Create dashboards
# update Update existing dashboards
# show Show a dashboard definition
# delete Delete dashboards
#
# -----------------------------------------------------------------------------
#
# usage: dog dashboard post [-h] [--description DESCRIPTION] [--read_only] [--notify_list NOTIFY_LIST] [--template_variables TEMPLATE_VARIABLES] title [widgets] {ordered,free}
#
# positional arguments:
# title title for the new dashboard
# widgets widget definitions as a JSON string. If unset, reads from stdin.
# {ordered,free} Layout type of the dashboard.
#
# options:
# -h, --help show this help message and exit
# --description DESCRIPTION
# Short description of the dashboard
# --read_only Whether this dashboard is read-only. If True, only the author and admins can make changes to it.
# --notify_list NOTIFY_LIST
# A json list of user handles, e.g. '["[email protected]", "[email protected]"]'
# --template_variables TEMPLATE_VARIABLES
# A json list of template variable dicts, e.g. '[{"name": "host", "prefix": "host", "default": "my-host"}]'
#
# -----------------------------------------------------------------------------
#
# usage: dog dashboard update [-h] [--description DESCRIPTION] [--read_only] [--notify_list NOTIFY_LIST] [--template_variables TEMPLATE_VARIABLES] dashboard_id title [widgets] {ordered,free}
#
# positional arguments:
# dashboard_id Dashboard to replace with the new definition
# title New title for the dashboard
# widgets Widget definitions as a JSON string. If unset, reads from stdin
# {ordered,free} Layout type of the dashboard.
#
# options:
# -h, --help show this help message and exit
# --description DESCRIPTION
# Short description of the dashboard
# --read_only Whether this dashboard is read-only. If True, only the author and admins can make changes to it.
# --notify_list NOTIFY_LIST
# A json list of user handles, e.g. '["[email protected]", "[email protected]"]'
# --template_variables TEMPLATE_VARIABLES
# A json list of template variable dicts, e.g. '[{"name": "host", "prefix": "host", "default": "my-host"}]'
#
# -----------------------------------------------------------------------------
#
# usage: dog dashboard show [-h] dashboard_id
#
# positional arguments:
# dashboard_id Dashboard to show
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog dashboard delete [-h] dashboard_id
#
# positional arguments:
# dashboard_id Dashboard to delete
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog screenboard [-h] [--string_ids] {post,update,show,delete,share,revoke,pull,push,new_file} ...
#
# options:
# -h, --help show this help message and exit
# --string_ids Represent screenboard IDs as strings instead of ints in JSON
#
# Verbs:
# {post,update,show,delete,share,revoke,pull,push,new_file}
# post Create screenboards.
# update Update existing screenboards.
# show Show a screenboard definition.
# delete Delete a screenboard.
# share Share an existing screenboard's with a public URL.
# revoke Revoke an existing screenboard's with a public URL.
# pull Pull a screenboard on the server into a local file
# push Push updates to screenboards from local files to the server
# new_file Create a new screenboard and put its contents in a file
#
# -----------------------------------------------------------------------------
#
# usage: dog screenboard post [-h] [--template_variables TEMPLATE_VARIABLES] [--width WIDTH] [--height HEIGHT] title description [graphs]
#
# positional arguments:
# title title for the new screenboard
# description short description of the screenboard
# graphs graph definitions as a JSON string. if unset, reads from stdin.
#
# options:
# -h, --help show this help message and exit
# --template_variables TEMPLATE_VARIABLES
# a json list of template variable dicts, e.g. [{'name': 'host', 'prefix': 'host', 'default': 'host:my-host'}]
# --width WIDTH screenboard width in pixels
# --height HEIGHT screenboard height in pixels
#
# -----------------------------------------------------------------------------
#
# usage: dog screenboard update [-h] [--template_variables TEMPLATE_VARIABLES] [--width WIDTH] [--height HEIGHT] screenboard_id title description [graphs]
#
# positional arguments:
# screenboard_id screenboard to replace with the new definition
# title title for the new screenboard
# description short description of the screenboard
# graphs graph definitions as a JSON string. if unset, reads from stdin.
#
# options:
# -h, --help show this help message and exit
# --template_variables TEMPLATE_VARIABLES
# a json list of template variable dicts, e.g. [{'name': 'host', 'prefix': 'host', 'default': 'host:my-host'}]
# --width WIDTH screenboard width in pixels
# --height HEIGHT screenboard height in pixels
#
# -----------------------------------------------------------------------------
#
# usage: dog screenboard show [-h] screenboard_id
#
# positional arguments:
# screenboard_id screenboard to show
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog screenboard delete [-h] screenboard_id
#
# positional arguments:
# screenboard_id screenboard to delete
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog screenboard share [-h] screenboard_id
#
# positional arguments:
# screenboard_id screenboard to share
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog screenboard revoke [-h] screenboard_id
#
# positional arguments:
# screenboard_id screenboard to revoke
#
# options:
# -h, --help show this help message and exit
#
# -----------------------------------------------------------------------------
#
# usage: dog screenboard pull [-h] screenboard_id filename
#