gcloud 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +8 -8
  2. data/CHANGELOG.md +8 -0
  3. data/lib/gcloud.rb +48 -30
  4. data/lib/gcloud/bigquery.rb +4 -6
  5. data/lib/gcloud/bigquery/connection.rb +2 -14
  6. data/lib/gcloud/bigquery/dataset.rb +41 -42
  7. data/lib/gcloud/bigquery/project.rb +50 -46
  8. data/lib/gcloud/bigquery/query_job.rb +7 -8
  9. data/lib/gcloud/bigquery/table.rb +54 -55
  10. data/lib/gcloud/bigquery/table/schema.rb +30 -40
  11. data/lib/gcloud/bigquery/view.rb +10 -11
  12. data/lib/gcloud/credentials.rb +19 -25
  13. data/lib/gcloud/datastore.rb +4 -6
  14. data/lib/gcloud/datastore/dataset.rb +3 -5
  15. data/lib/gcloud/dns.rb +4 -6
  16. data/lib/gcloud/dns/connection.rb +17 -16
  17. data/lib/gcloud/dns/importer.rb +5 -11
  18. data/lib/gcloud/dns/project.rb +11 -12
  19. data/lib/gcloud/dns/zone.rb +52 -92
  20. data/lib/gcloud/dns/zone/transaction.rb +2 -2
  21. data/lib/gcloud/pubsub.rb +4 -6
  22. data/lib/gcloud/pubsub/connection.rb +1 -12
  23. data/lib/gcloud/pubsub/project.rb +30 -36
  24. data/lib/gcloud/pubsub/subscription.rb +18 -26
  25. data/lib/gcloud/pubsub/topic.rb +16 -26
  26. data/lib/gcloud/resource_manager.rb +5 -6
  27. data/lib/gcloud/resource_manager/connection.rb +4 -4
  28. data/lib/gcloud/resource_manager/manager.rb +10 -14
  29. data/lib/gcloud/resource_manager/project.rb +3 -5
  30. data/lib/gcloud/search.rb +295 -0
  31. data/lib/gcloud/search/api_client.rb +144 -0
  32. data/lib/gcloud/search/connection.rb +146 -0
  33. data/lib/gcloud/search/credentials.rb +30 -0
  34. data/lib/gcloud/search/document.rb +301 -0
  35. data/lib/gcloud/search/document/list.rb +85 -0
  36. data/lib/gcloud/search/errors.rb +67 -0
  37. data/lib/gcloud/search/field_value.rb +164 -0
  38. data/lib/gcloud/search/field_values.rb +263 -0
  39. data/lib/gcloud/search/fields.rb +267 -0
  40. data/lib/gcloud/search/index.rb +613 -0
  41. data/lib/gcloud/search/index/list.rb +90 -0
  42. data/lib/gcloud/search/project.rb +197 -0
  43. data/lib/gcloud/search/result.rb +169 -0
  44. data/lib/gcloud/search/result/list.rb +95 -0
  45. data/lib/gcloud/storage.rb +4 -6
  46. data/lib/gcloud/storage/bucket.rb +55 -43
  47. data/lib/gcloud/storage/bucket/cors.rb +5 -7
  48. data/lib/gcloud/storage/file.rb +35 -30
  49. data/lib/gcloud/storage/file/acl.rb +12 -16
  50. data/lib/gcloud/storage/project.rb +56 -22
  51. data/lib/gcloud/version.rb +1 -1
  52. metadata +20 -3
@@ -174,9 +174,7 @@ module Gcloud
174
174
  # * allUsers
175
175
  # * allAuthenticatedUsers
176
176
  #
177
- # +options+::
178
- # An optional Hash for controlling additional behavior. (+Hash+)
179
- # <code>options[:generation]</code>::
177
+ # +generation+::
180
178
  # When present, selects a specific revision of this object.
181
179
  # Default is the latest version. (+Integer+)
182
180
  #
@@ -210,7 +208,8 @@ module Gcloud
210
208
  # email = "authors@example.net"
211
209
  # file.acl.add_owner "group-#{email}"
212
210
  #
213
- def add_owner entity, options = {}
211
+ def add_owner entity, generation: nil
212
+ options = { generation: generation }
214
213
  resp = @connection.insert_file_acl @bucket, @file, entity,
