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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: afdf927a39805f53e0354e16a97e9b989843bd9e
4
- data.tar.gz: 495531d87ad5a6a0ab8317dbe4075813cafbb0ea
3
+ metadata.gz: 929efc7e8a45d79587907327cc2d932df8b5e0bf
4
+ data.tar.gz: 76cd53dd656d93b94ce9856f1f5909cb11079c5d
5
5
  SHA512:
6
- metadata.gz: b178309c471e6cdacca230e3eabe376676c4eeccd7b5afb0ed4cb58fc13bdd5218d89e777e8677fa2927866056220538289094d5ac4904e4728f63273c2b4cc1
7
- data.tar.gz: 0beebc7eb0f3c609fa8f3d5dcaade01cf39be6bcf8b486d69cd28e6ea13e8d7acdee708e9f5f8e81a55b0f6da7a1a165f5edda5014c45658a21b5676c9eb8ef5
6
+ metadata.gz: f4315095505432582fb1ab87880ddc659444ee2586f1fa274b12b3a3e8f318bbfd38c33090dacc8bc117d0df7d414b570cdf6668ddd9dd34b0a969c4c6385d01
7
+ data.tar.gz: 867462fbdee8a834e300a33d8845d120d843f8b18b48c0b84a62e8b7a6386371b84e638dfe931d10f3a9f5fb770c07a032bfa204500da13721e70868c28ef856
data/CHANGELOG.md CHANGED
@@ -17,4 +17,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
17
17
  ## v0.2.1
18
18
  * Fix dependency error
19
19
 
20
+ ## v0.2.4
21
+ * Support invoking email schedule with `holistics email_schedule send <id>`
22
+
20
23
 
@@ -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
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module Holistics
2
- VERSION = '0.2.3'
2
+ VERSION = '0.2.4'
3
3
  end
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 job'
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.3
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