holistics 0.0.10 → 0.0.11

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: 6754ae8febe4d72c2e2f0384dae3af78461812e6
4
- data.tar.gz: dfdb65c2adba480f9124b38c6c9d309706295bbd
3
+ metadata.gz: 355be8beb301cf93d2012d2ccdbd58540c5355c0
4
+ data.tar.gz: b57530d173f8b22cb95083e777e6ddcc88eac391
5
5
  SHA512:
6
- metadata.gz: 0ee75e12713261a97f19f9a8be930536a9a5b7fa286c2e6649f2ba822960805a730380d9b4d3e20f3baaebb08d351de9eef048929a733babe683a6088a23e6e8
7
- data.tar.gz: cfd1fb7874ebbab54099be452b298566f69ebabfe7d536546575d7d6fa5afcdca90466fbafec625fc0ae9aec072a3292ed26c55260f682c36a6d74506127a564
6
+ metadata.gz: 3af5780921c7914376eac4c8153e1c18175d65334e25d0190a333ca68e258d981b42a3e062df7974e5b1f593e4b97528a80f9be58d5d0f338ab58f9958295a55
7
+ data.tar.gz: ed67c37140dd9eb780d43e390cfd4d1de4c1b17a79efeb9f0906421ed678460fb0c86fc391e528145aaf7472c15f1e45350049cb439fd8bc753a98f1466b2b51
@@ -0,0 +1,6 @@
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
3
+ This project adheres to [Semantic Versioning](http://semver.org/).
4
+
5
+ ## v0.0.11
6
+ * Support invocation of transform from CLI: `holistics transform -j <id>`
@@ -54,6 +54,13 @@ module Holistics
54
54
  ApiClient.new.send_transport(options.dup)
55
55
  end
56
56
 
57
+ method_option :transform_id, aliases: '-j', type: :string, required: true, desc: 'ID of transform job to be executed'
58
+ desc 'transform', 'Invoke a transform job'
59
+
60
+ def transform
61
+ ApiClient.new.send_transform(options.dup)
62
+ end
63
+
57
64
 
58
65
  method_option :job_id, aliases: '-j', type: :string, required: true, desc: 'Job ID'
59
66
  desc 'job_show', 'Show job log'
@@ -56,7 +56,21 @@ module Holistics
56
56
  params = build_submit_params(options)
57
57
  response = submit_transport_job(params)
58
58
 
59
- err_and_exit("Error submitting transport job", response) if response_has_error?(response)
59
+ err_and_exit('Error submitting transport job', response) if response_has_error?(response)
60
+
61
+ parsed = JSON.parse(response.body)
62
+ job_id = parsed['job_id']
63
+
64
+ puts "Job submitted. Job ID: #{job_id}."
65
+ tail_logs(job_id)
66
+ end
67
+
68
+ def send_transform(options)
69
+ puts 'Invoking transform job...'
70
+ params = options.merge(_utoken: get_token_from_gconfig)
71
+ response = submit_transform_job(params)
72
+
73
+ err_and_exit('Error submitting transform job', response) if response_has_error?(response)
60
74
 
61
75
  parsed = JSON.parse(response.body)
62
76
  job_id = parsed['job_id']
@@ -92,6 +106,14 @@ module Holistics
92
106
  HTTParty.post(server_url + 'transports/submit.json', options)
93
107
  end
94
108
 
109
+ def submit_transform_job(params)
110
+ options = {
111
+ headers: {'Content-Type' => 'application/json'},
112
+ body: params.to_json
113
+ }
114
+ HTTParty.post(server_url + "data_transforms/#{params[:transform_id]}/execute.json", options)
115
+ end
116
+
95
117
  def server_url
96
118
  host =
97
119
  if ENV['HOLISTICS_DEV'] || ENV['HOLISTICS_TEST']
@@ -1,3 +1,3 @@
1
1
  module Holistics
2
- VERSION = '0.0.10'
2
+ VERSION = '0.0.11'
3
3
  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.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thanh Dinh Khac
@@ -75,6 +75,7 @@ extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
77
  - ".document"
78
+ - CHANGELOG.md
78
79
  - README.md
79
80
  - bin/holistics
80
81
  - holistics.gemspec