215
214
  "OWNER", options
216
215
  if resp.success?
@@ -239,9 +238,7 @@ module Gcloud
239
238
  # * allUsers
240
239
  # * allAuthenticatedUsers
241
240
  #
242
- # +options+::
243
- # An optional Hash for controlling additional behavior. (+Hash+)
244
- # <code>options[:generation]</code>::
241
+ # +generation+::
245
242
  # When present, selects a specific revision of this object.
246
243
  # Default is the latest version. (+Integer+)
247
244
  #
@@ -275,7 +272,8 @@ module Gcloud
275
272
  # email = "authors@example.net"
276
273
  # file.acl.add_writer "group-#{email}"
277
274
  #
278
- def add_writer entity, options = {}
275
+ def add_writer entity, generation: nil
276
+ options = { generation: generation }
279
277
  resp = @connection.insert_file_acl @bucket, @file, entity,
280
278
  "WRITER", options
281
279
  if resp.success?
@@ -304,9 +302,7 @@ module Gcloud
304
302
  # * allUsers
305
303
  # * allAuthenticatedUsers
306
304
  #
307
- # +options+::
308
- # An optional Hash for controlling additional behavior. (+Hash+)
309
- # <code>options[:generation]</code>::
305
+ # +generation+::
310
306
  # When present, selects a specific revision of this object.
311
307
  # Default is the latest version. (+Integer+)
312
308
  #
@@ -340,7 +336,8 @@ module Gcloud
340
336
  # email = "authors@example.net"
341
337
  # file.acl.add_reader "group-#{email}"
342
338
  #
343
- def add_reader entity, options = {}
339
+ def add_reader entity, generation: nil
340
+ options = { generation: generation }
344
341
  resp = @connection.insert_file_acl @bucket, @file, entity,
345
342
  "READER", options
346
343
  if resp.success?
@@ -369,9 +366,7 @@ module Gcloud
369
366
  # * allUsers
370
367
  # * allAuthenticatedUsers
371
368
  #
372
- # +options+::
373
- # An optional Hash for controlling additional behavior. (+Hash+)
374
- # <code>options[:generation]</code>::
369
+ # +generation+::
375
370
  # When present, selects a specific revision of this object.
376
371
  # Default is the latest version. (+Integer+)
377
372
  #
@@ -388,7 +383,8 @@ module Gcloud
388
383
  # email = "heidi@example.net"
389
384
  # file.acl.delete "user-#{email}"
390
385
  #
391
- def delete entity, options = {}
386
+ def delete entity, generation: nil
387
+ options = { generation: generation }
392
388
  resp = @connection.delete_file_acl @bucket, @file, entity, options
393
389
  if resp.success?
394
390
  @owners.delete entity unless @owners.nil?
@@ -90,15 +90,13 @@ module Gcloud
90
90
  #
91
91
  # === Parameters
92
92
  #
93
- # +options+::
94
- # An optional Hash for controlling additional behavior. (+Hash+)
95
- # <code>options[:prefix]</code>::
93
+ # +prefix+::
96
94
  # Filter results to buckets whose names begin with this prefix.
97
95
  # (+String+)
98
- # <code>options[:token]</code>::
96
+ # +token+::
99
97
  # A previously-returned page token representing part of the larger set
100
98
  # of results to view. (+String+)
101
- # <code>options[:max]</code>::
99
+ # +max+::
102
100
  # Maximum number of buckets to return. (+Integer+)
103
101
  #
104
102
  # === Returns
@@ -147,7 +145,8 @@ module Gcloud
147
145
  # tmp_buckets = storage.buckets token: tmp_buckets.token
148
146
  # end
149
147
  #
150
- def buckets options = {}
148
+ def buckets prefix: nil, token: nil, max: nil
149
+ options = { prefix: prefix, token: token, max: max }
151
150
  resp = connection.list_buckets options
152
151
  if resp.success?
153
152
  Bucket::List.from_response resp, connection
@@ -203,23 +202,52 @@ module Gcloud
203
202
  #
204
203
  # +bucket_name+::
205
204
  # Name of a bucket. (+String+)
