kura 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +7 -0
- data/README.md +1 -1
- data/lib/kura.rb +7 -1
- data/lib/kura/client.rb +21 -0
- data/lib/kura/extensions/google/apis/bigquery_v2/job.rb +4 -0
- data/lib/kura/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2333eaf23a195c96789fec8b1a9f2f7ecae62be3437c1c492d8afa00c1438203
|
4
|
+
data.tar.gz: 88895cb72f099b98481235903fe3145de8fa07e13b9eb7f12a9ef1b2023a769c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b830c2859892d4283ab44f583676ba7da8c4f4dfede607a3d9e8d0cf08fd540c08c2c5f56d2d91f6b4d238934f5d4141557dd669f7a7df23ae737fb4183ec479
|
7
|
+
data.tar.gz: afa73e1709e3310287f64165b5551598c9055646e97c891f669c5cdee6239e615a31890ef232b818910bf49bf33191fed7acece362d36921d08d986cae9e1247
|
data/ChangeLog.md
CHANGED
data/README.md
CHANGED
@@ -43,7 +43,7 @@ client = Kura.client(.., scope: "https://www.googleapis.com/auth/drive")
|
|
43
43
|
|
44
44
|
```
|
45
45
|
client.load("dataset", "table", "gs://mybucket/data.csv", wait: 120)
|
46
|
-
client.query("SELECT * FROM [dataset.table];", dataset_id: "dest_dataset", table_id: dest_table", wait: 120)
|
46
|
+
client.query("SELECT * FROM [dataset.table];", dataset_id: "dest_dataset", table_id: "dest_table", wait: 120)
|
47
47
|
client.extract("dataset", "result", "gs://mybucket/extracted.csv", wait: 120)
|
48
48
|
client.copy("src_dataset", "src_table", "dest_dataset", "dest_table", wait: 120)
|
49
49
|
```
|
data/lib/kura.rb
CHANGED
@@ -50,7 +50,13 @@ module Kura
|
|
50
50
|
elsif project_id.is_a?(Hash)
|
51
51
|
credential = project_id
|
52
52
|
else
|
53
|
-
|
53
|
+
begin
|
54
|
+
# get project id from metadata server
|
55
|
+
project_id = URI.open("http://metadata/computeMetadata/v1/project/project-id", "Metadata-Flavor" => "Google") do |f| f.read end
|
56
|
+
return self::Client.new(default_project_id: project_id)
|
57
|
+
rescue
|
58
|
+
raise ArgumentError, "#{self.class.name}.client accept JSON credential file path or decoded Hash object."
|
59
|
+
end
|
54
60
|
end
|
55
61
|
project_id = credential["project_id"]
|
56
62
|
email_address = credential["client_email"]
|
data/lib/kura/client.rb
CHANGED
@@ -596,6 +596,27 @@ module Kura
|
|
596
596
|
insert_job(configuration, wait: wait, job_id: job_id, project_id: job_project_id, &blk)
|
597
597
|
end
|
598
598
|
|
599
|
+
def jobs(project_id: @default_project_id,
|
600
|
+
all_users: nil,
|
601
|
+
max_creation_time: nil,
|
602
|
+
min_creation_time: nil,
|
603
|
+
max_results: nil,
|
604
|
+
page_token: nil,
|
605
|
+
parent_job_id: nil,
|
606
|
+
projection: nil,
|
607
|
+
state_filter: nil)
|
608
|
+
@api.list_jobs(
|
609
|
+
project_id,
|
610
|
+
all_users: all_users,
|
611
|
+
max_creation_time: max_creation_time,
|
612
|
+
min_creation_time: min_creation_time,
|
613
|
+
max_results: max_results,
|
614
|
+
page_token: page_token,
|
615
|
+
parent_job_id: parent_job_id,
|
616
|
+
projection: projection,
|
617
|
+
state_filter: state_filter)
|
618
|
+
end
|
619
|
+
|
599
620
|
def job(job_id, location: nil, project_id: @default_project_id, &blk)
|
600
621
|
if blk
|
601
622
|
@api.get_job(project_id, job_id, location: location) do |j, e|
|
data/lib/kura/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kura
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chikanaga Tomoyuki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-api-client
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
- !ruby/object:Gem::Version
|
155
155
|
version: '0'
|
156
156
|
requirements: []
|
157
|
-
rubygems_version: 3.
|
157
|
+
rubygems_version: 3.1.2
|
158
158
|
signing_key:
|
159
159
|
specification_version: 4
|
160
160
|
summary: Interface to BigQuery API v2.
|