holistics 0.2.3 → 0.2.4
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/CHANGELOG.md +3 -0
- data/lib/email_schedule.rb +19 -0
- data/lib/holistics/api_client.rb +12 -0
- data/lib/holistics/version.rb +1 -1
- data/lib/holistics.rb +4 -2
- data/lib/import.rb +7 -6
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 929efc7e8a45d79587907327cc2d932df8b5e0bf
|
4
|
+
data.tar.gz: 76cd53dd656d93b94ce9856f1f5909cb11079c5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4315095505432582fb1ab87880ddc659444ee2586f1fa274b12b3a3e8f318bbfd38c33090dacc8bc117d0df7d414b570cdf6668ddd9dd34b0a969c4c6385d01
|
7
|
+
data.tar.gz: 867462fbdee8a834e300a33d8845d120d843f8b18b48c0b84a62e8b7a6386371b84e638dfe931d10f3a9f5fb770c07a032bfa204500da13721e70868c28ef856
|
data/CHANGELOG.md
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'thor'
|
2
|
+
|
3
|
+
module Holistics
|
4
|
+
class EmailSchedule < Thor
|
5
|
+
|
6
|
+
desc 'send [email_schedule_id]', 'Invoke Email Schedule with command-line'
|
7
|
+
|
8
|
+
def send es_id
|
9
|
+
api_client.invoke_email_schedule(es_id, options)
|
10
|
+
end
|
11
|
+
|
12
|
+
no_commands do
|
13
|
+
def api_client
|
14
|
+
@api_client ||= ApiClient.new
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
data/lib/holistics/api_client.rb
CHANGED
@@ -61,6 +61,18 @@ module Holistics
|
|
61
61
|
job_manager.tail_logs job_id
|
62
62
|
end
|
63
63
|
|
64
|
+
def invoke_email_schedule(es_id, options)
|
65
|
+
puts "Invoking email schedule ID #{es_id}"
|
66
|
+
|
67
|
+
params = options.merge(_utoken: auth_info.get_token_from_gconfig)
|
68
|
+
result = http_request.post_json "email_schedules/#{es_id}/execute.json", params, 'Error submitting email schedule job'
|
69
|
+
|
70
|
+
job_id = result['job_id']
|
71
|
+
|
72
|
+
puts "Job submitted. Job ID: #{job_id}."
|
73
|
+
job_manager.tail_logs job_id
|
74
|
+
end
|
75
|
+
|
64
76
|
def send_transform(options)
|
65
77
|
puts 'Invoking transform job...'
|
66
78
|
|
data/lib/holistics/version.rb
CHANGED
data/lib/holistics.rb
CHANGED
@@ -8,6 +8,7 @@ require 'holistics/auth_api_client'
|
|
8
8
|
require 'import'
|
9
9
|
require 'transport'
|
10
10
|
require 'data_sources'
|
11
|
+
require 'email_schedule'
|
11
12
|
|
12
13
|
module Holistics
|
13
14
|
def self.root
|
@@ -32,9 +33,10 @@ module Holistics
|
|
32
33
|
super(args, options, config)
|
33
34
|
end
|
34
35
|
|
35
|
-
register(Holistics::Import, 'import', 'import<command>', "Execute import commands")
|
36
|
+
register(Holistics::Import, 'import', 'import <command>', "Execute import commands")
|
36
37
|
register(Holistics::Transport, 'transport', 'transport <command>', "Execute transport module's commands")
|
37
38
|
register(Holistics::DataSources, 'data_sources', 'data_sources <command>', "Execute data_sources module's commands")
|
39
|
+
register(Holistics::EmailSchedule, 'email_schedule', 'email_schedule <command>', "Execute email schedule's commands")
|
38
40
|
|
39
41
|
no_commands do
|
40
42
|
def auth_api_client
|
@@ -76,7 +78,7 @@ module Holistics
|
|
76
78
|
|
77
79
|
|
78
80
|
method_option :transform_id, aliases: '-j', type: :string, required: true, desc: 'ID of transform job to be executed'
|
79
|
-
desc 'transform', 'Invoke a transform
|
81
|
+
desc 'transform', 'Invoke a transform'
|
80
82
|
|
81
83
|
def transform
|
82
84
|
api_client.send_transform(options.dup)
|
data/lib/import.rb
CHANGED
@@ -3,18 +3,19 @@ require 'thor'
|
|
3
3
|
module Holistics
|
4
4
|
class Import < Thor
|
5
5
|
|
6
|
-
no_commands do
|
7
|
-
def api_client
|
8
|
-
@api_client ||= ApiClient.new
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
6
|
method_option :filepath, aliases: '-f', type: :string, required: true, desc: 'Path to CSV file'
|
13
7
|
method_option :dest_ds_id, aliases: '-d', type: :string, required: true, desc: 'Destination data source'
|
14
8
|
method_option :dest_table_name, aliases: '-t', type: :string, required: true, desc: 'Specify destination table to write to'
|
15
9
|
desc 'csv', 'Import a local CSV file to destination server'
|
10
|
+
|
16
11
|
def csv
|
17
12
|
api_client.import_csv(options.dup)
|
18
13
|
end
|
14
|
+
|
15
|
+
no_commands do
|
16
|
+
def api_client
|
17
|
+
@api_client ||= ApiClient.new
|
18
|
+
end
|
19
|
+
end
|
19
20
|
end
|
20
21
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: holistics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thanh Dinh Khac
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- bin/holistics
|
95
95
|
- holistics.gemspec
|
96
96
|
- lib/data_sources.rb
|
97
|
+
- lib/email_schedule.rb
|
97
98
|
- lib/holistics.rb
|
98
99
|
- lib/holistics/api_client.rb
|
99
100
|
- lib/holistics/auth_api_client.rb
|