td 0.14.0 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: be3247f0bc28da7b0e3f1e5caa10aaf2f0b0ff52
4
- data.tar.gz: bdf8a4ac5a21214084d2f66f791ae3f85b4777d9
3
+ metadata.gz: 0fd96802c069458c8a45adde2c63044dbc6157e5
4
+ data.tar.gz: 4ca331507c1ec04cac6ad1519cee73aa86f5e33a
5
5
  SHA512:
6
- metadata.gz: a5dfba44b1698e8f4f89bf0ee72c791e1b1ac54ab11398d5450b8e51d4fb214b0051cd91acf325604d6696b6dad503a69528fd71ba7aba7eec616b9c4d94688a
7
- data.tar.gz: deeecc28efaa52310e34a732e77788162e6c5429bb119c3e3f7fe9efc1d3130ffbc1d728ab24fd749b53c8465007c19186746c2f369456af58356a86a7100a02
6
+ metadata.gz: 9a8ffee2dc536d83831e9c7a6f8e092273d2434ab5b401dedfadd756e782a4c20b2655d44478d69cbbe15bf8167c696ac605aed84bddf0efd75676f6b60ff59a
7
+ data.tar.gz: efc8acd54a2df5304f6f55186fa44717d3427c4820c5bf964a8e88a05f2897980d5c2e121591de3feba47d1fb4766e7061bff9ec34f43eae10a09d8c9c7d7fac
data/ChangeLog CHANGED
@@ -1,3 +1,9 @@
1
+ == 2016-07-11 version 0.14.1
2
+
3
+ * Use td-client-ruby v0.8.82
4
+ * Add conflicts_with to AlreadyExistError (treasure-data/td-client-ruby#84)
5
+ * Rewrite job_result_download logic (treasure-data/td-client-ruby#85)
6
+
1
7
  == 2016-04-25 version 0.14.0
2
8
 
3
9
  * Use parallel v1.8.0 #161
@@ -15,6 +15,7 @@ module Command
15
15
  file_format = "json.gz" # default
16
16
  pool_name = nil
17
17
  encryption = nil
18
+ assume_role = nil
18
19
 
19
20
  op.on('-w', '--wait', 'wait until the job is completed', TrueClass) {|b|
20
21
  wait = b
@@ -37,7 +38,7 @@ module Command
37
38
  op.on('-s', '--aws-secret-key SECRET_KEY', 'AWS secret access key to export data (required)') {|s|
38
39
  aws_secret_access_key = s
39
40
  }
40
- op.on('-F', '--file-format FILE_FORMAT', 'file format for exported data, either json.gz (default) or line-json.gz') { |s|
41
+ op.on('-F', '--file-format FILE_FORMAT', 'file format for exported data, either json.gz (default) or line-json.gz, or tsv.gz') { |s|
41
42
  raise ArgumentError, "#{s} is not a supported file format" unless SUPPORTED_FORMATS.include?(s)
42
43
  file_format = s
43
44
  }
@@ -48,6 +49,9 @@ module Command
48
49
  raise ArgumentError, "#{s} is not a supported encryption method" unless SUPPORTED_ENCRYPT_METHOD.include?(s)
49
50
  encryption = s
50
51
  }
52
+ op.on('-a', '--assume-role ASSUME_ROLE_ARN', 'export with assume role with ASSUME_ROLE_ARN as role arn') {|s|
53
+ assume_role = s
54
+ }
51
55
 
52
56
  db_name, table_name = op.cmd_parse
53
57
 
@@ -82,6 +86,7 @@ module Command
82
86
  s3_opts['secret_access_key'] = aws_secret_access_key
83
87
  s3_opts['pool_name'] = pool_name if pool_name
84
88
  s3_opts['encryption'] = encryption if encryption
89
+ s3_opts['assume_role'] = assume_role if assume_role
85
90
 
86
91
  job = client.export(db_name, table_name, "s3", s3_opts)
87
92
 
@@ -1,3 +1,3 @@
1
1
  module TreasureData
2
- TOOLBELT_VERSION = '0.14.0'
2
+ TOOLBELT_VERSION = '0.14.1'
3
3
  end
@@ -42,6 +42,12 @@ module TreasureData::Command
42
42
  ops.push wrong_encryption
43
43
  List::CommandParser.new("table:export", ["db_name", "table_name"], [], nil, ops, true)
44
44
  }
45
+ let(:option_with_assume_role) {
46
+ ops = option_list
47
+ ops.push "-a"
48
+ ops.push assume_role
49
+ List::CommandParser.new("table:export", ["db_name", "table_name"], [], nil, ops, true)
50
+ }
45
51
  let(:option_list) { [database, table, "-b", bucket, "-p", path, "-k", key, "-s", pass, "-F", format] }
46
52
  let(:database) { 'database' }
47
53
  let(:table) { 'table' }
@@ -51,6 +57,7 @@ module TreasureData::Command
51
57
  let(:pass) { 'pass' }
52
58
  let(:format) { 'tsv.gz' }
53
59
  let(:encryption) { 's3' }
60
+ let(:assume_role) { 'arn:aws:iam::000:role/assume' }
54
61
  let(:wrong_encryption) { 's3s3' }
55
62
  let(:job_id) { 111 }
56
63
 
@@ -81,6 +88,18 @@ module TreasureData::Command
81
88
  command.table_export(option_with_wrong_encryption)
82
89
  }.to raise_exception
83
90
  end
91
+
92
+ it 'export table without assume role' do
93
+ expect {
94
+ command.table_export(option_with_assume_role)
95
+ }.to_not raise_exception
96
+ end
97
+
98
+ it 'export table with assume role' do
99
+ expect {
100
+ command.table_export(option_with_assume_role)
101
+ }.to_not raise_exception
102
+ end
84
103
  end
85
104
  end
86
105
  end
data/td.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |gem|
21
21
  gem.add_dependency "yajl-ruby", "~> 1.1"
22
22
  gem.add_dependency "hirb", ">= 0.4.5"
23
23
  gem.add_dependency "parallel", "~> 1.8.0"
24
- gem.add_dependency "td-client", "~> 0.8.79"
24
+ gem.add_dependency "td-client", "~> 0.8.82"
25
25
  gem.add_dependency "td-logger", "~> 0.3.21"
26
26
  gem.add_dependency "rubyzip", "~> 1.1.7"
27
27
  gem.add_dependency "zip-zip", "~> 0.3"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: td
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Treasure Data, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-25 00:00:00.000000000 Z
11
+ date: 2016-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack
@@ -102,14 +102,14 @@ dependencies:
102
102
  requirements:
103
103
  - - "~>"
104
104
  - !ruby/object:Gem::Version
105
- version: 0.8.79
105
+ version: 0.8.82
106
106
  type: :runtime
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - "~>"
111
111
  - !ruby/object:Gem::Version
112
- version: 0.8.79
112
+ version: 0.8.82
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: td-logger
115
115
  requirement: !ruby/object:Gem::Requirement
@@ -324,7 +324,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
324
324
  version: '0'
325
325
  requirements: []
326
326
  rubyforge_project:
327
- rubygems_version: 2.4.5.1
327
+ rubygems_version: 2.5.1
328
328
  signing_key:
329
329
  specification_version: 4
330
330
  summary: CLI to manage data on Treasure Data, the Hadoop-based cloud data warehousing