206
- # +options+::
207
- # An optional Hash for controlling additional behavior. (+Hash+)
208
- # <code>options[:cors]</code>::
205
+ # +acl+::
206
+ # Apply a predefined set of access controls to this bucket. (+String+)
207
+ #
208
+ # Acceptable values are:
209
+ # * +auth+, +auth_read+, +authenticated+, +authenticated_read+,
210
+ # +authenticatedRead+ - Project team owners get OWNER access, and
211
+ # allAuthenticatedUsers get READER access.
212
+ # * +private+ - Project team owners get OWNER access.
213
+ # * +project_private+, +projectPrivate+ - Project team members get
214
+ # access according to their roles.
215
+ # * +public+, +public_read+, +publicRead+ - Project team owners get
216
+ # OWNER access, and allUsers get READER access.
217
+ # * +public_write+, +publicReadWrite+ - Project team owners get OWNER
218
+ # access, and allUsers get WRITER access.
219
+ # +default_acl+::
220
+ # Apply a predefined set of default object access controls to this
221
+ # bucket. (+String+)
222
+ #
223
+ # Acceptable values are:
224
+ # * +auth+, +auth_read+, +authenticated+, +authenticated_read+,
225
+ # +authenticatedRead+ - File owner gets OWNER access, and
226
+ # allAuthenticatedUsers get READER access.
227
+ # * +owner_full+, +bucketOwnerFullControl+ - File owner gets OWNER
228
+ # access, and project team owners get OWNER access.
229
+ # * +owner_read+, +bucketOwnerRead+ - File owner gets OWNER access, and
230
+ # project team owners get READER access.
231
+ # * +private+ - File owner gets OWNER access.
232
+ # * +project_private+, +projectPrivate+ - File owner gets OWNER access,
233
+ # and project team members get access according to their roles.
234
+ # * +public+, +public_read+, +publicRead+ - File owner gets OWNER
235
+ # access, and allUsers get READER access.
236
+ # +cors+::
209
237
  # The CORS rules for the bucket. Accepts an array of hashes containing
210
238
  # the attributes specified for the {resource description of
211
239
  # cors}[https://cloud.google.com/storage/docs/json_api/v1/buckets#cors].
212
- # <code>options[:location]</code>::
240
+ # +location+::
213
241
  # The location of the bucket. Object data for objects in the bucket
214
242
  # resides in physical storage within this region. Possible values
215
243
  # include +ASIA+, +EU+, and +US+.(See the {developer's
216
244
  # guide}[https://cloud.google.com/storage/docs/bucket-locations] for the
217
245
  # authoritative list. The default value is +US+. (+String+)
218
- # <code>options[:logging_bucket]</code>::
246
+ # +logging_bucket+::
219
247
  # The destination bucket for the bucket's logs. For more information,
220
248
  # see {Access
221
249
  # Logs}[https://cloud.google.com/storage/docs/access-logs]. (+String+)
222
- # <code>options[:logging_prefix]</code>::
250
+ # +logging_prefix+::
223
251
  # The prefix used to create log object names for the bucket. It can be
224
252
  # at most 900 characters and must be a {valid object
225
253
  # name}[https://cloud.google.com/storage/docs/bucket-naming#objectnames]
@@ -227,27 +255,27 @@ module Gcloud
227
255
  # of the bucket for which the logs are enabled. For more information,
228
256
  # see {Access Logs}[https://cloud.google.com/storage/docs/access-logs].
229
257
  # (+String+)
230
- # <code>options[:retries]</code>::
258
+ # +retries+::
231
259
  # The number of times the API call should be retried.
232
260
  # Default is Gcloud::Backoff.retries. (+Integer+)
233
- # <code>options[:storage_class]</code>::
261
+ # +storage_class+::
234
262
  # Defines how objects in the bucket are stored and determines the SLA
235
263
  # and the cost of storage. Values include +:standard+, +:nearline+, and
236
264
  # +:dra+ (Durable Reduced Availability), as well as the strings returned
237
265
  # by Bucket#storage_class. For more information, see {Storage
238
266
  # Classes}[https://cloud.google.com/storage/docs/storage-classes].
239
267
  # The default value is +:standard+. (+Symbol+ or +String+)
240
- # <code>options[:versioning]</code>::
268
+ # +versioning+::
241
269
  # Whether {Object
242
270
  # Versioning}[https://cloud.google.com/storage/docs/object-versioning]
243
271
  # is to be enabled for the bucket. The default value is +false+.
