td 0.10.37 → 0.10.38

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,4 +1,9 @@
1
1
 
2
+ == 2012-08-06 version 0.10.38
3
+
4
+ * *:list and *:show: subcommands show organization name if it's set
5
+
6
+
2
7
  == 2012-08-06 version 0.10.37
3
8
 
4
9
  * Added access control
@@ -10,11 +10,13 @@ module Command
10
10
  bis = client.bulk_imports
11
11
 
12
12
  rows = []
13
+ has_org = false
13
14
  bis.each {|bi|
14
- rows << {:Name=>bi.name, :Table=>"#{bi.database}.#{bi.table}", :Status=>bi.status.to_s.capitalize, :Frozen=>bi.upload_frozen? ? 'Frozen' : '', :JobID=>bi.job_id, :"Valid Parts"=>bi.valid_parts, :"Error Parts"=>bi.error_parts, :"Valid Records"=>bi.valid_records, :"Error Records"=>bi.error_records}
15
+ rows << {:Name=>bi.name, :Table=>"#{bi.database}.#{bi.table}", :Status=>bi.status.to_s.capitalize, :Frozen=>bi.upload_frozen? ? 'Frozen' : '', :JobID=>bi.job_id, :"Valid Parts"=>bi.valid_parts, :"Error Parts"=>bi.error_parts, :"Valid Records"=>bi.valid_records, :"Error Records"=>bi.error_records, :Organization=>bi.org_name}
16
+ has_org = true if bi.org_name
15
17
  }
16
18
 
17
- puts cmd_render_table(rows, :fields => [:Name, :Table, :Status, :Frozen, :JobID, :"Valid Parts", :"Error Parts", :"Valid Records", :"Error Records"], :max_width=>200)
19
+ puts cmd_render_table(rows, :fields => (has_org ? [:Organization] : [])+[:Name, :Table, :Status, :Frozen, :JobID, :"Valid Parts", :"Error Parts", :"Valid Records", :"Error Records"], :max_width=>200)
18
20
 
19
21
  if rows.empty?
20
22
  $stderr.puts "There are no bulk import sessions."
@@ -63,6 +65,7 @@ module Command
63
65
  exit 1
64
66
  end
65
67
 
68
+ $stderr.puts "Organization : #{bi.org_name}"
66
69
  $stderr.puts "Name : #{bi.name}"
67
70
  $stderr.puts "Database : #{bi.database}"
68
71
  $stderr.puts "Table : #{bi.table}"
data/lib/td/command/db.rb CHANGED
@@ -30,10 +30,12 @@ module Command
30
30
  dbs = client.databases
31
31
 
32
32
  rows = []
33
+ has_org = false
33
34
  dbs.each {|db|
34
- rows << {:Name=>db.name, :Count=>db.count}
35
+ rows << {:Name=>db.name, :Count=>db.count, :Organization=>db.org_name}
36
+ has_org = true if db.org_name
35
37
  }
36
- puts cmd_render_table(rows, :fields => [:Name, :Count])
38
+ puts cmd_render_table(rows, :fields => (has_org ? [:Organization] : [])+[:Name, :Count])
37
39
 
38
40
  if dbs.empty?
39
41
  $stderr.puts "There are no databases."
@@ -59,14 +59,16 @@ module Command
59
59
  jobs = client.jobs(skip, skip+max-1, status)
60
60
 
61
61
  rows = []
62
+ has_org = false
62
63
  jobs.each {|job|
63
64
  start = job.start_at
64
65
  elapsed = cmd_format_elapsed(start, job.end_at)
65
66
  priority = job_priority_name_of(job.priority)
66
- rows << {:JobID => job.job_id, :Status => job.status, :Type => job.type, :Query => job.query.to_s, :Start => (start ? start.localtime : ''), :Elapsed => elapsed, :Priority => priority, :Result => job.result_url}
67
+ rows << {:JobID => job.job_id, :Status => job.status, :Type => job.type, :Query => job.query.to_s, :Start => (start ? start.localtime : ''), :Elapsed => elapsed, :Priority => priority, :Result => job.result_url, :Organization => job.org_name}
68
+ has_org = true if job.org_name
67
69
  }
68
70
 
69
- puts cmd_render_table(rows, :fields => [:JobID, :Status, :Start, :Elapsed, :Priority, :Result, :Type, :Query])
71
+ puts cmd_render_table(rows, :fields => (has_org ? [:Organization] : [])+[:JobID, :Status, :Start, :Elapsed, :Priority, :Result, :Type, :Query])
70
72
  end
