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
data/README.md
DELETED
@@ -1,110 +0,0 @@
|
|
1
|
-
# gcloud
|
2
|
-
|
3
|
-
Idiomatic Ruby client for [Google Cloud Platform](https://cloud.google.com/) services.
|
4
|
-
|
5
|
-
[![Travis Build Status](https://travis-ci.org/GoogleCloudPlatform/gcloud-ruby.svg)](https://travis-ci.org/GoogleCloudPlatform/gcloud-ruby/)
|
6
|
-
[![Coverage Status](https://img.shields.io/coveralls/GoogleCloudPlatform/gcloud-ruby.svg)](https://coveralls.io/r/GoogleCloudPlatform/gcloud-ruby?branch=master)
|
7
|
-
[![Gem Version](https://badge.fury.io/rb/gcloud.svg)](http://badge.fury.io/rb/gcloud)
|
8
|
-
|
9
|
-
* [Homepage](http://googlecloudplatform.github.io/gcloud-ruby/)
|
10
|
-
* [API Documentation](http://googlecloudplatform.github.io/gcloud-ruby/docs/master/)
|
11
|
-
|
12
|
-
## Ruby API Client library for Google Cloud
|
13
|
-
|
14
|
-
This client supports the following Google Cloud Platform services:
|
15
|
-
|
16
|
-
* [Google Cloud Datastore](https://cloud.google.com/datastore/) ([docs](https://cloud.google.com/datastore/docs))
|
17
|
-
* [Google Cloud Storage](https://cloud.google.com/storage/) ([docs](https://cloud.google.com/storage/docs/json_api/))
|
18
|
-
|
19
|
-
If you need support for other Google APIs, check out the [Google API Ruby Client library](https://github.com/google/google-api-ruby-client).
|
20
|
-
|
21
|
-
## Quick Start
|
22
|
-
|
23
|
-
```sh
|
24
|
-
$ gem install gcloud
|
25
|
-
```
|
26
|
-
|
27
|
-
### Authentication
|
28
|
-
|
29
|
-
Gcloud uses Service Account credentials to connect to Google Cloud services. When running on Compute Engine the credentials will be discovered automatically. When running on other environments the Service Account credentials can be specified by providing the path to the JSON file, or the JSON itself, in environment variables. Additionally, Cloud SDK credentials can also be discovered automatically, but this is only recommended during development.
|
30
|
-
|
31
|
-
Instructions and configuration options are covered in the [Authentication guide](AUTHENTICATION.md). The examples in Quick Start will demonstrate providing the **Project ID** and **Credentials JSON file path** in code.
|
32
|
-
|
33
|
-
### Datastore
|
34
|
-
|
35
|
-
[Google Cloud Datastore](https://cloud.google.com/datastore/) ([docs](https://cloud.google.com/datastore/docs)) is a fully managed, schemaless database for storing non-relational data. Cloud Datastore automatically scales with your users and supports ACID transactions, high availability of reads and writes, strong consistency for reads and ancestor queries, and eventual consistency for all other queries.
|
36
|
-
|
37
|
-
Follow the [activation instructions](https://cloud.google.com/datastore/docs/activate) to use the Google Cloud Datastore API with your project.
|
38
|
-
|
39
|
-
See the [gcloud-ruby Datastore API documentation](http://googlecloudplatform.github.io/gcloud-ruby/docs/master/Gcloud/Storage.html) to learn how to interact with the Cloud Datastore using this library.
|
40
|
-
|
41
|
-
```ruby
|
42
|
-
require 'gcloud/datastore'
|
43
|
-
|
44
|
-
dataset = Gcloud.datastore "my-todo-project-id",
|
45
|
-
"/path/to/keyfile.json"
|
46
|
-
|
47
|
-
# Create a new task to demo datastore
|
48
|
-
demo_task = Gcloud::Datastore::Entity.new
|
49
|
-
demo_task.key = Gcloud::Datastore::Key.new "Task", "datastore-demo"
|
50
|
-
demo_task[:description] = "Demonstrate Datastore functionality"
|
51
|
-
demo_task[:completed] = false
|
52
|
-
|
53
|
-
# Save the new task
|
54
|
-
dataset.save demo_task
|
55
|
-
|
56
|
-
# Run a query for all completed tasks
|
57
|
-
query = Gcloud::Datastore::Query.new.kind("Task").
|
58
|
-
where("completed", "=", true)
|
59
|
-
completed_tasks = dataset.run query
|
60
|
-
```
|
61
|
-
|
62
|
-
### Storage
|
63
|
-
|
64
|
-
[Google Cloud Storage](https://cloud.google.com/storage/) ([docs](https://cloud.google.com/storage/docs/json_api/)) allows you to store data on Google infrastructure with very high reliability, performance and availability, and can be used to distribute large data objects to users via direct download.
|
65
|
-
|
66
|
-
See the [gcloud-ruby Storage API documentation](http://googlecloudplatform.github.io/gcloud-ruby/docs/master/Gcloud/Storage.html) to learn how to connect to Cloud Storage using this library.
|
67
|
-
|
68
|
-
```ruby
|
69
|
-
require 'gcloud/storage'
|
70
|
-
|
71
|
-
storage = Gcloud.storage "my-todo-project-id",
|
72
|
-
"/path/to/keyfile.json"
|
73
|
-
|
74
|
-
bucket = storage.find_bucket "task-attachments"
|
75
|
-
|
76
|
-
file = bucket.find_file "path/to/my-file.ext"
|
77
|
-
|
78
|
-
# Download the file to the local file system
|
79
|
-
file.download "/tasks/attachments/#{file.name}"
|
80
|
-
|
81
|
-
# Copy the file to a backup bucket
|
82
|
-
backup = storage.find_bucket "task-attachment-backups"
|
83
|
-
file.copy backup, file.name
|
84
|
-
```
|
85
|
-
|
86
|
-
## Supported Ruby Versions
|
87
|
-
|
88
|
-
gcloud is supported on Ruby 1.9.3+.
|
89
|
-
|
90
|
-
## Versioning
|
91
|
-
|
92
|
-
This library follows [Semantic Versioning](http://semver.org/).
|
93
|
-
|
94
|
-
It is currently in major version zero (0.y.z), which means that anything may change at any time and the public API should not be considered stable.
|
95
|
-
|
96
|
-
## Contributing
|
97
|
-
|
98
|
-
Contributions to this library are always welcome and highly encouraged.
|
99
|
-
|
100
|
-
See [CONTRIBUTING](CONTRIBUTING.md) for more information on how to get started.
|
101
|
-
|
102
|
-
## License
|
103
|
-
|
104
|
-
This library is licensed under Apache 2.0. Full license text is
|
105
|
-
available in [LICENSE](LICENSE).
|
106
|
-
|
107
|
-
## Support
|
108
|
-
|
109
|
-
Please [report bugs at the project on Github](https://github.com/GoogleCloudPlatform/gcloud-ruby/issues).
|
110
|
-
Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/gcloud-ruby) about the client or APIs on [StackOverflow](http://stackoverflow.com).
|