244
272
  # (+Boolean+)
245
- # <code>options[:website_main]</code>::
273
+ # +website_main+::
246
274
  # The index page returned from a static website served from the bucket
247
275
  # when a site visitor requests the top level directory. For more
248
276
  # information, see {How to Host a Static Website
249
277
  # }[https://cloud.google.com/storage/docs/website-configuration#step4].
250
- # <code>options[:website_404]</code>::
278
+ # +website_404+::
251
279
  # The page returned from a static website served from the bucket when a
252
280
  # site visitor requests a resource that does not exist. For more
253
281
  # information, see {How to Host a Static Website
@@ -298,15 +326,21 @@ module Gcloud
298
326
  # max_age: 300
299
327
  # end
300
328
  #
301
- def create_bucket bucket_name, options = {}
302
- options[:acl] = acl_rule options[:acl]
303
- options[:default_acl] = acl_rule options[:default_acl]
329
+ def create_bucket bucket_name, acl: nil, default_acl: nil, cors: nil,
330
+ location: nil, logging_bucket: nil, logging_prefix: nil,
331
+ retries: nil, storage_class: nil, versioning: nil,
332
+ website_main: nil, website_404: nil
333
+ opts = { acl: acl_rule(acl), default_acl: acl_rule(default_acl),
334
+ cors: cors, location: location, logging_bucket: logging_bucket,
335
+ logging_prefix: logging_prefix, retries: retries,
336
+ storage_class: storage_class, versioning: versioning,
337
+ website_main: website_main, website_404: website_404 }
304
338
  if block_given?
305
339
  cors_builder = Bucket::Cors.new
306
340
  yield cors_builder
307
- options[:cors] = cors_builder if cors_builder.changed?
341
+ opts[:cors] = cors_builder if cors_builder.changed?
308
342
  end
309
- insert_bucket bucket_name, options
343
+ insert_bucket bucket_name, opts
310
344
  end
311
345
 
312
346
  protected
@@ -16,5 +16,5 @@
16
16
  #--
17
17
  # Google Cloud Version
18
18
  module Gcloud
19
- VERSION = "0.5.0"
19
+ VERSION = "0.6.0"
20
20
  end
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gcloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Silvano Luciani
8
8
  - Mike Moore
9
+ - Chris Smith
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2015-10-29 00:00:00.000000000 Z
13
+ date: 2015-12-11 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: beefcake
@@ -225,6 +226,7 @@ description: Gcloud is the official library for interacting with Google Cloud.
225
226
  email:
226
227
  - silvano@google.com
227
228
  - mike@blowmage.com
229
+ - quartzmo@gmail.com
228
230
  executables: []
229
231
  extensions: []
230
232
  extra_rdoc_files:
@@ -307,6 +309,21 @@ files:
307
309
  - lib/gcloud/resource_manager/project.rb
308
310
  - lib/gcloud/resource_manager/project/list.rb
309
311
  - lib/gcloud/resource_manager/project/updater.rb
312
+ - lib/gcloud/search.rb
313
+ - lib/gcloud/search/api_client.rb
314
+ - lib/gcloud/search/connection.rb
315
+ - lib/gcloud/search/credentials.rb
316
+ - lib/gcloud/search/document.rb
317
+ - lib/gcloud/search/document/list.rb
318
+ - lib/gcloud/search/errors.rb
319
+ - lib/gcloud/search/field_value.rb
320
+ - lib/gcloud/search/field_values.rb
321
+ - lib/gcloud/search/fields.rb
322
+ - lib/gcloud/search/index.rb
323
+ - lib/gcloud/search/index/list.rb
324
+ - lib/gcloud/search/project.rb
325
+ - lib/gcloud/search/result.rb
326
+ - lib/gcloud/search/result/list.rb
310
327
  - lib/gcloud/storage.rb
311
328
  - lib/gcloud/storage/bucket.rb
312
329
  - lib/gcloud/storage/bucket/acl.rb
@@ -338,7 +355,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
338
355
  requirements:
339
356
  - - ! '>='
340
357
  - !ruby/object:Gem::Version
341
- version: 1.9.3
358
+ version: 2.0.0
342
359
  required_rubygems_version: !ruby/object:Gem::Requirement
343
360
  requirements:
344
361
  - - ! '>='