gd_bam 0.1.39 → 0.1.40
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bam/version.rb +1 -1
- data/lib/cloud_connect/dsl/helpers.rb +2 -2
- data/lib/cloud_connect/dsl/structure_helpers.rb +5 -5
- data/lib/commands/commands.rb +0 -2
- data/lib/commands/deployment.rb +4 -4
- data/lib/commands/gd_commands.rb +1 -1
- data/lib/generators/downloaders.rb +57 -57
- data/lib/generators/etl.rb +22 -22
- data/lib/generators/validators.rb +17 -17
- metadata +2 -2
data/lib/bam/version.rb
CHANGED
@@ -63,12 +63,12 @@ module GoodData
|
|
63
63
|
}) do
|
64
64
|
builder.Global do
|
65
65
|
builder.Metadata({:id => "list_metadata"}) do |builder|
|
66
|
-
Helpers::csv_metadata(builder, {
|
66
|
+
CloudConnect::Helpers::csv_metadata(builder, {
|
67
67
|
:name => "list_metadata",
|
68
68
|
:fields => [{:name=>"filePath", :type=>"string"}]
|
69
69
|
})
|
70
70
|
end
|
71
|
-
Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
71
|
+
CloudConnect::Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
72
72
|
end
|
73
73
|
builder.Phase(:number => 0) do
|
74
74
|
|
@@ -26,12 +26,12 @@ module GoodData
|
|
26
26
|
:name => "Contract Checker: File list reader"
|
27
27
|
}) do
|
28
28
|
builder.Global do
|
29
|
-
Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
30
|
-
Helpers::property_file(builder, {:id => "skiplines_params", :fileURL => "#{token}_counter.prm"})
|
29
|
+
CloudConnect::Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
30
|
+
CloudConnect::Helpers::property_file(builder, {:id => "skiplines_params", :fileURL => "#{token}_counter.prm"})
|
31
31
|
|
32
|
-
Helpers::create_trash_meta(builder)
|
33
|
-
Helpers::create_run_graph_failure_metadata(builder)
|
34
|
-
Helpers::create_file_list_meta(builder)
|
32
|
+
CloudConnect::Helpers::create_trash_meta(builder)
|
33
|
+
CloudConnect::Helpers::create_run_graph_failure_metadata(builder)
|
34
|
+
CloudConnect::Helpers::create_file_list_meta(builder)
|
35
35
|
|
36
36
|
end
|
37
37
|
|
data/lib/commands/commands.rb
CHANGED
data/lib/commands/deployment.rb
CHANGED
@@ -36,7 +36,7 @@ module GoodData
|
|
36
36
|
dir = Pathname(dir)
|
37
37
|
result = GoodData.post(link, {
|
38
38
|
:execution => {
|
39
|
-
:graph => dir + "graphs/main.grf",
|
39
|
+
:graph => (dir + "graphs/main.grf").to_s,
|
40
40
|
:params => {}
|
41
41
|
}
|
42
42
|
})
|
@@ -138,8 +138,8 @@ module GoodData
|
|
138
138
|
res = deploy_graph(dir, options)
|
139
139
|
block.call(res)
|
140
140
|
ensure
|
141
|
-
self_link = res["process"]["links"]["self"]
|
142
|
-
GoodData.delete(self_link)
|
141
|
+
self_link = res && res["process"] && res["process"]["links"]["self"]
|
142
|
+
GoodData.delete(self_link) unless self_link.nil?
|
143
143
|
end
|
144
144
|
else
|
145
145
|
deploy_graph(dir, options)
|
@@ -166,7 +166,7 @@ module GoodData
|
|
166
166
|
end
|
167
167
|
end
|
168
168
|
|
169
|
-
GoodData.
|
169
|
+
GoodData.upload_to_user_webdav(temp.path, options)
|
170
170
|
process_id = options[:process]
|
171
171
|
|
172
172
|
data = {
|
data/lib/commands/gd_commands.rb
CHANGED
@@ -4,7 +4,7 @@ module GoodData
|
|
4
4
|
|
5
5
|
def self.connect_to_gd(options={})
|
6
6
|
server = options[:server]
|
7
|
-
GoodData.connect(PARAMS[:gd_login], PARAMS[:gd_pass],
|
7
|
+
GoodData.connect(PARAMS[:gd_login], PARAMS[:gd_pass], options)
|
8
8
|
GoodData.project = PARAMS[:project_pid] if !PARAMS[:project_pid].nil? && !PARAMS[:project_pid].empty?
|
9
9
|
end
|
10
10
|
|
@@ -15,12 +15,12 @@ module GoodData
|
|
15
15
|
:name => "Run graph"
|
16
16
|
}) do
|
17
17
|
builder.Global do
|
18
|
-
Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
19
|
-
Helpers::property_file(builder, {:id => "params_params", :fileURL => "params.prm"})
|
20
|
-
Helpers::create_trash_meta(builder)
|
21
|
-
Helpers::create_lookup_meta(builder)
|
22
|
-
Helpers::create_file_list_meta(builder)
|
23
|
-
Helpers::create_run_graph_failure_metadata(builder)
|
18
|
+
CloudConnect::Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
19
|
+
CloudConnect::Helpers::property_file(builder, {:id => "params_params", :fileURL => "params.prm"})
|
20
|
+
CloudConnect::Helpers::create_trash_meta(builder)
|
21
|
+
CloudConnect::Helpers::create_lookup_meta(builder)
|
22
|
+
CloudConnect::Helpers::create_file_list_meta(builder)
|
23
|
+
CloudConnect::Helpers::create_run_graph_failure_metadata(builder)
|
24
24
|
|
25
25
|
Core::build_node2(builder, Nodes.lookup2({:name => "gdLookup0", :id => "gdLookup0", :type => Nodes::GD_LOOKUP, :metadata => "lookup_metadata"}))
|
26
26
|
|
@@ -297,13 +297,13 @@ HEREDOC
|
|
297
297
|
builder.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"
|
298
298
|
builder.Graph({:name => "Goodsales incremental Downloader"}) do
|
299
299
|
builder.Global do
|
300
|
-
Helpers::property_file(builder, {:id => "params_params", :fileURL => "params.prm"})
|
301
|
-
Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
300
|
+
CloudConnect::Helpers::property_file(builder, {:id => "params_params", :fileURL => "params.prm"})
|
301
|
+
CloudConnect::Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
302
302
|
|
303
|
-
Helpers::create_lookup_meta(builder)
|
304
|
-
Helpers::create_deleted_records_meta(builder)
|
303
|
+
CloudConnect::Helpers::create_lookup_meta(builder)
|
304
|
+
CloudConnect::Helpers::create_deleted_records_meta(builder)
|
305
305
|
builder.Metadata({:id => "reformat_deleted_records"}) do |builder|
|
306
|
-
Helpers::csv_metadata(builder, {
|
306
|
+
CloudConnect::Helpers::csv_metadata(builder, {
|
307
307
|
:name => "reformat_deleted_records",
|
308
308
|
:fields => [
|
309
309
|
{:type => "string", :name => "Id"},
|
@@ -318,30 +318,30 @@ HEREDOC
|
|
318
318
|
file = tap[:id] || module_name
|
319
319
|
|
320
320
|
builder.Metadata({:id => "#{file}_s3_metadata"}) do |builder|
|
321
|
-
Helpers::csv_metadata(builder, GoodData::Bam::Metadata.add_field(Metadata.get_target_metadata(Tap.prepare_for_s3_backup(tap)), {:name => "Timestamp"}))
|
321
|
+
CloudConnect::Helpers::csv_metadata(builder, GoodData::Bam::Metadata.add_field(Metadata.get_target_metadata(Tap.prepare_for_s3_backup(tap)), {:name => "Timestamp"}))
|
322
322
|
end
|
323
323
|
|
324
324
|
tap = Tap.prepare_for_sf_downloader(tap)
|
325
325
|
builder.Metadata({:id => "#{file}_source_metadata"}) do |builder|
|
326
|
-
Helpers::csv_metadata(builder, Metadata.get_source_metadata(tap))
|
326
|
+
CloudConnect::Helpers::csv_metadata(builder, Metadata.get_source_metadata(tap))
|
327
327
|
end
|
328
328
|
|
329
329
|
builder.Metadata({:id => "#{file}_es_metadata"}) do |builder|
|
330
|
-
Helpers::csv_metadata(builder, Metadata.add_timestamp_as_date(Metadata.get_target_metadata(tap)))
|
330
|
+
CloudConnect::Helpers::csv_metadata(builder, Metadata.add_timestamp_as_date(Metadata.get_target_metadata(tap)))
|
331
331
|
end
|
332
332
|
|
333
333
|
Core::build_node2(builder, Nodes.lookup2({:name => "gdLookup0", :id => "gdLookup0", :type => Nodes::GD_LOOKUP, :metadata => "lookup_metadata"}))
|
334
334
|
|
335
335
|
end
|
336
336
|
|
337
|
-
Helpers::sf_connection(builder, {})
|
338
|
-
Helpers::property(builder, {:id => "SFDC_CLIENT_ID", :value => "gooddata/gooddata/"})
|
339
|
-
Helpers::property(builder, {:id => "SFDC_LOGIN_HOSTNAME", :value => options[:sf_server] || "login.salesforce.com"})
|
340
|
-
Helpers::property(builder, {:id => "SFDC_NAME", :value => "Salesforce connection"})
|
341
|
-
Helpers::property(builder, {:id => "SFDC_PASSWORD", :value => options[:sf_password]})
|
342
|
-
Helpers::property(builder, {:id => "SFDC_TOKEN", :value => options[:sf_token]})
|
343
|
-
Helpers::property(builder, {:id => "SFDC_USERNAME", :value => options[:sf_login]})
|
344
|
-
Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
337
|
+
CloudConnect::Helpers::sf_connection(builder, {})
|
338
|
+
CloudConnect::Helpers::property(builder, {:id => "SFDC_CLIENT_ID", :value => "gooddata/gooddata/"})
|
339
|
+
CloudConnect::Helpers::property(builder, {:id => "SFDC_LOGIN_HOSTNAME", :value => options[:sf_server] || "login.salesforce.com"})
|
340
|
+
CloudConnect::Helpers::property(builder, {:id => "SFDC_NAME", :value => "Salesforce connection"})
|
341
|
+
CloudConnect::Helpers::property(builder, {:id => "SFDC_PASSWORD", :value => options[:sf_password]})
|
342
|
+
CloudConnect::Helpers::property(builder, {:id => "SFDC_TOKEN", :value => options[:sf_token]})
|
343
|
+
CloudConnect::Helpers::property(builder, {:id => "SFDC_USERNAME", :value => options[:sf_login]})
|
344
|
+
CloudConnect::Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
345
345
|
end
|
346
346
|
|
347
347
|
phase = 1
|
@@ -373,7 +373,7 @@ HEREDOC
|
|
373
373
|
ctl = "function integer generate() {$out.0.Id = \"GD_FAKE_DELETED_RECORD\";$out.0.Timestamp = $out.0.Timestamp = str2date(\"2038-01-01T00:00:00.000+0000\", \"yyyy-MM-dd'T'HH:mm:ss.SSSZZ\");$out.0.IsDeleted = \"true\";$out.0.DeletedAt = \"2038-01-01T00:00:00.000+0000\";return OK;}"
|
374
374
|
Core::build_node2(builder, Nodes.data_generator2({:name => "#{file}_fake_deleted_records_generator", :id => "#{file}_fake_deleted_records_generator", :generate => ctl}))
|
375
375
|
Core::build_node2(builder, Nodes.edge2({:toNode => "#{file}_fake_deleted_records_es:0", :fromNode => "#{file}_fake_deleted_records_generator:0", :metadata => "reformat_deleted_records"}))
|
376
|
-
Core::build_node2(builder, Nodes.es_writer2({:name => "#{file} es Writer", :id => "#{file}_fake_deleted_records_es", :store => store, :entityFieldsMapping => Helpers::create_es_write_json(deleted_records_tap).to_json}))
|
376
|
+
Core::build_node2(builder, Nodes.es_writer2({:name => "#{file} es Writer", :id => "#{file}_fake_deleted_records_es", :store => store, :entityFieldsMapping => CloudConnect::Helpers::create_es_write_json(deleted_records_tap).to_json}))
|
377
377
|
end
|
378
378
|
end
|
379
379
|
|
@@ -397,7 +397,7 @@ HEREDOC
|
|
397
397
|
Core::build_node2(builder, Nodes.edge2({:toNode => "#{file}_deleted_records_reformat:0", :fromNode => "#{file}_deleted_records_downlader:0", :metadata => "deleted_records_metadata"}))
|
398
398
|
Core::build_node2(builder, Nodes.sort2({:sortKey => "Timestamp(a)",:name => "#{file} es Sort", :id => "#{file}_deleted_records_es_sort"}))
|
399
399
|
Core::build_node2(builder, Nodes.edge2({:toNode => "#{file}_deleted_records_es_sort:0", :fromNode => "#{file}_deleted_records_reformat:0", :metadata => "reformat_deleted_records"}))
|
400
|
-
Core::build_node2(builder, Nodes.es_writer2({:name => "#{file} es Writer", :id => "#{file}_deleted_records_es", :store => store, :entityFieldsMapping => Helpers::create_es_write_json(deleted_records_tap).to_json}))
|
400
|
+
Core::build_node2(builder, Nodes.es_writer2({:name => "#{file} es Writer", :id => "#{file}_deleted_records_es", :store => store, :entityFieldsMapping => CloudConnect::Helpers::create_es_write_json(deleted_records_tap).to_json}))
|
401
401
|
Core::build_node2(builder, Nodes.edge2({:toNode => "#{file}_deleted_records_es:0", :fromNode => "#{file}_deleted_records_es_sort:0", :metadata => "reformat_deleted_records"}))
|
402
402
|
end
|
403
403
|
end
|
@@ -412,7 +412,7 @@ HEREDOC
|
|
412
412
|
|
413
413
|
mandatory_fields = fields.reject {|f| f[:is_mandatory] == false }.map {|f| f[:name] + ";"}.join
|
414
414
|
|
415
|
-
Core::build_node2(builder, Nodes.sfdc_reader2({:name => "#{file} SF Reader", :id => "#{file}_reader", :soql => Helpers::generate_incremental_select(tap), :sfdcConnection => "SFDC", :fieldsMapping => stuff, :mandatoryFields => mandatory_fields}))
|
415
|
+
Core::build_node2(builder, Nodes.sfdc_reader2({:name => "#{file} SF Reader", :id => "#{file}_reader", :soql => CloudConnect::Helpers::generate_incremental_select(tap), :sfdcConnection => "SFDC", :fieldsMapping => stuff, :mandatoryFields => mandatory_fields}))
|
416
416
|
|
417
417
|
|
418
418
|
es_transformation_source = if has_timestamp
|
@@ -451,7 +451,7 @@ HEREDOC
|
|
451
451
|
Core::build_node2(builder, Nodes.sort2({:sortKey => "Timestamp(a)",:name => "#{file} es Sort", :id => "#{file}_es_sort"}))
|
452
452
|
Core::build_node2(builder, Nodes.edge2({:toNode => "#{file}_es_sort:0", :fromNode => "#{file}_es_reformat:0", :metadata => "#{file}_es_metadata"}))
|
453
453
|
|
454
|
-
Core::build_node2(builder, Nodes.es_writer2({:name => "#{file} es Writer", :id => "#{file}_es", :store => store, :entityFieldsMapping => Helpers::create_es_write_json(Tap.add_timestamp_field(tap)).to_json}))
|
454
|
+
Core::build_node2(builder, Nodes.es_writer2({:name => "#{file} es Writer", :id => "#{file}_es", :store => store, :entityFieldsMapping => CloudConnect::Helpers::create_es_write_json(Tap.add_timestamp_field(tap)).to_json}))
|
455
455
|
Core::build_node2(builder, Nodes.edge2({:toNode => "#{file}_es:0", :fromNode => "#{file}_es_sort:0", :metadata => "#{file}_es_metadata"}))
|
456
456
|
|
457
457
|
end
|
@@ -491,12 +491,12 @@ HEREDOC
|
|
491
491
|
builder.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"
|
492
492
|
builder.Graph({:name => "Goodsales incremental Downloader"}) do
|
493
493
|
builder.Global do
|
494
|
-
Helpers::property_file(builder, {:id => "params_params", :fileURL => "params.prm"})
|
495
|
-
Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
494
|
+
CloudConnect::Helpers::property_file(builder, {:id => "params_params", :fileURL => "params.prm"})
|
495
|
+
CloudConnect::Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
496
496
|
|
497
|
-
Helpers::create_deleted_records_meta(builder)
|
497
|
+
CloudConnect::Helpers::create_deleted_records_meta(builder)
|
498
498
|
builder.Metadata({:id => "reformat_deleted_records"}) do |builder|
|
499
|
-
Helpers::csv_metadata(builder, {
|
499
|
+
CloudConnect::Helpers::csv_metadata(builder, {
|
500
500
|
:name => "reformat_deleted_records",
|
501
501
|
:fields => [
|
502
502
|
{:type => "string", :name => "Id"},
|
@@ -506,25 +506,25 @@ HEREDOC
|
|
506
506
|
})
|
507
507
|
end
|
508
508
|
|
509
|
-
Helpers::create_lookup_meta(builder)
|
509
|
+
CloudConnect::Helpers::create_lookup_meta(builder)
|
510
510
|
builder.Metadata({:id => "data_metadata"}) do |builder|
|
511
|
-
Helpers::csv_metadata(builder, {:name => "data_metadata",:fields => [{:name => "Id"}, {:name => "Timestamp"}, {:name => "Value"}]})
|
511
|
+
CloudConnect::Helpers::csv_metadata(builder, {:name => "data_metadata",:fields => [{:name => "Id"}, {:name => "Timestamp"}, {:name => "Value"}]})
|
512
512
|
end
|
513
513
|
|
514
514
|
builder.Metadata({:id => "es_metadata"}) do |builder|
|
515
|
-
Helpers::csv_metadata(builder, {:name => "data_metadata",:fields => [{:name => "Id"}, {:name => "Timestamp", :type => "date"}, {:name => "Value"}]})
|
515
|
+
CloudConnect::Helpers::csv_metadata(builder, {:name => "data_metadata",:fields => [{:name => "Id"}, {:name => "Timestamp", :type => "date"}, {:name => "Value"}]})
|
516
516
|
end
|
517
517
|
|
518
518
|
Core::build_node2(builder, Nodes.lookup2({:name => "gdLookup0", :id => "gdLookup0", :type => Nodes::GD_LOOKUP, :metadata => "lookup_metadata"}))
|
519
519
|
|
520
|
-
Helpers::sf_connection(builder, {})
|
521
|
-
Helpers::property(builder, {:id => "SFDC_CLIENT_ID", :value => "gooddata/gooddata/"})
|
522
|
-
Helpers::property(builder, {:id => "SFDC_LOGIN_HOSTNAME", :value => options[:sf_server] || "login.salesforce.com"})
|
523
|
-
Helpers::property(builder, {:id => "SFDC_NAME", :value => "Salesforce connection"})
|
524
|
-
Helpers::property(builder, {:id => "SFDC_PASSWORD", :value => options[:sf_password]})
|
525
|
-
Helpers::property(builder, {:id => "SFDC_TOKEN", :value => options[:sf_token]})
|
526
|
-
Helpers::property(builder, {:id => "SFDC_USERNAME", :value => options[:sf_login]})
|
527
|
-
Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
520
|
+
CloudConnect::Helpers::sf_connection(builder, {})
|
521
|
+
CloudConnect::Helpers::property(builder, {:id => "SFDC_CLIENT_ID", :value => "gooddata/gooddata/"})
|
522
|
+
CloudConnect::Helpers::property(builder, {:id => "SFDC_LOGIN_HOSTNAME", :value => options[:sf_server] || "login.salesforce.com"})
|
523
|
+
CloudConnect::Helpers::property(builder, {:id => "SFDC_NAME", :value => "Salesforce connection"})
|
524
|
+
CloudConnect::Helpers::property(builder, {:id => "SFDC_PASSWORD", :value => options[:sf_password]})
|
525
|
+
CloudConnect::Helpers::property(builder, {:id => "SFDC_TOKEN", :value => options[:sf_token]})
|
526
|
+
CloudConnect::Helpers::property(builder, {:id => "SFDC_USERNAME", :value => options[:sf_login]})
|
527
|
+
CloudConnect::Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
528
528
|
end
|
529
529
|
|
530
530
|
taps_memo = {}
|
@@ -546,7 +546,7 @@ HEREDOC
|
|
546
546
|
id_field = Tap.find_output_field(tap, "Id")
|
547
547
|
timestamp_field = Tap.find_output_field(tap, "Timestamp")
|
548
548
|
|
549
|
-
objects_to_get = Helpers.objects_for_history(client, tap)
|
549
|
+
objects_to_get = CloudConnect::Helpers.objects_for_history(client, tap)
|
550
550
|
|
551
551
|
(tap[:fields] - [id_field, timestamp_field]).each_with_index do |field, i|
|
552
552
|
f = field[:name]
|
@@ -691,7 +691,7 @@ HEREDOC
|
|
691
691
|
file = field[:tap][:id]
|
692
692
|
sf_object = field[:tap][:object]
|
693
693
|
f = field[:field]
|
694
|
-
Core::build_node2(builder, Nodes.es_writer2({:name => "#{file} es Writer", :id => "#{f}_#{sf_object}_es", :store => store, :entityFieldsMapping => Helpers::create_es_write_json({:type => :tap, :id => tap[:id], :fields => [{:name => "Id"}, {:name => "Timestamp"}, {:name => f, :meta => "Value"}]}).to_json}))
|
694
|
+
Core::build_node2(builder, Nodes.es_writer2({:name => "#{file} es Writer", :id => "#{f}_#{sf_object}_es", :store => store, :entityFieldsMapping => CloudConnect::Helpers::create_es_write_json({:type => :tap, :id => tap[:id], :fields => [{:name => "Id"}, {:name => "Timestamp"}, {:name => f, :meta => "Value"}]}).to_json}))
|
695
695
|
Core::build_node2(builder, Nodes.edge2({:toNode => "#{f}_#{sf_object}_es:0", :fromNode => "#{f}_#{sf_object}_reformat:0", :metadata => "es_metadata"}))
|
696
696
|
end
|
697
697
|
end
|
@@ -727,7 +727,7 @@ HEREDOC
|
|
727
727
|
Core::build_node2(builder, Nodes.edge2({:toNode => "#{file}_deleted_records_reformat:0", :fromNode => "#{file}_deleted_records_downlader:0", :metadata => "deleted_records_metadata"}))
|
728
728
|
Core::build_node2(builder, Nodes.sort2({:sortKey => "Timestamp(a)",:name => "#{file} es Sort", :id => "#{file}_deleted_records_es_sort"}))
|
729
729
|
Core::build_node2(builder, Nodes.edge2({:toNode => "#{file}_deleted_records_es_sort:0", :fromNode => "#{file}_deleted_records_reformat:0", :metadata => "reformat_deleted_records"}))
|
730
|
-
Core::build_node2(builder, Nodes.es_writer2({:name => "#{file} es Writer", :id => "#{file}_deleted_records_es", :store => store, :entityFieldsMapping => Helpers::create_es_write_json(deleted_records_tap).to_json}))
|
730
|
+
Core::build_node2(builder, Nodes.es_writer2({:name => "#{file} es Writer", :id => "#{file}_deleted_records_es", :store => store, :entityFieldsMapping => CloudConnect::Helpers::create_es_write_json(deleted_records_tap).to_json}))
|
731
731
|
Core::build_node2(builder, Nodes.edge2({:toNode => "#{file}_deleted_records_es:0", :fromNode => "#{file}_deleted_records_es_sort:0", :metadata => "reformat_deleted_records"}))
|
732
732
|
end
|
733
733
|
end
|
@@ -785,12 +785,12 @@ HEREDOC
|
|
785
785
|
:name => "Run graph"
|
786
786
|
}) do
|
787
787
|
builder.Global do
|
788
|
-
Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
789
|
-
Helpers::property_file(builder, {:id => "params_params", :fileURL => "params.prm"})
|
790
|
-
Helpers::create_trash_meta(builder)
|
791
|
-
Helpers::create_lookup_meta(builder)
|
792
|
-
Helpers::create_file_list_meta(builder)
|
793
|
-
Helpers::create_run_graph_failure_metadata(builder)
|
788
|
+
CloudConnect::Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
789
|
+
CloudConnect::Helpers::property_file(builder, {:id => "params_params", :fileURL => "params.prm"})
|
790
|
+
CloudConnect::Helpers::create_trash_meta(builder)
|
791
|
+
CloudConnect::Helpers::create_lookup_meta(builder)
|
792
|
+
CloudConnect::Helpers::create_file_list_meta(builder)
|
793
|
+
CloudConnect::Helpers::create_run_graph_failure_metadata(builder)
|
794
794
|
|
795
795
|
Core::build_node2(builder, Nodes.lookup2({:name => "gdLookup0", :id => "gdLookup0", :type => Nodes::GD_LOOKUP, :metadata => "lookup_metadata"}))
|
796
796
|
|
@@ -865,26 +865,26 @@ HEREDOC
|
|
865
865
|
builder.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"
|
866
866
|
builder.Graph({:name => "Goodsales incremental Downloader"}) do
|
867
867
|
builder.Global do
|
868
|
-
Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
869
|
-
Helpers::create_lookup_meta(builder)
|
868
|
+
CloudConnect::Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
869
|
+
CloudConnect::Helpers::create_lookup_meta(builder)
|
870
870
|
taps.each do |tap|
|
871
871
|
|
872
872
|
module_name = tap[:object]
|
873
873
|
file = tap[:id] || module_name
|
874
874
|
|
875
|
-
Helpers::property_file(builder, {:id => "params_params", :fileURL => "#{file}_item.prm"})
|
875
|
+
CloudConnect::Helpers::property_file(builder, {:id => "params_params", :fileURL => "#{file}_item.prm"})
|
876
876
|
|
877
877
|
builder.Metadata({:id => "#{file}_s3_metadata"}) do |builder|
|
878
|
-
Helpers::csv_metadata(builder, GoodData::Bam::Metadata.add_field(Metadata.get_target_metadata(Tap.prepare_for_s3_backup(tap)), {:name => "Timestamp"}))
|
878
|
+
CloudConnect::Helpers::csv_metadata(builder, GoodData::Bam::Metadata.add_field(Metadata.get_target_metadata(Tap.prepare_for_s3_backup(tap)), {:name => "Timestamp"}))
|
879
879
|
end
|
880
880
|
|
881
881
|
tap = Tap.prepare_for_sf_downloader(tap)
|
882
882
|
builder.Metadata({:id => "#{file}_source_metadata"}) do |builder|
|
883
|
-
Helpers::csv_metadata(builder, Metadata.get_source_metadata(tap))
|
883
|
+
CloudConnect::Helpers::csv_metadata(builder, Metadata.get_source_metadata(tap))
|
884
884
|
end
|
885
885
|
|
886
886
|
builder.Metadata({:id => "#{file}_es_metadata"}) do |builder|
|
887
|
-
Helpers::csv_metadata(builder, GoodData::Bam::Metadata.add_timestamp_as_date(Metadata.get_target_metadata(tap)))
|
887
|
+
CloudConnect::Helpers::csv_metadata(builder, GoodData::Bam::Metadata.add_timestamp_as_date(Metadata.get_target_metadata(tap)))
|
888
888
|
end
|
889
889
|
Core::build_node2(builder, Nodes.lookup2({:name => "gdLookup0", :id => "gdLookup0", :type => Nodes::GD_LOOKUP, :metadata => "lookup_metadata"}))
|
890
890
|
end
|
@@ -944,7 +944,7 @@ HEREDOC
|
|
944
944
|
|
945
945
|
Core::build_node2(builder, Nodes.sort2({:sortKey => "Timestamp(a)",:name => "#{file} es Sort", :id => "#{file}_es_sort"}))
|
946
946
|
Core::build_node2(builder, Nodes.edge2({:toNode => "#{file}_es_sort:0", :fromNode => "#{file}_es_reformat:0", :metadata => "#{file}_es_metadata"}))
|
947
|
-
Core::build_node2(builder, Nodes.es_writer2({:name => "#{file} es Writer", :id => "#{file}_es", :store => store, :entityFieldsMapping => Helpers::create_es_write_json(Tap.add_timestamp_field(tap)).to_json}))
|
947
|
+
Core::build_node2(builder, Nodes.es_writer2({:name => "#{file} es Writer", :id => "#{file}_es", :store => store, :entityFieldsMapping => CloudConnect::Helpers::create_es_write_json(Tap.add_timestamp_field(tap)).to_json}))
|
948
948
|
Core::build_node2(builder, Nodes.edge2({:toNode => "#{file}_es:0", :fromNode => "#{file}_es_sort:0", :metadata => "#{file}_es_metadata"}))
|
949
949
|
end
|
950
950
|
|
data/lib/generators/etl.rb
CHANGED
@@ -80,9 +80,9 @@ module GoodData
|
|
80
80
|
:name => "GoodData Data loader"
|
81
81
|
}) do
|
82
82
|
builder.Global do
|
83
|
-
Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
83
|
+
CloudConnect::Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
84
84
|
builder.Metadata({:id => "load_metadata"}) do |builder|
|
85
|
-
Helpers::csv_metadata(builder, state[:metadata][input_name])
|
85
|
+
CloudConnect::Helpers::csv_metadata(builder, state[:metadata][input_name])
|
86
86
|
end
|
87
87
|
end
|
88
88
|
builder.Phase(:number => 0) do
|
@@ -104,12 +104,12 @@ module GoodData
|
|
104
104
|
:name => "GoodData Data loader"
|
105
105
|
}) do
|
106
106
|
builder.Global do
|
107
|
-
Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
107
|
+
CloudConnect::Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
108
108
|
builder.Metadata({:id => "load_metadata"}) do |builder|
|
109
|
-
Helpers::csv_metadata(builder, state[:metadata][input_name])
|
109
|
+
CloudConnect::Helpers::csv_metadata(builder, state[:metadata][input_name])
|
110
110
|
end
|
111
111
|
builder.Metadata({:id => "gd_sink_metadata"}) do |builder|
|
112
|
-
Helpers::csv_metadata(builder, Helpers::sink_out_gd_metadata(state[:metadata][input_name], sink))
|
112
|
+
CloudConnect::Helpers::csv_metadata(builder, CloudConnect::Helpers::sink_out_gd_metadata(state[:metadata][input_name], sink))
|
113
113
|
end
|
114
114
|
|
115
115
|
end
|
@@ -180,13 +180,13 @@ HEREDOC
|
|
180
180
|
:name => "File Downloader"
|
181
181
|
}) do
|
182
182
|
builder.Global do
|
183
|
-
Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
183
|
+
CloudConnect::Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
184
184
|
|
185
185
|
builder.Metadata({:id => "file_metadata"}) do |builder|
|
186
|
-
Helpers::csv_metadata(builder, Metadata.get_source_metadata(tap))
|
186
|
+
CloudConnect::Helpers::csv_metadata(builder, Metadata.get_source_metadata(tap))
|
187
187
|
end
|
188
188
|
builder.Metadata({:id => "clover_metadata"}) do |builder|
|
189
|
-
Helpers::csv_metadata(builder, Metadata.get_target_metadata(tap))
|
189
|
+
CloudConnect::Helpers::csv_metadata(builder, Metadata.get_target_metadata(tap))
|
190
190
|
end
|
191
191
|
end
|
192
192
|
|
@@ -222,21 +222,21 @@ HEREDOC
|
|
222
222
|
builder.Global do
|
223
223
|
|
224
224
|
builder.Metadata({:id => "clover_metadata"}) do |builder|
|
225
|
-
Helpers::csv_metadata(builder, Metadata.get_target_metadata(tap))
|
225
|
+
CloudConnect::Helpers::csv_metadata(builder, Metadata.get_target_metadata(tap))
|
226
226
|
end
|
227
227
|
|
228
228
|
builder.Metadata({:id => "sf_metadata"}) do |builder|
|
229
|
-
Helpers::csv_metadata(builder, Metadata.get_source_metadata(tap))
|
229
|
+
CloudConnect::Helpers::csv_metadata(builder, Metadata.get_source_metadata(tap))
|
230
230
|
end
|
231
231
|
|
232
|
-
Helpers::sf_connection(builder, {})
|
233
|
-
Helpers::property(builder, {:id => "SFDC_CLIENT_ID", :value => "gooddata/gooddata/"})
|
234
|
-
Helpers::property(builder, {:id => "SFDC_LOGIN_HOSTNAME", :value => options[:params][:sf_server] || "login.salesforce.com"})
|
235
|
-
Helpers::property(builder, {:id => "SFDC_NAME", :value => "Salesforce connection"})
|
236
|
-
Helpers::property(builder, {:id => "SFDC_PASSWORD", :value => options[:params][:sf_password]})
|
237
|
-
Helpers::property(builder, {:id => "SFDC_TOKEN", :value => options[:params][:sf_token]})
|
238
|
-
Helpers::property(builder, {:id => "SFDC_USERNAME", :value => options[:params][:sf_login]})
|
239
|
-
Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
232
|
+
CloudConnect::Helpers::sf_connection(builder, {})
|
233
|
+
CloudConnect::Helpers::property(builder, {:id => "SFDC_CLIENT_ID", :value => "gooddata/gooddata/"})
|
234
|
+
CloudConnect::Helpers::property(builder, {:id => "SFDC_LOGIN_HOSTNAME", :value => options[:params][:sf_server] || "login.salesforce.com"})
|
235
|
+
CloudConnect::Helpers::property(builder, {:id => "SFDC_NAME", :value => "Salesforce connection"})
|
236
|
+
CloudConnect::Helpers::property(builder, {:id => "SFDC_PASSWORD", :value => options[:params][:sf_password]})
|
237
|
+
CloudConnect::Helpers::property(builder, {:id => "SFDC_TOKEN", :value => options[:params][:sf_token]})
|
238
|
+
CloudConnect::Helpers::property(builder, {:id => "SFDC_USERNAME", :value => options[:params][:sf_login]})
|
239
|
+
CloudConnect::Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
240
240
|
end
|
241
241
|
|
242
242
|
builder.Phase(:number => 0) do
|
@@ -249,7 +249,7 @@ HEREDOC
|
|
249
249
|
stuff = mapping + add.join(",") + "]}}"
|
250
250
|
mandatory_fields = fields.reject {|f| f[:is_mandatory] == false }.map {|f| f[:name] + ";"}.join
|
251
251
|
|
252
|
-
Core::build_node2(builder, Nodes.sfdc_reader2({:name => "SF Writer", :id => "sf", :soql => Helpers::generate_select(tap), :sfdcConnection => "SFDC", :fieldsMapping => stuff, :mandatoryFields => mandatory_fields}))
|
252
|
+
Core::build_node2(builder, Nodes.sfdc_reader2({:name => "SF Writer", :id => "sf", :soql => CloudConnect::Helpers::generate_select(tap), :sfdcConnection => "SFDC", :fieldsMapping => stuff, :mandatoryFields => mandatory_fields}))
|
253
253
|
|
254
254
|
Core::build_node2(builder, Nodes.copy2({:name => "copy", :id => "copy"}))
|
255
255
|
Core::build_node2(builder, Nodes.edge2({:toNode => "copy:0", :fromNode => "sf:0", :metadata => "sf_metadata"}))
|
@@ -283,14 +283,14 @@ HEREDOC
|
|
283
283
|
:name => "GoodData EventStore Downloader"
|
284
284
|
}) do
|
285
285
|
builder.Global do
|
286
|
-
Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
286
|
+
CloudConnect::Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
287
287
|
|
288
288
|
builder.Metadata({:id => "es_metadata"}) do |builder|
|
289
|
-
Helpers::csv_metadata(builder, metadata_from_es)
|
289
|
+
CloudConnect::Helpers::csv_metadata(builder, metadata_from_es)
|
290
290
|
end
|
291
291
|
|
292
292
|
builder.Metadata({:id => "output_metadata"}) do |builder|
|
293
|
-
Helpers::csv_metadata(builder, output_metadata)
|
293
|
+
CloudConnect::Helpers::csv_metadata(builder, output_metadata)
|
294
294
|
end
|
295
295
|
end
|
296
296
|
|
@@ -35,11 +35,11 @@ module GoodData
|
|
35
35
|
:name => "Contract Checker: File list reader"
|
36
36
|
}) do
|
37
37
|
builder.Global do
|
38
|
-
Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
39
|
-
Helpers::property_file(builder, {:id => "now_params", :fileURL => "now.prm"})
|
38
|
+
CloudConnect::Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
39
|
+
CloudConnect::Helpers::property_file(builder, {:id => "now_params", :fileURL => "now.prm"})
|
40
40
|
|
41
|
-
Helpers::create_trash_meta(builder)
|
42
|
-
Helpers::create_file_list_meta(builder)
|
41
|
+
CloudConnect::Helpers::create_trash_meta(builder)
|
42
|
+
CloudConnect::Helpers::create_file_list_meta(builder)
|
43
43
|
|
44
44
|
end
|
45
45
|
|
@@ -80,12 +80,12 @@ module GoodData
|
|
80
80
|
:name => "Contract Checker: File list reader"
|
81
81
|
}) do
|
82
82
|
builder.Global do
|
83
|
-
Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
83
|
+
CloudConnect::Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
84
84
|
|
85
|
-
Helpers::create_trash_meta(builder)
|
85
|
+
CloudConnect::Helpers::create_trash_meta(builder)
|
86
86
|
|
87
87
|
builder.Metadata({:id => "file_list"}) do |builder|
|
88
|
-
Helpers::csv_metadata(builder, {
|
88
|
+
CloudConnect::Helpers::csv_metadata(builder, {
|
89
89
|
:name => "file_list",
|
90
90
|
:fields => [
|
91
91
|
{:name => "filePath", :type => "string"},
|
@@ -139,13 +139,13 @@ HEREDOC
|
|
139
139
|
:name => "Contract Checker: File list reader"
|
140
140
|
}) do
|
141
141
|
builder.Global do
|
142
|
-
Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
142
|
+
CloudConnect::Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
143
143
|
|
144
|
-
Helpers::create_trash_meta(builder)
|
145
|
-
Helpers::create_run_graph_failure_metadata(builder)
|
144
|
+
CloudConnect::Helpers::create_trash_meta(builder)
|
145
|
+
CloudConnect::Helpers::create_run_graph_failure_metadata(builder)
|
146
146
|
|
147
147
|
builder.Metadata({:id => "file_list"}) do |builder|
|
148
|
-
Helpers::csv_metadata(builder, {
|
148
|
+
CloudConnect::Helpers::csv_metadata(builder, {
|
149
149
|
:name => "file_list",
|
150
150
|
:fields => [
|
151
151
|
{:name => "filePath", :type => "string"},
|
@@ -311,14 +311,14 @@ HEREDOC
|
|
311
311
|
:name => "Contract Checker"
|
312
312
|
}) do
|
313
313
|
builder.Global do
|
314
|
-
Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
315
|
-
Helpers::property_file(builder, {:id => "file_params", :fileURL => "#{id}_item.prm"})
|
314
|
+
CloudConnect::Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
315
|
+
CloudConnect::Helpers::property_file(builder, {:id => "file_params", :fileURL => "#{id}_item.prm"})
|
316
316
|
|
317
|
-
Helpers::create_trash_meta(builder)
|
318
|
-
Helpers::create_read_error_meta(builder)
|
317
|
+
CloudConnect::Helpers::create_trash_meta(builder)
|
318
|
+
CloudConnect::Helpers::create_read_error_meta(builder)
|
319
319
|
|
320
320
|
builder.Metadata({:id => "#{name}_clover_metadata"}) do |builder|
|
321
|
-
Helpers::csv_metadata(builder, Metadata.get_source_metadata(tap))
|
321
|
+
CloudConnect::Helpers::csv_metadata(builder, Metadata.get_source_metadata(tap))
|
322
322
|
end
|
323
323
|
end
|
324
324
|
|
@@ -405,7 +405,7 @@ HEREDOC
|
|
405
405
|
# :name => "Contract Checker"
|
406
406
|
# }) do
|
407
407
|
# builder.Global do
|
408
|
-
# Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
408
|
+
# CloudConnect::Helpers::property_file(builder, {:id => "workspace_params", :fileURL => "workspace.prm"})
|
409
409
|
# end
|
410
410
|
#
|
411
411
|
# builder.Phase(:number => 0) do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gd_bam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.40
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-03-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|