gcloud 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/AUTHENTICATION.md +1 -1
- data/CHANGELOG.md +14 -0
- data/OVERVIEW.md +87 -0
- data/lib/gcloud.rb +106 -0
- data/lib/gcloud/credentials.rb +1 -1
- data/lib/gcloud/datastore.rb +44 -31
- data/lib/gcloud/datastore/credentials.rb +1 -1
- data/lib/gcloud/datastore/dataset.rb +20 -14
- data/lib/gcloud/datastore/entity.rb +25 -18
- data/lib/gcloud/datastore/key.rb +11 -8
- data/lib/gcloud/pubsub.rb +375 -0
- data/lib/gcloud/pubsub/connection.rb +284 -0
- data/lib/gcloud/pubsub/credentials.rb +29 -0
- data/lib/gcloud/pubsub/errors.rb +91 -0
- data/lib/gcloud/pubsub/message.rb +90 -0
- data/lib/gcloud/pubsub/project.rb +408 -0
- data/lib/gcloud/pubsub/received_message.rb +170 -0
- data/lib/gcloud/pubsub/subscription.rb +605 -0
- data/lib/gcloud/pubsub/subscription/list.rb +50 -0
- data/lib/gcloud/pubsub/topic.rb +640 -0
- data/lib/gcloud/pubsub/topic/list.rb +46 -0
- data/lib/gcloud/storage.rb +84 -66
- data/lib/gcloud/storage/bucket.rb +87 -68
- data/lib/gcloud/storage/bucket/acl.rb +140 -105
- data/lib/gcloud/storage/credentials.rb +1 -1
- data/lib/gcloud/storage/errors.rb +8 -0
- data/lib/gcloud/storage/file.rb +138 -78
- data/lib/gcloud/storage/file/acl.rb +98 -80
- data/lib/gcloud/storage/project.rb +42 -32
- data/lib/gcloud/version.rb +1 -1
- metadata +16 -9
- data/CONTRIBUTING.md +0 -93
- data/LICENSE +0 -201
- data/README.md +0 -110
@@ -21,11 +21,12 @@ module Gcloud
|
|
21
21
|
#
|
22
22
|
# Represents a Bucket's Access Control List.
|
23
23
|
#
|
24
|
-
# require "
|
24
|
+
# require "gcloud"
|
25
25
|
#
|
26
|
-
#
|
26
|
+
# gcloud = Gcloud.new
|
27
|
+
# storage = gcloud.storage
|
27
28
|
#
|
28
|
-
# bucket = storage.
|
29
|
+
# bucket = storage.bucket "my-bucket"
|
29
30
|
#
|
30
31
|
# bucket.acl.readers.each { |reader| puts reader }
|
31
32
|
#
|
@@ -61,11 +62,12 @@ module Gcloud
|
|
61
62
|
#
|
62
63
|
# === Example
|
63
64
|
#
|
64
|
-
# require "
|
65
|
+
# require "gcloud"
|
65
66
|
#
|
66
|
-
#
|
67
|
+
# gcloud = Gcloud.new
|
68
|
+
# storage = gcloud.storage
|
67
69
|
#
|
68
|
-
# bucket = storage.
|
70
|
+
# bucket = storage.bucket "my-bucket"
|
69
71
|
#
|
70
72
|
# bucket.acl.refresh!
|
71
73
|
#
|
@@ -86,11 +88,12 @@ module Gcloud
|
|
86
88
|
#
|
87
89
|
# === Example
|
88
90
|
#
|
89
|
-
# require "
|
91
|
+
# require "gcloud"
|
90
92
|
#
|
91
|
-
#
|
93
|
+
# gcloud = Gcloud.new
|
94
|
+
# storage = gcloud.storage
|
92
95
|
#
|
93
|
-
# bucket = storage.
|
96
|
+
# bucket = storage.bucket "my-bucket"
|
94
97
|
#
|
95
98
|
# bucket.acl.owners.each { |owner| puts owner }
|
96
99
|
#
|
@@ -108,11 +111,12 @@ module Gcloud
|
|
108
111
|
#
|
109
112
|
# === Example
|
110
113
|
#
|
111
|
-
# require "
|
114
|
+
# require "gcloud"
|
112
115
|
#
|
113
|
-
#
|
116
|
+
# gcloud = Gcloud.new
|
117
|
+
# storage = gcloud.storage
|
114
118
|
#
|
115
|
-
# bucket = storage.
|
119
|
+
# bucket = storage.bucket "my-bucket"
|
116
120
|
#
|
117
121
|
# bucket.acl.writers.each { |writer| puts writer }
|
118
122
|
#
|
@@ -130,11 +134,12 @@ module Gcloud
|
|
130
134
|
#
|
131
135
|
# === Example
|
132
136
|
#
|
133
|
-
# require "
|
137
|
+
# require "gcloud"
|
134
138
|
#
|
135
|
-
#
|
139
|
+
# gcloud = Gcloud.new
|
140
|
+
# storage = gcloud.storage
|
136
141
|
#
|
137
|
-
# bucket = storage.
|
142
|
+
# bucket = storage.bucket "my-bucket"
|
138
143
|
#
|
139
144
|
# bucket.acl.readers.each { |reader| puts reader }
|
140
145
|
#
|
@@ -166,11 +171,12 @@ module Gcloud
|
|
166
171
|
# Access to a bucket can be granted to a user by appending +"user-"+ to
|
167
172
|
# the email address:
|
168
173
|
#
|
169
|
-
# require "
|
174
|
+
# require "gcloud"
|
170
175
|
#
|
171
|
-
#
|
176
|
+
# gcloud = Gcloud.new
|
177
|
+
# storage = gcloud.storage
|
172
178
|
#
|
173
|
-
# bucket = storage.
|
179
|
+
# bucket = storage.bucket "my-bucket"
|
174
180
|
#
|
175
181
|
# email = "heidi@example.net"
|
176
182
|
# bucket.acl.add_owner "user-#{email}"
|
@@ -178,11 +184,12 @@ module Gcloud
|
|
178
184
|
# Access to a bucket can be granted to a group by appending +"group-"+
|
179
185
|
# to the email address:
|
180
186
|
#
|
181
|
-
# require "
|
187
|
+
# require "gcloud"
|
182
188
|
#
|
183
|
-
#
|
189
|
+
# gcloud = Gcloud.new
|
190
|
+
# storage = gcloud.storage
|
184
191
|
#
|
185
|
-
# bucket = storage.
|
192
|
+
# bucket = storage.bucket "my-bucket"
|
186
193
|
#
|
187
194
|
# email = "authors@example.net"
|
188
195
|
# bucket.acl.add_owner "group-#{email}"
|
@@ -220,11 +227,12 @@ module Gcloud
|
|
220
227
|
# Access to a bucket can be granted to a user by appending +"user-"+ to
|
221
228
|
# the email address:
|
222
229
|
#
|
223
|
-
# require "
|
230
|
+
# require "gcloud"
|
224
231
|
#
|
225
|
-
#
|
232
|
+
# gcloud = Gcloud.new
|
233
|
+
# storage = gcloud.storage
|
226
234
|
#
|
227
|
-
# bucket = storage.
|
235
|
+
# bucket = storage.bucket "my-bucket"
|
228
236
|
#
|
229
237
|
# email = "heidi@example.net"
|
230
238
|
# bucket.acl.add_writer "user-#{email}"
|
@@ -232,11 +240,12 @@ module Gcloud
|
|
232
240
|
# Access to a bucket can be granted to a group by appending +"group-"+
|
233
241
|
# to the email address:
|
234
242
|
#
|
235
|
-
# require "
|
243
|
+
# require "gcloud"
|
236
244
|
#
|
237
|
-
#
|
245
|
+
# gcloud = Gcloud.new
|
246
|
+
# storage = gcloud.storage
|
238
247
|
#
|
239
|
-
# bucket = storage.
|
248
|
+
# bucket = storage.bucket "my-bucket"
|
240
249
|
#
|
241
250
|
# email = "authors@example.net"
|
242
251
|
# bucket.acl.add_writer "group-#{email}"
|
@@ -274,11 +283,12 @@ module Gcloud
|
|
274
283
|
# Access to a bucket can be granted to a user by appending +"user-"+ to
|
275
284
|
# the email address:
|
276
285
|
#
|
277
|
-
# require "
|
286
|
+
# require "gcloud"
|
278
287
|
#
|
279
|
-
#
|
288
|
+
# gcloud = Gcloud.new
|
289
|
+
# storage = gcloud.storage
|
280
290
|
#
|
281
|
-
# bucket = storage.
|
291
|
+
# bucket = storage.bucket "my-bucket"
|
282
292
|
#
|
283
293
|
# email = "heidi@example.net"
|
284
294
|
# bucket.acl.add_reader "user-#{email}"
|
@@ -286,11 +296,12 @@ module Gcloud
|
|
286
296
|
# Access to a bucket can be granted to a group by appending +"group-"+
|
287
297
|
# to the email address:
|
288
298
|
#
|
289
|
-
# require "
|
299
|
+
# require "gcloud"
|
290
300
|
#
|
291
|
-
#
|
301
|
+
# gcloud = Gcloud.new
|
302
|
+
# storage = gcloud.storage
|
292
303
|
#
|
293
|
-
# bucket = storage.
|
304
|
+
# bucket = storage.bucket "my-bucket"
|
294
305
|
#
|
295
306
|
# email = "authors@example.net"
|
296
307
|
# bucket.acl.add_reader "group-#{email}"
|
@@ -325,11 +336,12 @@ module Gcloud
|
|
325
336
|
#
|
326
337
|
# === Example
|
327
338
|
#
|
328
|
-
# require "
|
339
|
+
# require "gcloud"
|
329
340
|
#
|
330
|
-
#
|
341
|
+
# gcloud = Gcloud.new
|
342
|
+
# storage = gcloud.storage
|
331
343
|
#
|
332
|
-
# bucket = storage.
|
344
|
+
# bucket = storage.bucket "my-bucket"
|
333
345
|
#
|
334
346
|
# email = "heidi@example.net"
|
335
347
|
# bucket.acl.delete "user-#{email}"
|
@@ -357,11 +369,12 @@ module Gcloud
|
|
357
369
|
#
|
358
370
|
# === Example
|
359
371
|
#
|
360
|
-
# require "
|
372
|
+
# require "gcloud"
|
361
373
|
#
|
362
|
-
#
|
374
|
+
# gcloud = Gcloud.new
|
375
|
+
# storage = gcloud.storage
|
363
376
|
#
|
364
|
-
# bucket = storage.
|
377
|
+
# bucket = storage.bucket "my-bucket"
|
365
378
|
#
|
366
379
|
# bucket.acl.auth!
|
367
380
|
#
|
@@ -379,11 +392,12 @@ module Gcloud
|
|
379
392
|
#
|
380
393
|
# === Example
|
381
394
|
#
|
382
|
-
# require "
|
395
|
+
# require "gcloud"
|
383
396
|
#
|
384
|
-
#
|
397
|
+
# gcloud = Gcloud.new
|
398
|
+
# storage = gcloud.storage
|
385
399
|
#
|
386
|
-
# bucket = storage.
|
400
|
+
# bucket = storage.bucket "my-bucket"
|
387
401
|
#
|
388
402
|
# bucket.acl.private!
|
389
403
|
#
|
@@ -397,11 +411,12 @@ module Gcloud
|
|
397
411
|
#
|
398
412
|
# === Example
|
399
413
|
#
|
400
|
-
# require "
|
414
|
+
# require "gcloud"
|
401
415
|
#
|
402
|
-
#
|
416
|
+
# gcloud = Gcloud.new
|
417
|
+
# storage = gcloud.storage
|
403
418
|
#
|
404
|
-
# bucket = storage.
|
419
|
+
# bucket = storage.bucket "my-bucket"
|
405
420
|
#
|
406
421
|
# bucket.acl.project_private!
|
407
422
|
#
|
@@ -416,11 +431,12 @@ module Gcloud
|
|
416
431
|
#
|
417
432
|
# === Example
|
418
433
|
#
|
419
|
-
# require "
|
434
|
+
# require "gcloud"
|
420
435
|
#
|
421
|
-
#
|
436
|
+
# gcloud = Gcloud.new
|
437
|
+
# storage = gcloud.storage
|
422
438
|
#
|
423
|
-
# bucket = storage.
|
439
|
+
# bucket = storage.bucket "my-bucket"
|
424
440
|
#
|
425
441
|
# bucket.acl.public!
|
426
442
|
#
|
@@ -435,11 +451,12 @@ module Gcloud
|
|
435
451
|
#
|
436
452
|
# === Example
|
437
453
|
#
|
438
|
-
# require "
|
454
|
+
# require "gcloud"
|
439
455
|
#
|
440
|
-
#
|
456
|
+
# gcloud = Gcloud.new
|
457
|
+
# storage = gcloud.storage
|
441
458
|
#
|
442
|
-
# bucket = storage.
|
459
|
+
# bucket = storage.bucket "my-bucket"
|
443
460
|
#
|
444
461
|
# bucket.acl.public_write!
|
445
462
|
#
|
@@ -469,11 +486,12 @@ module Gcloud
|
|
469
486
|
#
|
470
487
|
# Represents a Bucket's Default Access Control List.
|
471
488
|
#
|
472
|
-
# require "
|
489
|
+
# require "gcloud"
|
473
490
|
#
|
474
|
-
#
|
491
|
+
# gcloud = Gcloud.new
|
492
|
+
# storage = gcloud.storage
|
475
493
|
#
|
476
|
-
# bucket = storage.
|
494
|
+
# bucket = storage.bucket "my-bucket"
|
477
495
|
#
|
478
496
|
# bucket.default_acl.readers.each { |reader| puts reader }
|
479
497
|
#
|
@@ -510,11 +528,12 @@ module Gcloud
|
|
510
528
|
#
|
511
529
|
# === Example
|
512
530
|
#
|
513
|
-
# require "
|
531
|
+
# require "gcloud"
|
514
532
|
#
|
515
|
-
#
|
533
|
+
# gcloud = Gcloud.new
|
534
|
+
# storage = gcloud.storage
|
516
535
|
#
|
517
|
-
# bucket = storage.
|
536
|
+
# bucket = storage.bucket "my-bucket"
|
518
537
|
#
|
519
538
|
# bucket.default_acl.refresh!
|
520
539
|
#
|
@@ -535,11 +554,12 @@ module Gcloud
|
|
535
554
|
#
|
536
555
|
# === Example
|
537
556
|
#
|
538
|
-
# require "
|
557
|
+
# require "gcloud"
|
539
558
|
#
|
540
|
-
#
|
559
|
+
# gcloud = Gcloud.new
|
560
|
+
# storage = gcloud.storage
|
541
561
|
#
|
542
|
-
# bucket = storage.
|
562
|
+
# bucket = storage.bucket "my-bucket"
|
543
563
|
#
|
544
564
|
# bucket.default_acl.owners.each { |owner| puts owner }
|
545
565
|
#
|
@@ -557,11 +577,12 @@ module Gcloud
|
|
557
577
|
#
|
558
578
|
# === Example
|
559
579
|
#
|
560
|
-
# require "
|
580
|
+
# require "gcloud"
|
561
581
|
#
|
562
|
-
#
|
582
|
+
# gcloud = Gcloud.new
|
583
|
+
# storage = gcloud.storage
|
563
584
|
#
|
564
|
-
# bucket = storage.
|
585
|
+
# bucket = storage.bucket "my-bucket"
|
565
586
|
#
|
566
587
|
# bucket.default_acl.writers.each { |writer| puts writer }
|
567
588
|
#
|
@@ -579,11 +600,12 @@ module Gcloud
|
|
579
600
|
#
|
580
601
|
# === Example
|
581
602
|
#
|
582
|
-
# require "
|
603
|
+
# require "gcloud"
|
583
604
|
#
|
584
|
-
#
|
605
|
+
# gcloud = Gcloud.new
|
606
|
+
# storage = gcloud.storage
|
585
607
|
#
|
586
|
-
# bucket = storage.
|
608
|
+
# bucket = storage.bucket "my-bucket"
|
587
609
|
#
|
588
610
|
# bucket.default_acl.readers.each { |reader| puts reader }
|
589
611
|
#
|
@@ -615,11 +637,12 @@ module Gcloud
|
|
615
637
|
# Access to a bucket can be granted to a user by appending +"user-"+ to
|
616
638
|
# the email address:
|
617
639
|
#
|
618
|
-
# require "
|
640
|
+
# require "gcloud"
|
619
641
|
#
|
620
|
-
#
|
642
|
+
# gcloud = Gcloud.new
|
643
|
+
# storage = gcloud.storage
|
621
644
|
#
|
622
|
-
# bucket = storage.
|
645
|
+
# bucket = storage.bucket "my-bucket"
|
623
646
|
#
|
624
647
|
# email = "heidi@example.net"
|
625
648
|
# bucket.default_acl.add_owner "user-#{email}"
|
@@ -627,11 +650,12 @@ module Gcloud
|
|
627
650
|
# Access to a bucket can be granted to a group by appending +"group-"+
|
628
651
|
# to the email address:
|
629
652
|
#
|
630
|
-
# require "
|
653
|
+
# require "gcloud"
|
631
654
|
#
|
632
|
-
#
|
655
|
+
# gcloud = Gcloud.new
|
656
|
+
# storage = gcloud.storage
|
633
657
|
#
|
634
|
-
# bucket = storage.
|
658
|
+
# bucket = storage.bucket "my-bucket"
|
635
659
|
#
|
636
660
|
# email = "authors@example.net"
|
637
661
|
# bucket.default_acl.add_owner "group-#{email}"
|
@@ -669,11 +693,12 @@ module Gcloud
|
|
669
693
|
# Access to a bucket can be granted to a user by appending +"user-"+ to
|
670
694
|
# the email address:
|
671
695
|
#
|
672
|
-
# require "
|
696
|
+
# require "gcloud"
|
673
697
|
#
|
674
|
-
#
|
698
|
+
# gcloud = Gcloud.new
|
699
|
+
# storage = gcloud.storage
|
675
700
|
#
|
676
|
-
# bucket = storage.
|
701
|
+
# bucket = storage.bucket "my-bucket"
|
677
702
|
#
|
678
703
|
# email = "heidi@example.net"
|
679
704
|
# bucket.default_acl.add_writer "user-#{email}"
|
@@ -681,11 +706,12 @@ module Gcloud
|
|
681
706
|
# Access to a bucket can be granted to a group by appending +"group-"+
|
682
707
|
# to the email address:
|
683
708
|
#
|
684
|
-
# require "
|
709
|
+
# require "gcloud"
|
685
710
|
#
|
686
|
-
#
|
711
|
+
# gcloud = Gcloud.new
|
712
|
+
# storage = gcloud.storage
|
687
713
|
#
|
688
|
-
# bucket = storage.
|
714
|
+
# bucket = storage.bucket "my-bucket"
|
689
715
|
#
|
690
716
|
# email = "authors@example.net"
|
691
717
|
# bucket.default_acl.add_writer "group-#{email}"
|
@@ -723,11 +749,12 @@ module Gcloud
|
|
723
749
|
# Access to a bucket can be granted to a user by appending +"user-"+ to
|
724
750
|
# the email address:
|
725
751
|
#
|
726
|
-
# require "
|
752
|
+
# require "gcloud"
|
727
753
|
#
|
728
|
-
#
|
754
|
+
# gcloud = Gcloud.new
|
755
|
+
# storage = gcloud.storage
|
729
756
|
#
|
730
|
-
# bucket = storage.
|
757
|
+
# bucket = storage.bucket "my-bucket"
|
731
758
|
#
|
732
759
|
# email = "heidi@example.net"
|
733
760
|
# bucket.default_acl.add_reader "user-#{email}"
|
@@ -735,11 +762,12 @@ module Gcloud
|
|
735
762
|
# Access to a bucket can be granted to a group by appending +"group-"+
|
736
763
|
# to the email address:
|
737
764
|
#
|
738
|
-
# require "
|
765
|
+
# require "gcloud"
|
739
766
|
#
|
740
|
-
#
|
767
|
+
# gcloud = Gcloud.new
|
768
|
+
# storage = gcloud.storage
|
741
769
|
#
|
742
|
-
# bucket = storage.
|
770
|
+
# bucket = storage.bucket "my-bucket"
|
743
771
|
#
|
744
772
|
# email = "authors@example.net"
|
745
773
|
# bucket.default_acl.add_reader "group-#{email}"
|
@@ -775,11 +803,12 @@ module Gcloud
|
|
775
803
|
#
|
776
804
|
# === Example
|
777
805
|
#
|
778
|
-
# require "
|
806
|
+
# require "gcloud"
|
779
807
|
#
|
780
|
-
#
|
808
|
+
# gcloud = Gcloud.new
|
809
|
+
# storage = gcloud.storage
|
781
810
|
#
|
782
|
-
# bucket = storage.
|
811
|
+
# bucket = storage.bucket "my-bucket"
|
783
812
|
#
|
784
813
|
# email = "heidi@example.net"
|
785
814
|
# bucket.default_acl.delete "user-#{email}"
|
@@ -807,11 +836,12 @@ module Gcloud
|
|
807
836
|
#
|
808
837
|
# === Example
|
809
838
|
#
|
810
|
-
# require "
|
839
|
+
# require "gcloud"
|
811
840
|
#
|
812
|
-
#
|
841
|
+
# gcloud = Gcloud.new
|
842
|
+
# storage = gcloud.storage
|
813
843
|
#
|
814
|
-
# bucket = storage.
|
844
|
+
# bucket = storage.bucket "my-bucket"
|
815
845
|
#
|
816
846
|
# bucket.acl.auth!
|
817
847
|
#
|
@@ -829,11 +859,12 @@ module Gcloud
|
|
829
859
|
#
|
830
860
|
# === Example
|
831
861
|
#
|
832
|
-
# require "
|
862
|
+
# require "gcloud"
|
833
863
|
#
|
834
|
-
#
|
864
|
+
# gcloud = Gcloud.new
|
865
|
+
# storage = gcloud.storage
|
835
866
|
#
|
836
|
-
# bucket = storage.
|
867
|
+
# bucket = storage.bucket "my-bucket"
|
837
868
|
#
|
838
869
|
# bucket.acl.owner_full!
|
839
870
|
#
|
@@ -848,11 +879,12 @@ module Gcloud
|
|
848
879
|
#
|
849
880
|
# === Example
|
850
881
|
#
|
851
|
-
# require "
|
882
|
+
# require "gcloud"
|
852
883
|
#
|
853
|
-
#
|
884
|
+
# gcloud = Gcloud.new
|
885
|
+
# storage = gcloud.storage
|
854
886
|
#
|
855
|
-
# bucket = storage.
|
887
|
+
# bucket = storage.bucket "my-bucket"
|
856
888
|
#
|
857
889
|
# bucket.acl.owner_read!
|
858
890
|
#
|
@@ -867,11 +899,12 @@ module Gcloud
|
|
867
899
|
#
|
868
900
|
# === Example
|
869
901
|
#
|
870
|
-
# require "
|
902
|
+
# require "gcloud"
|
871
903
|
#
|
872
|
-
#
|
904
|
+
# gcloud = Gcloud.new
|
905
|
+
# storage = gcloud.storage
|
873
906
|
#
|
874
|
-
# bucket = storage.
|
907
|
+
# bucket = storage.bucket "my-bucket"
|
875
908
|
#
|
876
909
|
# bucket.acl.private!
|
877
910
|
#
|
@@ -885,11 +918,12 @@ module Gcloud
|
|
885
918
|
#
|
886
919
|
# === Example
|
887
920
|
#
|
888
|
-
# require "
|
921
|
+
# require "gcloud"
|
889
922
|
#
|
890
|
-
#
|
923
|
+
# gcloud = Gcloud.new
|
924
|
+
# storage = gcloud.storage
|
891
925
|
#
|
892
|
-
# bucket = storage.
|
926
|
+
# bucket = storage.bucket "my-bucket"
|
893
927
|
#
|
894
928
|
# bucket.acl.project_private!
|
895
929
|
#
|
@@ -904,11 +938,12 @@ module Gcloud
|
|
904
938
|
#
|
905
939
|
# === Example
|
906
940
|
#
|
907
|
-
# require "
|
941
|
+
# require "gcloud"
|
908
942
|
#
|
909
|
-
#
|
943
|
+
# gcloud = Gcloud.new
|
944
|
+
# storage = gcloud.storage
|
910
945
|
#
|
911
|
-
# bucket = storage.
|
946
|
+
# bucket = storage.bucket "my-bucket"
|
912
947
|
#
|
913
948
|
# bucket.acl.public!
|
914
949
|
#
|