td 0.10.73 → 0.10.74
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +12 -0
- data/contrib/completion/_td +274 -0
- data/contrib/completion/td-comletion.bash +28 -0
- data/lib/td/command/bulk_import.rb +1 -1
- data/lib/td/command/common.rb +3 -0
- data/lib/td/command/ip_limit.rb +53 -0
- data/lib/td/command/list.rb +7 -0
- data/lib/td/command/result.rb +1 -1
- data/lib/td/command/runner.rb +10 -1
- data/lib/td/config.rb +9 -0
- data/lib/td/version.rb +1 -1
- data/td.gemspec +1 -1
- metadata +9 -6
data/ChangeLog
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
== 2013-03-29 version 0.10.74
|
2
|
+
|
3
|
+
* Include zsh and bash completion
|
4
|
+
* Use SSL by default
|
5
|
+
* Add --insecure option to disable SSL
|
6
|
+
* Add IP limitation features:
|
7
|
+
* ip_limit:set <org> <ip_range...>
|
8
|
+
* ip_limit:delete <org>
|
9
|
+
* ip_limit:list
|
10
|
+
* ip_limit:show <org>
|
11
|
+
* td-client v0.8.46
|
12
|
+
|
1
13
|
== 2013-03-15 version 0.10.73
|
2
14
|
|
3
15
|
* Add --sampling option to query subcommand
|
@@ -0,0 +1,274 @@
|
|
1
|
+
#compdef td
|
2
|
+
|
3
|
+
# (( $+functions[_td] )) ||
|
4
|
+
function _td()
|
5
|
+
{
|
6
|
+
typeset -A opt_args
|
7
|
+
local context state line args
|
8
|
+
|
9
|
+
local -a subcommands
|
10
|
+
subcommands=(
|
11
|
+
"account":"Setup a Treasure Data account"
|
12
|
+
"account\:usage":"Show resource usage information"
|
13
|
+
|
14
|
+
"apikey\:show":"Show Treasure Data API key"
|
15
|
+
"apikey\:set":"Set Treasure Data API key"
|
16
|
+
|
17
|
+
"bulk_import\:list":"List bulk import sessions"
|
18
|
+
"bulk_import\:show":"Show list of uploaded parts"
|
19
|
+
"bulk_import\:create":"Create a new bulk import session to the the table"
|
20
|
+
"bulk_import\:prepare_parts":"Convert files into part file format"
|
21
|
+
#"bulk_import\:prepare_parts2":"Convert files into part file format"
|
22
|
+
"bulk_import\:upload_part":"Upload or re-upload a file into a bulk import session"
|
23
|
+
"bulk_import\:upload_parts":"Upload or re-upload files into a bulk import session"
|
24
|
+
#"bulk_import\:upload_parts2":"Upload or re-upload files into a bulk import session"
|
25
|
+
"bulk_import\:delete_part":"Delete a uploaded file from a bulk import session"
|
26
|
+
"bulk_import\:delete_parts":"Delete uploaded files from a bulk import session"
|
27
|
+
"bulk_import\:perform":"Start to validate and convert uploaded files"
|
28
|
+
"bulk_import\:error_records":"Show records which did not pass validations"
|
29
|
+
"bulk_import\:commit":"Start to commit a performed bulk import session"
|
30
|
+
"bulk_import\:delete":"Delete a bulk import session"
|
31
|
+
"bulk_import\:freeze":"Reject succeeding uploadings to a bulk import session"
|
32
|
+
"bulk_import\:unfreeze":"Unfreeze a frozen bulk import session"
|
33
|
+
|
34
|
+
"db\:list":"Show list of tables in a database"
|
35
|
+
"db\:show":"Describe information of a database"
|
36
|
+
"db\:create":"Create a database"
|
37
|
+
"db\:delete":"Delete a database"
|
38
|
+
|
39
|
+
"help\:all":"Show usage of all commands"
|
40
|
+
"help":"Show usage of a command"
|
41
|
+
|
42
|
+
"job\:show":"Show status and result of a job"
|
43
|
+
"job\:status":"Show status progress of a job"
|
44
|
+
"job\:list":"Show list of jobs"
|
45
|
+
"job\:kill":"Kill or cancel a job"
|
46
|
+
|
47
|
+
"password\:change":"Change password"
|
48
|
+
|
49
|
+
"query":"issue a query"
|
50
|
+
|
51
|
+
"result\:list":"Show list of result URLs"
|
52
|
+
"result\:show":"Describe information of a result URL"
|
53
|
+
"result\:create":"Create a result URL"
|
54
|
+
"result\:delete":"Delete a result URL"
|
55
|
+
|
56
|
+
"sample\:apache":"Create a sample log file"
|
57
|
+
|
58
|
+
"sched\:list":"Show list of schedules"
|
59
|
+
"sched\:create":"Create a schedule"
|
60
|
+
"sched\:delete":"Delete a schedule"
|
61
|
+
"sched\:update":"Modify a schedule"
|
62
|
+
"sched\:history":"Show history of scheduled queries"
|
63
|
+
"sched\:run":"Run scheduled queries for the specified time"
|
64
|
+
|
65
|
+
"server\:status":"Show status of the Treasure Data server"
|
66
|
+
|
67
|
+
"schema\:show":"Show schema of a table"
|
68
|
+
"schema\:set":"Set new schema on a table"
|
69
|
+
"schema\:add":"Add new columns to a table"
|
70
|
+
"schema\:remove":"Remove columns from a table"
|
71
|
+
|
72
|
+
"status":"Show scheds, jobs, tables and results"
|
73
|
+
|
74
|
+
"table\:list":"Show list of tables"
|
75
|
+
"table\:show":"Describe information of a table"
|
76
|
+
"table\:create":"Create a table"
|
77
|
+
"table\:delete":"Delete a table"
|
78
|
+
"table\:import":"Parse and import files to a table"
|
79
|
+
"table\:export":"Dump logs in a table to the specified storage"
|
80
|
+
"table\:swap":"Swap names of two tables"
|
81
|
+
"table\:tail":"Get recently imported logs"
|
82
|
+
"table\:partial_delete":"Delete logs from the table within the specified time range"
|
83
|
+
|
84
|
+
# TODO: Add ACL related commands
|
85
|
+
)
|
86
|
+
|
87
|
+
_arguments -C -S \
|
88
|
+
'(--config -c)'{--config,-c}'[path to config file ('~/.td/td.conf')]:PATH:' \
|
89
|
+
'(--apikey -k)'{--apikey,-k}'[use this API key instead of reading the config file]:APIKEY:' \
|
90
|
+
'(--verbose -v)'{--verbose,-v}'[verbose mode]' \
|
91
|
+
'(--help -h)'{--help,-h}'[show help]' \
|
92
|
+
'--version[show td client version]' \
|
93
|
+
'*:: :->subcommand' && ret=0
|
94
|
+
|
95
|
+
if (( CURRENT == 1 )); then
|
96
|
+
_describe -t subcommands "td subcommands" subcommands
|
97
|
+
return
|
98
|
+
fi
|
99
|
+
|
100
|
+
local -a _subcommand_args
|
101
|
+
case "$words[1]" in
|
102
|
+
account)
|
103
|
+
_subcommand_args=(
|
104
|
+
'(-f|--force)'{-f,--force}'[overwrite current account setting]' \
|
105
|
+
)
|
106
|
+
;;
|
107
|
+
apikey:set)
|
108
|
+
_subcommand_args=(
|
109
|
+
'(-f|--force)'{-f,--force}'[overwrite current account setting]' \
|
110
|
+
)
|
111
|
+
;;
|
112
|
+
bulk_import:create)
|
113
|
+
_subcommand_args=(
|
114
|
+
'(-g|--org)'{-g,--org}'[create the bukl import session under this organization]' \
|
115
|
+
)
|
116
|
+
;;
|
117
|
+
bulk_import:upload_parts)
|
118
|
+
_subcommand_args=(
|
119
|
+
'(-P|--prefix)'{-P,--prefix}'[add prefix to parts name]' \
|
120
|
+
'(-s|--use-suffix)'{-s,--use-suffix}'[use COUNT number of . (dots) in the source file name to the parts name]' \
|
121
|
+
'--auto-perform[perform bulk import job automatically]' \
|
122
|
+
'--parallel[perform uploading in parallel (default: 2; max 8)]' \
|
123
|
+
)
|
124
|
+
;;
|
125
|
+
bulk_import:perform)
|
126
|
+
_subcommand_args=(
|
127
|
+
'(-w|--wait)'{-w,--wait}'[wait for finishing the job]' \
|
128
|
+
'(-f|--force)'{-f,--force}'[force start performing]' \
|
129
|
+
)
|
130
|
+
;;
|
131
|
+
bulk_import:prepare_parts)
|
132
|
+
_subcommand_args=(
|
133
|
+
'(-s|--split-size)'{-s,--split-size}'[size of each parts]' \
|
134
|
+
'(-o|--output)'{-o,--output}'[output directory]' \
|
135
|
+
)
|
136
|
+
;;
|
137
|
+
db:create)
|
138
|
+
_subcommand_args=(
|
139
|
+
'(-g|--org)'{-g,--org}'[create the database under this organization]' \
|
140
|
+
)
|
141
|
+
;;
|
142
|
+
db:delete)
|
143
|
+
_subcommand_args=(
|
144
|
+
'(-f|--force)'{-f,--force}'[clear tables and delete the database]' \
|
145
|
+
)
|
146
|
+
;;
|
147
|
+
job:list)
|
148
|
+
_subcommand_args=(
|
149
|
+
'(-p|--page)'{-p,--page}'[skip N pages]' \
|
150
|
+
'(-s|--skip)'{-s,--skip}'[skip N jobs]' \
|
151
|
+
'(-R|--running)'{-R,--running}'[show only running jobs]' \
|
152
|
+
'(-S|--success)'{-S,--success}'[show only succeeded jobs]' \
|
153
|
+
'(-E|--error)'{-E,--error}'[show only failed jobs]' \
|
154
|
+
'--show[show slow queries (default threshold: 3600 seconds)]' \
|
155
|
+
)
|
156
|
+
;;
|
157
|
+
job:show)
|
158
|
+
_subcommand_args=(
|
159
|
+
'(-v|--verbose)'{-v,--verbose}'[show logs]' \
|
160
|
+
'(-w|--wait)'{-w,--wait}'[wait for finishing the job]' \
|
161
|
+
'(-G|--vertical)'{-G,--vertical}'[use vertical table to show results]' \
|
162
|
+
'(-o|--output)'{-o,--output}'[write result to the file]' \
|
163
|
+
'(-f|--format)'{-f,--format}'[format of the result to write to the file (tsv, csv, json or msgpack)]'
|
164
|
+
)
|
165
|
+
;;
|
166
|
+
query)
|
167
|
+
_subcommand_args=(
|
168
|
+
'(-g|--org)'{-g,--org}'[issue the query under this organization]' \
|
169
|
+
'(-d|--database)'{-d,--database}'[use the database (required)]' \
|
170
|
+
'(-w|--wait)'{-w,--wait}'[wait for finishing the job]' \
|
171
|
+
'(-G|--vertical)'{-G,--vertical}'[use vertical table to show results]' \
|
172
|
+
'(-o|--output)'{-o,--output}'[write result to the file]' \
|
173
|
+
'(-f|--format)'{-f,--format}'[format of the result to write to the file (tsv, csv, json or msgpack)]'
|
174
|
+
'(-r|--result)'{-r,--result}'[write result to the URL (see also result:create subcommand)]' \
|
175
|
+
'(-u|--user)'{-u,--user}'[set user name for the result URL]' \
|
176
|
+
'(-p|--password)'{-p,--password}'[ask password for the result URL]' \
|
177
|
+
'(-P|--priority)'{-P,--priority}'[set priority]' \
|
178
|
+
'(-R|--retry)'{-R,--retry}'[automatic retrying count]' \
|
179
|
+
'(-q|--query)'{-q,--query}'[use file instead of inline query]' \
|
180
|
+
'--sampling[enable random sampling to reduce records 1/DENOMINATOR]' \
|
181
|
+
)
|
182
|
+
;;
|
183
|
+
result:create)
|
184
|
+
_subcommand_args=(
|
185
|
+
'(-g|--org)'{-g,--org}'[create the result under this organization]' \
|
186
|
+
'(-u|--user)'{-u,--user}'[set user name for authentication]' \
|
187
|
+
'(-p|--password)'{-p,--password}'[ask password for authentication]' \
|
188
|
+
)
|
189
|
+
;;
|
190
|
+
sched:create)
|
191
|
+
_subcommand_args=(
|
192
|
+
'(-g|--org)'{-g,--org}'[create the schedule under this organization]' \
|
193
|
+
'(-d|--database)'{-d,--database}'[use the database (required)]' \
|
194
|
+
'(-t|--timezone)'{-t,--timezone}'[name of the timezone (like Asia/Tokyo)]' \
|
195
|
+
'(-D|--delay)'{-D,--delay}'[delay time of the schedule]' \
|
196
|
+
'(-o|--output)'{-o,--output}'[write result to the file]' \
|
197
|
+
'(-r|--result)'{-r,--result}'[write result to the URL (see also result:create subcommand)]' \
|
198
|
+
'(-u|--user)'{-u,--user}'[set user name for the result URL]' \
|
199
|
+
'(-p|--password)'{-p,--password}'[ask password for the result URL]' \
|
200
|
+
'(-P|--priority)'{-P,--priority}'[set priority]' \
|
201
|
+
'(-R|--retry)'{-R,--retry}'[automatic retrying count]' \
|
202
|
+
)
|
203
|
+
;;
|
204
|
+
sched:update)
|
205
|
+
_subcommand_args=(
|
206
|
+
'(-s|--schedule)'{-s,--schedule}'[change the schedule]' \
|
207
|
+
'(-q|--query)'{-q,--query}'[change the query]' \
|
208
|
+
'(-d|--database)'{-d,--database}'[change the database]' \
|
209
|
+
'(-r|--result)'{-r,--result}'[change the result table]' \
|
210
|
+
'(-t|--timezone)'{-t,--timezone}'[change the name of the timezone]' \
|
211
|
+
'(-D|--delay)'{-D,--delay}'[change the delay time of the schedule]' \
|
212
|
+
'(-P|--priority)'{-P,--priority}'[set priority]' \
|
213
|
+
'(-R|--retry)'{-R,--retry}'[automatic retrying count]' \
|
214
|
+
)
|
215
|
+
;;
|
216
|
+
sched:histroy)
|
217
|
+
_subcommand_args=(
|
218
|
+
'(-p|--page)'{-p,--page}'[skip N pages]' \
|
219
|
+
'(-s|--skip)'{-s,--skip}'[skip N jobs]' \
|
220
|
+
)
|
221
|
+
;;
|
222
|
+
sched:run)
|
223
|
+
_subcommand_args=(
|
224
|
+
'(-n|--num)'{-n,--num}'[number of jobs to run]' \
|
225
|
+
)
|
226
|
+
;;
|
227
|
+
table:delete)
|
228
|
+
_subcommand_args=(
|
229
|
+
'(-f|--force)'{-f,--force}'[never prompt]' \
|
230
|
+
)
|
231
|
+
;;
|
232
|
+
table:list)
|
233
|
+
_subcommand_args=(
|
234
|
+
'(-n|--num_threads)'{-num,--num_threads}'[number of threads to get list in parallel]' \
|
235
|
+
'--show-bytes[show estimated table in bytes]' \
|
236
|
+
)
|
237
|
+
;;
|
238
|
+
table:tail)
|
239
|
+
_subcommand_args=(
|
240
|
+
'(-t|--to)'{-t,--to}'[end time of logs to get]' \
|
241
|
+
'(-f|--from)'{-f,--from}'[start time of logs to get]' \
|
242
|
+
'(-c|--count)'{-c,--count}'[number of logs to get]' \
|
243
|
+
'(-P|--pretty)'{-P,--pretty}'[pretty print]' \
|
244
|
+
)
|
245
|
+
;;
|
246
|
+
table:import)
|
247
|
+
_subcommand_args=(
|
248
|
+
'--format[file format (default: apache)]' \
|
249
|
+
'--apache[same as --format apache; apache common log format]' \
|
250
|
+
'--syslog[same as --format syslog; syslog]' \
|
251
|
+
'--msgpack[same as --format msgpack; msgpack stream format]' \
|
252
|
+
'--json[same as --format json; LF-separated json format]' \
|
253
|
+
'(-t|--time-key)'{-t,--time-key}'[time key name for json and msgpack format (e.g. created_at)]' \
|
254
|
+
"--auto-create-table[create table and database if doesn't exist]" \
|
255
|
+
)
|
256
|
+
;;
|
257
|
+
table:export)
|
258
|
+
_subcommand_args=(
|
259
|
+
'(-g|--org)'{-g,--org}'[export the data under this organization]' \
|
260
|
+
'(-t|--to)'{-t,--to}'[export data which is older than the TIME]' \
|
261
|
+
'(-f|--from)'{-f,--from}'[export data which is newer than or same with the TIME]' \
|
262
|
+
'(-b|--bucket)'{-b,--bucket}'[name of the destination S3 bucket (required)]' \
|
263
|
+
'(-k|--aws-key-id)'{-k,--aws-key-id}'[AWS access key id to export data (required)]' \
|
264
|
+
'(-s|--aws-secret-key)'{-s,--aws-secret-key}'[AWS secret key to export data (required)]' \
|
265
|
+
)
|
266
|
+
;;
|
267
|
+
esac
|
268
|
+
|
269
|
+
_arguments \
|
270
|
+
$_subcommand_args \
|
271
|
+
&& return 0
|
272
|
+
}
|
273
|
+
|
274
|
+
_td
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# bash completion for td commands
|
2
|
+
|
3
|
+
_td()
|
4
|
+
{
|
5
|
+
COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
|
6
|
+
local cur="${COMP_WORDS[COMP_CWORD]}"
|
7
|
+
local prev="${COMP_WORDS[COMP_CWORD - 1]}"
|
8
|
+
local list="`td help:all | awk '{print $1}' | grep '^[a-z]' | xargs`"
|
9
|
+
|
10
|
+
# echo "cur=$cur, prev=$prev"
|
11
|
+
|
12
|
+
if [[ "$prev" == "td" ]]; then
|
13
|
+
if [[ "$cur" == "" ]]; then
|
14
|
+
COMPREPLY=($list)
|
15
|
+
else
|
16
|
+
COMPREPLY=($(compgen -W "$list" -- "$cur"))
|
17
|
+
fi
|
18
|
+
fi
|
19
|
+
}
|
20
|
+
complete -F _td td
|
21
|
+
|
22
|
+
# Local variables:
|
23
|
+
# # mode: shell-script
|
24
|
+
# # sh-basic-offset: 4
|
25
|
+
# # sh-indent-comment: t
|
26
|
+
# # indent-tabs-mode: nil
|
27
|
+
# # End:
|
28
|
+
# # ex: ts=4 sw=4 et filetype=sh
|
@@ -27,7 +27,7 @@ module Command
|
|
27
27
|
def bulk_import_create(op)
|
28
28
|
org = nil
|
29
29
|
|
30
|
-
op.on('-g', '--org ORGANIZATION', "create the
|
30
|
+
op.on('-g', '--org ORGANIZATION', "create the bulk import session under this organization") {|s|
|
31
31
|
org = s
|
32
32
|
}
|
33
33
|
|
data/lib/td/command/common.rb
CHANGED
@@ -0,0 +1,53 @@
|
|
1
|
+
|
2
|
+
module TreasureData
|
3
|
+
module Command
|
4
|
+
def ip_limit_list(op)
|
5
|
+
op.cmd_parse
|
6
|
+
|
7
|
+
client = get_client
|
8
|
+
|
9
|
+
ip_limits = client.ip_limits
|
10
|
+
rows = ip_limits.map { |ip_limit|
|
11
|
+
{:Organization => ip_limit.org, 'IP Range' => ip_limit.ip_range}
|
12
|
+
}
|
13
|
+
|
14
|
+
puts cmd_render_table(rows, :fields => [:Organization, 'IP Range'])
|
15
|
+
|
16
|
+
if rows.empty?
|
17
|
+
$stderr.puts "There are no IP range limitations."
|
18
|
+
$stderr.puts "Use '#{$prog} ip_limit:set <organization> <ip_range>' to create IP range limitation."
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def ip_limit_show(op)
|
23
|
+
organization = op.cmd_parse
|
24
|
+
|
25
|
+
client = get_client
|
26
|
+
|
27
|
+
ip_limits = client.ip_limits
|
28
|
+
rows = ip_limits.select { |ip_limit|
|
29
|
+
ip_limit.org == organization
|
30
|
+
}.map { |ip_limit| {'IP Range' => ip_limit.ip_range} }
|
31
|
+
|
32
|
+
puts cmd_render_table(rows, :fields => ['IP Range'])
|
33
|
+
end
|
34
|
+
|
35
|
+
def ip_limit_set(op)
|
36
|
+
organization, *ip_ranges = op.cmd_parse
|
37
|
+
|
38
|
+
client = get_client
|
39
|
+
client.set_ip_limit(organization, ip_ranges)
|
40
|
+
|
41
|
+
$stderr.puts "IP range limitations [#{ip_ranges.join(' ')}] are set to #{organization}"
|
42
|
+
end
|
43
|
+
|
44
|
+
def ip_limit_delete(op)
|
45
|
+
organization = op.cmd_parse
|
46
|
+
|
47
|
+
client = get_client
|
48
|
+
client.delete_ip_limit(organization)
|
49
|
+
|
50
|
+
$stderr.puts "All IP range limitations are deleted from #{organization}"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
data/lib/td/command/list.rb
CHANGED
@@ -303,6 +303,11 @@ module List
|
|
303
303
|
add_list 'acl:revoke', %w[subject action scope], 'Revoke an access control'
|
304
304
|
# TODO acl:test
|
305
305
|
|
306
|
+
add_list 'ip_limit:list', %w[], 'Show list of all IP range limitations'
|
307
|
+
add_list 'ip_limit:show', %w[org], "Show list of org's IP range limitations"
|
308
|
+
add_list 'ip_limit:set', %w[org ip_range_], 'Set an IP range limitation'
|
309
|
+
add_list 'ip_limit:delete', %w[org], 'Delete an IP range limitation'
|
310
|
+
|
306
311
|
add_list 'aggr:list', %w[], 'Show list of aggregation schemas'
|
307
312
|
add_list 'aggr:show', %w[name], 'Describe a aggregation schema'
|
308
313
|
add_list 'aggr:create', %w[name relation_key], 'Create a aggregation schema'
|
@@ -372,6 +377,8 @@ module List
|
|
372
377
|
add_alias 'acl', 'acl:list'
|
373
378
|
add_alias 'acls', 'acl:list'
|
374
379
|
|
380
|
+
add_alias 'ip_limits', 'ip_limit:list'
|
381
|
+
|
375
382
|
add_alias 'aggr', 'aggr:show'
|
376
383
|
add_alias 'aggrs', 'aggr:list'
|
377
384
|
|
data/lib/td/command/result.rb
CHANGED
@@ -51,7 +51,7 @@ module Command
|
|
51
51
|
result_user = nil
|
52
52
|
result_ask_password = false
|
53
53
|
|
54
|
-
op.on('-g', '--org ORGANIZATION', "create the
|
54
|
+
op.on('-g', '--org ORGANIZATION', "create the result under this organization") {|s|
|
55
55
|
org = s
|
56
56
|
}
|
57
57
|
op.on('-u', '--user NAME', 'set user name for authentication') {|s|
|
data/lib/td/command/runner.rb
CHANGED
@@ -8,9 +8,10 @@ class Runner
|
|
8
8
|
@config_path = nil
|
9
9
|
@apikey = nil
|
10
10
|
@prog_name = nil
|
11
|
+
@secure = true
|
11
12
|
end
|
12
13
|
|
13
|
-
attr_accessor :apikey, :config_path, :prog_name
|
14
|
+
attr_accessor :apikey, :config_path, :prog_name, :secure
|
14
15
|
|
15
16
|
def run(argv=ARGV)
|
16
17
|
require 'td/version'
|
@@ -67,6 +68,7 @@ EOF
|
|
67
68
|
|
68
69
|
config_path = @config_path
|
69
70
|
apikey = @apikey
|
71
|
+
insecure = nil
|
70
72
|
$verbose = false
|
71
73
|
#$debug = false
|
72
74
|
|
@@ -78,6 +80,10 @@ EOF
|
|
78
80
|
apikey = s
|
79
81
|
}
|
80
82
|
|
83
|
+
op.on('--insecure', "Insecure access: disable SSL") { |b|
|
84
|
+
insecure = true
|
85
|
+
}
|
86
|
+
|
81
87
|
op.on('-v', '--verbose', "verbose mode", TrueClass) {|b|
|
82
88
|
$verbose = b
|
83
89
|
}
|
@@ -102,6 +108,9 @@ EOF
|
|
102
108
|
if apikey
|
103
109
|
TreasureData::Config.apikey = apikey
|
104
110
|
end
|
111
|
+
if insecure
|
112
|
+
TreasureData::Config.secure = false
|
113
|
+
end
|
105
114
|
rescue
|
106
115
|
usage $!.to_s
|
107
116
|
end
|
data/lib/td/config.rb
CHANGED
@@ -91,6 +91,7 @@ class Config
|
|
91
91
|
@@path = ENV['TREASURE_DATA_CONFIG_PATH'] || ENV['TD_CONFIG_PATH'] || File.join(ENV['HOME'], '.td', 'td.conf')
|
92
92
|
@@apikey = ENV['TREASURE_DATA_API_KEY'] || ENV['TD_API_KEY']
|
93
93
|
@@apikey = nil if @@apikey == ""
|
94
|
+
@@secure = true
|
94
95
|
|
95
96
|
def self.path
|
96
97
|
@@path
|
@@ -107,6 +108,14 @@ class Config
|
|
107
108
|
def self.apikey=(apikey)
|
108
109
|
@@apikey = apikey
|
109
110
|
end
|
111
|
+
|
112
|
+
def self.secure
|
113
|
+
@@secure
|
114
|
+
end
|
115
|
+
|
116
|
+
def self.secure=(secure)
|
117
|
+
@@secure = secure
|
118
|
+
end
|
110
119
|
end
|
111
120
|
|
112
121
|
|
data/lib/td/version.rb
CHANGED
data/td.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |gem|
|
|
20
20
|
gem.add_dependency "yajl-ruby", "~> 1.1.0"
|
21
21
|
gem.add_dependency "hirb", ">= 0.4.5"
|
22
22
|
gem.add_dependency "parallel", "~> 0.5.19"
|
23
|
-
gem.add_dependency "td-client", "~> 0.8.
|
23
|
+
gem.add_dependency "td-client", "~> 0.8.46"
|
24
24
|
gem.add_dependency "td-logger", "~> 0.3.16"
|
25
25
|
gem.add_development_dependency "rake", "~> 0.9"
|
26
26
|
gem.add_development_dependency "rspec", "~> 2.10.0"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: td
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.74
|
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: 2013-03-
|
12
|
+
date: 2013-03-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: msgpack
|
@@ -82,7 +82,7 @@ dependencies:
|
|
82
82
|
requirements:
|
83
83
|
- - ~>
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: 0.8.
|
85
|
+
version: 0.8.46
|
86
86
|
type: :runtime
|
87
87
|
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -90,7 +90,7 @@ dependencies:
|
|
90
90
|
requirements:
|
91
91
|
- - ~>
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: 0.8.
|
93
|
+
version: 0.8.46
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
95
|
name: td-logger
|
96
96
|
requirement: !ruby/object:Gem::Requirement
|
@@ -169,6 +169,8 @@ files:
|
|
169
169
|
- Rakefile
|
170
170
|
- bin/td
|
171
171
|
- build/update-td-bulk-import-java.sh
|
172
|
+
- contrib/completion/_td
|
173
|
+
- contrib/completion/td-comletion.bash
|
172
174
|
- data/sample_apache.json
|
173
175
|
- data/sample_apache_gen.rb
|
174
176
|
- dist/exe.rake
|
@@ -194,6 +196,7 @@ files:
|
|
194
196
|
- lib/td/command/export.rb
|
195
197
|
- lib/td/command/help.rb
|
196
198
|
- lib/td/command/import.rb
|
199
|
+
- lib/td/command/ip_limit.rb
|
197
200
|
- lib/td/command/job.rb
|
198
201
|
- lib/td/command/list.rb
|
199
202
|
- lib/td/command/org.rb
|
@@ -239,7 +242,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
239
242
|
version: '0'
|
240
243
|
segments:
|
241
244
|
- 0
|
242
|
-
hash:
|
245
|
+
hash: 1161270452810499022
|
243
246
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
244
247
|
none: false
|
245
248
|
requirements:
|
@@ -248,7 +251,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
248
251
|
version: '0'
|
249
252
|
segments:
|
250
253
|
- 0
|
251
|
-
hash:
|
254
|
+
hash: 1161270452810499022
|
252
255
|
requirements: []
|
253
256
|
rubyforge_project:
|
254
257
|
rubygems_version: 1.8.23
|