71
73
 
72
74
  def job_show(op)
@@ -97,6 +99,7 @@ module Command
97
99
 
98
100
  job = client.job(job_id)
99
101
 
102
+ puts "Organization : #{job.org_name}"
100
103
  puts "JobID : #{job.job_id}"
101
104
  #puts "URL : #{job.url}"
102
105
  puts "Status : #{job.status}"
@@ -16,6 +16,7 @@ module Command
16
16
  exit 1
17
17
  end
18
18
 
19
+ puts "Organization : #{r.org_name}"
19
20
  puts "Name : #{r.name}"
20
21
  puts "URL : #{r.url}"
21
22
  end
@@ -28,14 +29,16 @@ module Command
28
29
  rs = client.results
29
30
 
30
31
  rows = []
32
+ has_org = false
31
33
  rs.each {|r|
32
- rows << {:Name => r.name, :URL => r.url}
34
+ rows << {:Name => r.name, :URL => r.url, :Organization => r.org_name}
35
+ has_org = true if r.org_name
33
36
  }
34
37
  rows = rows.sort_by {|map|
35
38
  map[:Name]
36
39
  }
37
40
 
38
- puts cmd_render_table(rows, :fields => [:Name, :URL])
41
+ puts cmd_render_table(rows, :fields => (has_org ? [:Organization] : [])+[:Name, :URL])
39
42
 
40
43
  if rs.empty?
41
44
  $stderr.puts "There are no result URLs."
@@ -15,8 +15,8 @@ module Command
15
15
  exit 1
16
16
  end
17
17
 
18
- $stderr.puts "Name : #{role.name}"
19
18
  $stderr.puts "Organization : #{role.org_name}"
19
+ $stderr.puts "Name : #{role.name}"
20
20
  $stderr.puts "Users : #{role.user_names.join(', ')}"
21
21
  end
22
22
 
@@ -12,14 +12,16 @@ module Command
12
12
  scheds = client.schedules
13
13
 
14
14
  rows = []
15
+ has_org = false
15
16
  scheds.each {|sched|
16
- rows << {:Name => sched.name, :Cron => sched.cron, :Timezone => sched.timezone, :Delay => sched.delay, :Priority => job_priority_name_of(sched.priority), :Result => sched.result_url, :Database => sched.database, :Query => sched.query, :"Next schedule" => sched.next_time ? sched.next_time.localtime : nil }
17
+ rows << {:Name => sched.name, :Cron => sched.cron, :Timezone => sched.timezone, :Delay => sched.delay, :Priority => job_priority_name_of(sched.priority), :Result => sched.result_url, :Database => sched.database, :Query => sched.query, :"Next schedule" => sched.next_time ? sched.next_time.localtime : nil, :Organization => sched.org_name }
18
+ has_org = true if sched.org_name
17
19
  }
18
20
  rows = rows.sort_by {|map|
19
21
  map[:Name]
20
22
  }
21
23
 
22
- puts cmd_render_table(rows, :fields => [:Name, :Cron, :Timezone, :"Next schedule", :Delay, :Priority, :Result, :Database, :Query], :max_width=>500)
24
+ puts cmd_render_table(rows, :fields => (has_org ? [:Organization] : [])+[:Name, :Cron, :Timezone, :"Next schedule", :Delay, :Priority, :Result, :Database, :Query], :max_width=>500)
23
25
  end
24
26
 
25
27
  def sched_create(op)
@@ -199,6 +201,7 @@ module Command
199
201
 
200
202
  scheds = client.schedules
201
203
  if s = scheds.find {|s| s.name == name }
204
+ puts "Organization : #{s.org_name}"
202
205
  puts "Name : #{s.name}"
203
206
  puts "Cron : #{s.cron}"
204
207
  puts "Timezone : #{s.timezone}"
data/lib/td/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module TreasureData
2
2
 
3
- VERSION = '0.10.37'
3
+ VERSION = '0.10.38'
4
4
 
5
5
  end
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.37
4
+ version: 0.10.38
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: 2012-08-07 00:00:00.000000000 Z
12
+ date: 2012-08-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: msgpack
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: 0.8.21
69
+ version: 0.8.22
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,7 +74,7 @@ dependencies:
74
74
  requirements:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
- version: 0.8.21
77
+ version: 0.8.22
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: td-logger
80
80
  requirement: !ruby/object:Gem::Requirement