chihuahua 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/chihuahua/cli.rb +3 -11
- data/lib/chihuahua/client.rb +2 -2
- data/lib/chihuahua/export.rb +2 -1
- data/lib/chihuahua/update.rb +1 -1
- data/lib/chihuahua/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: 913ec7477b86c2caa70d3a46407a7971f8489852
|
4
|
+
data.tar.gz: 3a0afe816df2a62ad44d5d08986cbf038f546cbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 520c640c57c85b47e908ca8f7354d85287caaacad2c2e9482cb749d63248fa99658863af77be2ef60cdae433961459496678077e379a4fb270aa758fb530e373
|
7
|
+
data.tar.gz: 4c7ef217fb1f04d8ee7d1ca3a8c73a0e43d7dc35c13dde9c6ca370f5b24715ab21b20618943562885aa63da7911dd9d13ceed15cd1f0b42d281fd3d2e41e8405
|
data/lib/chihuahua/cli.rb
CHANGED
@@ -9,8 +9,6 @@ require 'highline'
|
|
9
9
|
module Chihuahua
|
10
10
|
class CLI < Thor
|
11
11
|
default_command :version
|
12
|
-
# class_option :api_key
|
13
|
-
# class_option :app_key
|
14
12
|
|
15
13
|
desc 'version', 'version 情報を出力.'
|
16
14
|
def version
|
@@ -21,6 +19,7 @@ module Chihuahua
|
|
21
19
|
option :project, type: :string, aliases: '-p', desc: 'Project を指定.(Project 名でディレクトリを作成する)'
|
22
20
|
option :name, type: :string, aliases: '-n', desc: 'Monitor を name キーで絞り込む.'
|
23
21
|
option :tags, type: :array, aliases: '-t', desc: 'Monitor を tags キーで絞り込む.'
|
22
|
+
option :dry_run, type: :boolean, aliases: '-d', desc: 'export 前の試行.'
|
24
23
|
def export
|
25
24
|
unless options[:project] then
|
26
25
|
puts 'Project 名がセットされていません. (--project xxxxxx)'
|
@@ -28,14 +27,13 @@ module Chihuahua
|
|
28
27
|
end
|
29
28
|
|
30
29
|
puts 'Export...'
|
31
|
-
# exporter = Chihuahua::Export.new(options[:project])
|
32
30
|
args = {}
|
33
31
|
args['name'] = options[:name]
|
34
32
|
args['tags'] = options[:tags]
|
35
33
|
exporter = Chihuahua::Export.new(options[:project], args)
|
36
34
|
monitors_data = exporter.export_monitors(options[:project])
|
37
|
-
puts monitors_data.length.to_s + ' 件の Monitors
|
38
|
-
exporter.store_monitors_data(monitors_data)
|
35
|
+
puts monitors_data.length.to_s + ' 件の Monitors 定義を出力します.'
|
36
|
+
exporter.store_monitors_data(monitors_data) unless options[:dry_run]
|
39
37
|
end
|
40
38
|
#
|
41
39
|
desc 'apply', 'Monitors 定義を apply する'
|
@@ -51,12 +49,6 @@ module Chihuahua
|
|
51
49
|
updater.update_monitors(options[:dry_run])
|
52
50
|
end
|
53
51
|
|
54
|
-
desc 'generate', 'Monitors 定義の雛形を生成する.'
|
55
|
-
option :project, type: :string, aliases: '-p', desc: 'Project を指定.'
|
56
|
-
def generate
|
57
|
-
#
|
58
|
-
end
|
59
|
-
|
60
52
|
desc 'init', 'Project の Root ディレクトリ(./monitors)を作成する.'
|
61
53
|
def init
|
62
54
|
Chihuahua::Helper.create_project_root_dir
|
data/lib/chihuahua/client.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
module Chihuahua
|
3
3
|
class Client
|
4
4
|
def initialize
|
5
|
-
raise 'API Key
|
6
|
-
raise 'Application Key
|
5
|
+
raise 'API Key does not exist.' unless ENV['DATADOG_API_KEY']
|
6
|
+
raise 'Application Key does not exist.' unless ENV['DATADOG_APP_KEY']
|
7
7
|
@api_key = ENV['DATADOG_API_KEY']
|
8
8
|
@app_key = ENV['DATADOG_APP_KEY']
|
9
9
|
end
|
data/lib/chihuahua/export.rb
CHANGED
@@ -14,7 +14,7 @@ module Chihuahua
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def export_result_display(name)
|
17
|
-
puts hl.color(name, :magenta) + '
|
17
|
+
puts hl.color(name, :magenta) + ' exporting...'
|
18
18
|
end
|
19
19
|
|
20
20
|
def export_monitors(project)
|
@@ -67,6 +67,7 @@ module Chihuahua
|
|
67
67
|
rescue => e
|
68
68
|
puts e
|
69
69
|
end
|
70
|
+
puts 'done.'
|
70
71
|
end
|
71
72
|
end
|
72
73
|
end
|
data/lib/chihuahua/update.rb
CHANGED
data/lib/chihuahua/version.rb
CHANGED