doggy 2.0.11 → 2.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/doggy/cli/pull.rb +5 -1
- data/lib/doggy/cli.rb +1 -1
- data/lib/doggy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c60775bd22060685fe56b5886ac24b7a16faa8cf
|
4
|
+
data.tar.gz: c28731b17bf0a5afd7b8d00bc218e3c4fa3fb8d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb30af3ae7cb7d439ac9bc509fa35e966b753afba16d2e84a1eebdc3a3ce9d92d1ee339f0952240f85529d5c1364f35265e97eba17377e2a686acae029585149
|
7
|
+
data.tar.gz: 06bfc1f3b26ab565f6c9d93f8c2d47325c1197a9cedcc35824e85fed076c4ef84bf05f7b433b4ddf40abec9f884e497e531639d83ce1024c3eb33ebecc3e6ad9
|
data/Gemfile.lock
CHANGED
data/lib/doggy/cli/pull.rb
CHANGED
@@ -5,18 +5,21 @@ module Doggy
|
|
5
5
|
def initialize(ids:, options:)
|
6
6
|
@ids = ids
|
7
7
|
@options = options
|
8
|
+
@updated_by_last_action = false
|
8
9
|
end
|
9
10
|
|
10
11
|
def run
|
11
12
|
pull_resources('dashboards', Models::Dashboard, @ids) if should_pull?('dashboards')
|
12
13
|
pull_resources('monitors', Models::Monitor, @ids) if should_pull?('monitors')
|
13
14
|
pull_resources('screens', Models::Screen, @ids) if should_pull?('screens')
|
15
|
+
|
16
|
+
Doggy.ui.say "Nothing to pull: please specify object ID or use '-a' to pull everything" unless @updated_by_last_action
|
14
17
|
end
|
15
18
|
|
16
19
|
private
|
17
20
|
|
18
21
|
def should_pull?(resource)
|
19
|
-
|
22
|
+
!@options.empty? || @options[resource] || @ids.any?
|
20
23
|
end
|
21
24
|
|
22
25
|
def pull_resources(name, klass, ids)
|
@@ -29,6 +32,7 @@ module Doggy
|
|
29
32
|
end
|
30
33
|
local_resources = klass.all_local
|
31
34
|
klass.assign_paths(remote_resources, local_resources)
|
35
|
+
@updated_by_last_action = true
|
32
36
|
remote_resources.each(&:save_local)
|
33
37
|
end
|
34
38
|
end
|
data/lib/doggy/cli.rb
CHANGED
@@ -15,6 +15,7 @@ module Doggy
|
|
15
15
|
method_option "dashboards", type: :boolean, desc: 'Pull dashboards'
|
16
16
|
method_option "monitors", type: :boolean, desc: 'Pull monitors'
|
17
17
|
method_option "screens", type: :boolean, desc: 'Pull screens'
|
18
|
+
method_option "all", type: :boolean, desc: 'Pull everything', aliases: '-a'
|
18
19
|
|
19
20
|
def pull(*ids)
|
20
21
|
CLI::Pull.new(ids: ids, options: options.dup).run
|
@@ -34,7 +35,6 @@ module Doggy
|
|
34
35
|
CLI::Push.new(options.dup).run
|
35
36
|
end
|
36
37
|
|
37
|
-
|
38
38
|
desc "mute OBJECT_ID OBJECT_ID OBJECT_ID", "Mutes monitor on DataDog"
|
39
39
|
long_desc <<-D
|
40
40
|
Mutes monitors on Datadog.
|
data/lib/doggy/version.rb
CHANGED