google-cloud-bigtable 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +178 -0
- data/CHANGELOG.md +13 -0
- data/CODE_OF_CONDUCT.md +40 -0
- data/CONTRIBUTING.md +188 -0
- data/LOGGING.md +32 -0
- data/OVERVIEW.md +28 -0
- data/TROUBLESHOOTING.md +37 -0
- data/lib/google/cloud/bigtable/version.rb +1 -1
- metadata +9 -3
- data/README.md +0 -65
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b030221811d66b0dbafdcfc6f545bce225c97313a17d4fb2f9f09d65d75e11dc
|
4
|
+
data.tar.gz: e110bf447f449adbab5b2cac1a6c37f56c30e982e247c88980ded3f2e0b163c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05a1bb9df1bedc157de97441cd2f30266fa3a602dcc741a3391517e39a9983328a3aaba4bcc85f95fa02148c258c7f810e19cfb247c20684ef3680774e523af7
|
7
|
+
data.tar.gz: 06c0fbecc8faeb9ef3be4d7f87aa2f8a99eb3b2f56640c4b3596071df9568df32672e61a3d3ffb364922dd7d3eca35abcab035ff0de5c6fe0d32aeceb53fca0c
|
data/AUTHENTICATION.md
ADDED
@@ -0,0 +1,178 @@
|
|
1
|
+
# Authentication
|
2
|
+
|
3
|
+
In general, the google-cloud-bigtable library uses [Service
|
4
|
+
Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts)
|
5
|
+
credentials to connect to Google Cloud services. When running on Compute Engine
|
6
|
+
the credentials will be discovered automatically. When running on other
|
7
|
+
environments, the Service Account credentials can be specified by providing the
|
8
|
+
path to the [JSON
|
9
|
+
keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) for
|
10
|
+
the account (or the JSON itself) in environment variables. Additionally, Cloud
|
11
|
+
SDK credentials can also be discovered automatically, but this is only
|
12
|
+
recommended during development.
|
13
|
+
|
14
|
+
## Project and Credential Lookup
|
15
|
+
|
16
|
+
The google-cloud-bigtable library aims to make authentication as simple as
|
17
|
+
possible, and provides several mechanisms to configure your system without
|
18
|
+
providing **Project ID** and **Service Account Credentials** directly in code.
|
19
|
+
|
20
|
+
**Project ID** is discovered in the following order:
|
21
|
+
|
22
|
+
1. Specify project ID in method arguments
|
23
|
+
2. Specify project ID in configuration
|
24
|
+
3. Discover project ID in environment variables
|
25
|
+
4. Discover GCE project ID
|
26
|
+
|
27
|
+
**Credentials** are discovered in the following order:
|
28
|
+
|
29
|
+
1. Specify credentials in method arguments
|
30
|
+
2. Specify credentials in configuration
|
31
|
+
3. Discover credentials path in environment variables
|
32
|
+
4. Discover credentials JSON in environment variables
|
33
|
+
5. Discover credentials file in the Cloud SDK's path
|
34
|
+
6. Discover GCE credentials
|
35
|
+
|
36
|
+
### Google Cloud Platform environments
|
37
|
+
|
38
|
+
While running on Google Cloud Platform environments such as Google Compute
|
39
|
+
Engine, Google App Engine and Google Kubernetes Engine, no extra work is needed.
|
40
|
+
The **Project ID** and **Credentials** and are discovered automatically. Code
|
41
|
+
should be written as if already authenticated. Just be sure when you [set up the
|
42
|
+
GCE instance][gce-how-to], you add the correct scopes for the APIs you want to
|
43
|
+
access. For example:
|
44
|
+
|
45
|
+
* **All APIs**
|
46
|
+
* `https://www.googleapis.com/auth/cloud-platform`
|
47
|
+
* `https://www.googleapis.com/auth/cloud-platform.read-only`
|
48
|
+
* **BigQuery**
|
49
|
+
* `https://www.googleapis.com/auth/bigquery`
|
50
|
+
* `https://www.googleapis.com/auth/bigquery.insertdata`
|
51
|
+
* **Compute Engine**
|
52
|
+
* `https://www.googleapis.com/auth/compute`
|
53
|
+
* **Datastore**
|
54
|
+
* `https://www.googleapis.com/auth/datastore`
|
55
|
+
* `https://www.googleapis.com/auth/userinfo.email`
|
56
|
+
* **DNS**
|
57
|
+
* `https://www.googleapis.com/auth/ndev.clouddns.readwrite`
|
58
|
+
* **Pub/Sub**
|
59
|
+
* `https://www.googleapis.com/auth/pubsub`
|
60
|
+
* **Storage**
|
61
|
+
* `https://www.googleapis.com/auth/devstorage.full_control`
|
62
|
+
* `https://www.googleapis.com/auth/devstorage.read_only`
|
63
|
+
* `https://www.googleapis.com/auth/devstorage.read_write`
|
64
|
+
|
65
|
+
### Environment Variables
|
66
|
+
|
67
|
+
The **Project ID** and **Credentials JSON** can be placed in environment
|
68
|
+
variables instead of declaring them directly in code. Each service has its own
|
69
|
+
environment variable, allowing for different service accounts to be used for
|
70
|
+
different services. (See the READMEs for the individual service gems for
|
71
|
+
details.) The path to the **Credentials JSON** file can be stored in the
|
72
|
+
environment variable, or the **Credentials JSON** itself can be stored for
|
73
|
+
environments such as Docker containers where writing files is difficult or not
|
74
|
+
encouraged.
|
75
|
+
|
76
|
+
The environment variables that Bigtable checks for project ID are:
|
77
|
+
|
78
|
+
1. `BIGTABLE_PROJECT`
|
79
|
+
2. `GOOGLE_CLOUD_PROJECT`
|
80
|
+
|
81
|
+
The environment variables that Bigtable checks for credentials are configured on {Google::Cloud::Bigtable::V2::Credentials}:
|
82
|
+
|
83
|
+
1. `BIGTABLE_CREDENTIALS` - Path to JSON file, or JSON contents
|
84
|
+
2. `BIGTABLE_KEYFILE` - Path to JSON file, or JSON contents
|
85
|
+
3. `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
|
86
|
+
4. `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
|
87
|
+
5. `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
|
88
|
+
|
89
|
+
```ruby
|
90
|
+
require "google/cloud/bigtable"
|
91
|
+
|
92
|
+
ENV["BIGTABLE_PROJECT"] = "my-project-id"
|
93
|
+
ENV["BIGTABLE_CREDENTIALS"] = "path/to/keyfile.json"
|
94
|
+
|
95
|
+
bigtable = Google::Cloud::Bigtable.new
|
96
|
+
```
|
97
|
+
|
98
|
+
### Configuration
|
99
|
+
|
100
|
+
The **Project ID** and **Credentials JSON** can be configured instead of placing them in environment variables or providing them as arguments.
|
101
|
+
|
102
|
+
```ruby
|
103
|
+
require "google/cloud/bigtable"
|
104
|
+
|
105
|
+
Google::Cloud::Bigtable.configure do |config|
|
106
|
+
config.project_id = "my-project-id"
|
107
|
+
config.credentials = "path/to/keyfile.json"
|
108
|
+
end
|
109
|
+
|
110
|
+
bigtable = Google::Cloud::Bigtable.new
|
111
|
+
```
|
112
|
+
|
113
|
+
### Cloud SDK
|
114
|
+
|
115
|
+
This option allows for an easy way to authenticate during development. If
|
116
|
+
credentials are not provided in code or in environment variables, then Cloud SDK
|
117
|
+
credentials are discovered.
|
118
|
+
|
119
|
+
To configure your system for this, simply:
|
120
|
+
|
121
|
+
1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
|
122
|
+
2. Authenticate using OAuth 2.0 `$ gcloud auth login`
|
123
|
+
3. Write code as if already authenticated.
|
124
|
+
|
125
|
+
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
126
|
+
*should* only be used during development.
|
127
|
+
|
128
|
+
[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
|
129
|
+
[dev-console]: https://console.cloud.google.com/project
|
130
|
+
|
131
|
+
[enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
|
132
|
+
|
133
|
+
[create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
|
134
|
+
[create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
|
135
|
+
[reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
|
136
|
+
|
137
|
+
## Creating a Service Account
|
138
|
+
|
139
|
+
Google Cloud requires a **Project ID** and **Service Account Credentials** to
|
140
|
+
connect to the APIs. You will use the **Project ID** and **JSON key file** to
|
141
|
+
connect to most services with google-cloud-bigtable.
|
142
|
+
|
143
|
+
If you are not running this client on Google Compute Engine, you need a Google
|
144
|
+
Developers service account.
|
145
|
+
|
146
|
+
1. Visit the [Google Developers Console][dev-console].
|
147
|
+
1. Create a new project or click on an existing project.
|
148
|
+
1. Activate the slide-out navigation tray and select **API Manager**. From
|
149
|
+
here, you will enable the APIs that your application requires.
|
150
|
+
|
151
|
+
![Enable the APIs that your application requires][enable-apis]
|
152
|
+
|
153
|
+
*Note: You may need to enable billing in order to use these services.*
|
154
|
+
|
155
|
+
1. Select **Credentials** from the side navigation.
|
156
|
+
|
157
|
+
You should see a screen like one of the following.
|
158
|
+
|
159
|
+
![Create a new service account][create-new-service-account]
|
160
|
+
|
161
|
+
![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
|
162
|
+
|
163
|
+
Find the "Add credentials" drop down and select "Service account" to be
|
164
|
+
guided through downloading a new JSON key file.
|
165
|
+
|
166
|
+
If you want to re-use an existing service account, you can easily generate a
|
167
|
+
new key file. Just select the account you wish to re-use, and click "Generate
|
168
|
+
new JSON key":
|
169
|
+
|
170
|
+
![Re-use an existing service account][reuse-service-account]
|
171
|
+
|
172
|
+
The key file you download will be used by this library to authenticate API
|
173
|
+
requests and should be stored in a secure location.
|
174
|
+
|
175
|
+
## Troubleshooting
|
176
|
+
|
177
|
+
If you're having trouble authenticating you can ask for help by following the
|
178
|
+
{file:TROUBLESHOOTING.md Troubleshooting Guide}.
|
data/CHANGELOG.md
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct.
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or reject
|
24
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
25
|
+
not aligned to this Code of Conduct. By adopting this Code of Conduct, project
|
26
|
+
maintainers commit themselves to fairly and consistently applying these
|
27
|
+
principles to every aspect of managing this project. Project maintainers who do
|
28
|
+
not follow or enforce the Code of Conduct may be permanently removed from the
|
29
|
+
project team.
|
30
|
+
|
31
|
+
This code of conduct applies both within project spaces and in public spaces
|
32
|
+
when an individual is representing the project or its community.
|
33
|
+
|
34
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
35
|
+
reported by opening an issue or contacting one or more of the project
|
36
|
+
maintainers.
|
37
|
+
|
38
|
+
This Code of Conduct is adapted from the [Contributor
|
39
|
+
Covenant](http://contributor-covenant.org), version 1.2.0, available at
|
40
|
+
[http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,188 @@
|
|
1
|
+
# Contributing to Google Cloud Bigtable
|
2
|
+
|
3
|
+
1. **Sign one of the contributor license agreements below.**
|
4
|
+
2. Fork the repo, develop and test your code changes.
|
5
|
+
3. Send a pull request.
|
6
|
+
|
7
|
+
## Contributor License Agreements
|
8
|
+
|
9
|
+
Before we can accept your pull requests you'll need to sign a Contributor
|
10
|
+
License Agreement (CLA):
|
11
|
+
|
12
|
+
- **If you are an individual writing original source code** and **you own the
|
13
|
+
intellectual property**, then you'll need to sign an [individual
|
14
|
+
CLA](https://developers.google.com/open-source/cla/individual).
|
15
|
+
- **If you work for a company that wants to allow you to contribute your work**,
|
16
|
+
then you'll need to sign a [corporate
|
17
|
+
CLA](https://developers.google.com/open-source/cla/corporate).
|
18
|
+
|
19
|
+
You can sign these electronically (just scroll to the bottom). After that, we'll
|
20
|
+
be able to accept your pull requests.
|
21
|
+
|
22
|
+
## Setup
|
23
|
+
|
24
|
+
In order to use the google-cloud-bigtable console and run the project's tests,
|
25
|
+
there is a small amount of setup:
|
26
|
+
|
27
|
+
1. Install Ruby. google-cloud-bigtable requires Ruby 2.3+. You may choose to
|
28
|
+
manage your Ruby and gem installations with [RVM](https://rvm.io/),
|
29
|
+
[rbenv](https://github.com/rbenv/rbenv), or
|
30
|
+
[chruby](https://github.com/postmodern/chruby).
|
31
|
+
|
32
|
+
2. Install [Bundler](http://bundler.io/).
|
33
|
+
|
34
|
+
```sh
|
35
|
+
$ gem install bundler
|
36
|
+
```
|
37
|
+
|
38
|
+
3. Install the top-level project dependencies.
|
39
|
+
|
40
|
+
```sh
|
41
|
+
$ bundle install
|
42
|
+
```
|
43
|
+
|
44
|
+
4. Install the Bigtable dependencies.
|
45
|
+
|
46
|
+
```sh
|
47
|
+
$ cd google-cloud-bigtable/
|
48
|
+
$ bundle exec rake bundleupdate
|
49
|
+
```
|
50
|
+
|
51
|
+
## Console
|
52
|
+
|
53
|
+
In order to run code interactively, you can automatically load
|
54
|
+
google-cloud-bigtable and its dependencies in IRB. This requires that your
|
55
|
+
developer environment has already been configured by following the steps
|
56
|
+
described in the {file:AUTHENTICATION.md Authentication Guide}. An IRB console
|
57
|
+
can be created with:
|
58
|
+
|
59
|
+
```sh
|
60
|
+
$ cd google-cloud-bigtable/
|
61
|
+
$ bundle exec rake console
|
62
|
+
```
|
63
|
+
|
64
|
+
## Bigtable Tests
|
65
|
+
|
66
|
+
Tests are very important part of google-cloud-bigtable. All contributions
|
67
|
+
should include tests that ensure the contributed code behaves as expected.
|
68
|
+
|
69
|
+
To run the unit tests, documentation tests, and code style checks together for a
|
70
|
+
package:
|
71
|
+
|
72
|
+
``` sh
|
73
|
+
$ cd google-cloud-bigtable/
|
74
|
+
$ bundle exec rake ci
|
75
|
+
```
|
76
|
+
|
77
|
+
To run the command above, plus all acceptance tests, use `rake ci:acceptance` or
|
78
|
+
its handy alias, `rake ci:a`.
|
79
|
+
|
80
|
+
### Bigtable Unit Tests
|
81
|
+
|
82
|
+
|
83
|
+
The project uses the [minitest](https://github.com/seattlerb/minitest) library,
|
84
|
+
including [specs](https://github.com/seattlerb/minitest#specs),
|
85
|
+
[mocks](https://github.com/seattlerb/minitest#mocks) and
|
86
|
+
[minitest-autotest](https://github.com/seattlerb/minitest-autotest).
|
87
|
+
|
88
|
+
To run the Bigtable unit tests:
|
89
|
+
|
90
|
+
``` sh
|
91
|
+
$ cd google-cloud-bigtable/
|
92
|
+
$ bundle exec rake test
|
93
|
+
```
|
94
|
+
|
95
|
+
### Bigtable Documentation Tests
|
96
|
+
|
97
|
+
The project tests the code examples in the gem's
|
98
|
+
[YARD](https://github.com/lsegal/yard)-based documentation.
|
99
|
+
|
100
|
+
The example testing functions in a way that is very similar to unit testing, and
|
101
|
+
in fact the library providing it,
|
102
|
+
[yard-doctest](https://github.com/p0deje/yard-doctest), is based on the
|
103
|
+
project's unit test library, [minitest](https://github.com/seattlerb/minitest).
|
104
|
+
|
105
|
+
To run the Bigtable documentation tests:
|
106
|
+
|
107
|
+
``` sh
|
108
|
+
$ cd google-cloud-bigtable/
|
109
|
+
$ bundle exec rake doctest
|
110
|
+
```
|
111
|
+
|
112
|
+
If you add, remove or modify documentation examples when working on a pull
|
113
|
+
request, you may need to update the setup for the tests. The stubs and mocks
|
114
|
+
required to run the tests are located in `support/doctest_helper.rb`. Please
|
115
|
+
note that much of the setup is matched by the title of the
|
116
|
+
[`@example`](http://www.rubydoc.info/gems/yard/file/docs/Tags.md#example) tag.
|
117
|
+
If you alter an example's title, you may encounter breaking tests.
|
118
|
+
|
119
|
+
### Bigtable Acceptance Tests
|
120
|
+
|
121
|
+
The Bigtable acceptance tests interact with the live service API. Follow the
|
122
|
+
instructions in the {file:AUTHENTICATION.md Authentication guide} for enabling
|
123
|
+
the Bigtable API. Occasionally, some API features may not yet be generally
|
124
|
+
available, making it difficult for some contributors to successfully run the
|
125
|
+
entire acceptance test suite. However, please ensure that you do successfully
|
126
|
+
run acceptance tests for any code areas covered by your pull request.
|
127
|
+
|
128
|
+
To run the acceptance tests, first create and configure a project in the Google
|
129
|
+
Developers Console, as described in the {file:AUTHENTICATION.md Authentication
|
130
|
+
guide}. Be sure to download the JSON KEY file. Make note of the PROJECT_ID and
|
131
|
+
the KEYFILE location on your system.
|
132
|
+
|
133
|
+
Before you can run the Bigtable acceptance tests, you must first create indexes
|
134
|
+
used in the tests.
|
135
|
+
|
136
|
+
#### Running the Bigtable acceptance tests
|
137
|
+
|
138
|
+
To run the Bigtable acceptance tests:
|
139
|
+
|
140
|
+
``` sh
|
141
|
+
$ cd google-cloud-bigtable/
|
142
|
+
$ bundle exec rake acceptance[\\{my-project-id},\\{/path/to/keyfile.json}]
|
143
|
+
```
|
144
|
+
|
145
|
+
Or, if you prefer you can store the values in the `GCLOUD_TEST_PROJECT` and
|
146
|
+
`GCLOUD_TEST_KEYFILE` environment variables:
|
147
|
+
|
148
|
+
``` sh
|
149
|
+
$ cd google-cloud-bigtable/
|
150
|
+
$ export GCLOUD_TEST_PROJECT=\\{my-project-id}
|
151
|
+
$ export GCLOUD_TEST_KEYFILE=\\{/path/to/keyfile.json}
|
152
|
+
$ bundle exec rake acceptance
|
153
|
+
```
|
154
|
+
|
155
|
+
If you want to use a different project and credentials for acceptance tests, you
|
156
|
+
can use the more specific `BIGTABLE_TEST_PROJECT` and `BIGTABLE_TEST_KEYFILE`
|
157
|
+
environment variables:
|
158
|
+
|
159
|
+
``` sh
|
160
|
+
$ cd google-cloud-bigtable/
|
161
|
+
$ export BIGTABLE_TEST_PROJECT=\\{my-project-id}
|
162
|
+
$ export BIGTABLE_TEST_KEYFILE=\\{/path/to/keyfile.json}
|
163
|
+
$ bundle exec rake acceptance
|
164
|
+
```
|
165
|
+
|
166
|
+
## Coding Style
|
167
|
+
|
168
|
+
Please follow the established coding style in the library. The style is is
|
169
|
+
largely based on [The Ruby Style
|
170
|
+
Guide](https://github.com/bbatsov/ruby-style-guide) with a few exceptions based
|
171
|
+
on seattle-style:
|
172
|
+
|
173
|
+
* Avoid parenthesis when possible, including in method definitions.
|
174
|
+
* Always use double quotes strings. ([Option
|
175
|
+
B](https://github.com/bbatsov/ruby-style-guide#strings))
|
176
|
+
|
177
|
+
You can check your code against these rules by running Rubocop like so:
|
178
|
+
|
179
|
+
```sh
|
180
|
+
$ cd google-cloud-bigtable/
|
181
|
+
$ bundle exec rake rubocop
|
182
|
+
```
|
183
|
+
|
184
|
+
## Code of Conduct
|
185
|
+
|
186
|
+
Please note that this project is released with a Contributor Code of Conduct. By
|
187
|
+
participating in this project you agree to abide by its terms. See
|
188
|
+
{file:CODE_OF_CONDUCT.md Code of Conduct} for more information.
|
data/LOGGING.md
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# Enabling gRPC Logging
|
2
|
+
|
3
|
+
To enable logging for this library, set the logger for the underlying
|
4
|
+
[gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. The logger
|
5
|
+
that you set may be a Ruby stdlib
|
6
|
+
[`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as
|
7
|
+
shown below, or a
|
8
|
+
[`Google::Cloud::Logging::Logger`](https://googlecloudplatform.github.io/google-cloud-ruby/docs/google-cloud-logging/latest/Google/Cloud/Logging/Logger)
|
9
|
+
that will write logs to [Stackdriver
|
10
|
+
Logging](https://cloud.google.com/logging/). See
|
11
|
+
[grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
12
|
+
and the gRPC
|
13
|
+
[spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb)
|
14
|
+
for additional information.
|
15
|
+
|
16
|
+
Configuring a Ruby stdlib logger:
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
require "logger"
|
20
|
+
|
21
|
+
module MyLogger
|
22
|
+
LOGGER = Logger.new $stderr, level: Logger::WARN
|
23
|
+
def logger
|
24
|
+
LOGGER
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
29
|
+
module GRPC
|
30
|
+
extend MyLogger
|
31
|
+
end
|
32
|
+
```
|
data/OVERVIEW.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# Cloud Bigtable
|
2
|
+
|
3
|
+
Ruby Client for Cloud Bigtable API Alpha](https://github.com/GoogleCloudPlatform/google-cloud-ruby#versioning))
|
4
|
+
|
5
|
+
[Cloud Bigtable API][Product Documentation]:
|
6
|
+
API for reading and writing the contents of Bigtables associated with a
|
7
|
+
cloud project.
|
8
|
+
- [Product Documentation][]
|
9
|
+
|
10
|
+
## Quick Start
|
11
|
+
In order to use this library, you first need to go through the following
|
12
|
+
steps:
|
13
|
+
|
14
|
+
1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
15
|
+
2. [Enable billing for your oject.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_projec
|
16
|
+
3. [Enable the Cloud Bigtable API.](https://console.cloud.google.com/apis/api/bigtable)
|
17
|
+
4. [Setup thentication.](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/mast/guides/authentication)
|
18
|
+
|
19
|
+
### Next Steps
|
20
|
+
- Read the [Cloud Bigtable API Product documentation][Product Documentation]
|
21
|
+
to learn more about the product and see How-to Guides.
|
22
|
+
- View this [repository's main ADME](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md)
|
23
|
+
to see the full list of Cloud APIs that we cover.
|
24
|
+
|
25
|
+
## Additional information
|
26
|
+
|
27
|
+
Google Bigtable can be configured to use gRPC's logging. To learn more, see the
|
28
|
+
{file:LOGGING.md Logging guide}.
|
data/TROUBLESHOOTING.md
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# Troubleshooting
|
2
|
+
|
3
|
+
## Where can I get more help?
|
4
|
+
|
5
|
+
### Ask the Community
|
6
|
+
|
7
|
+
If you have a question about how to use a Google Cloud client library in your
|
8
|
+
project or are stuck in the Developer's console and don't know where to turn,
|
9
|
+
it's possible your questions have already been addressed by the community.
|
10
|
+
|
11
|
+
First, check out the appropriate tags on StackOverflow:
|
12
|
+
- [`google-cloud-platform+ruby+bigtable`][so-ruby]
|
13
|
+
|
14
|
+
Next, try searching through the issues on GitHub:
|
15
|
+
|
16
|
+
- [`api:bigtable` issues][gh-search-ruby]
|
17
|
+
|
18
|
+
Still nothing?
|
19
|
+
|
20
|
+
### Ask the Developers
|
21
|
+
|
22
|
+
If you're experiencing a bug with the code, or have an idea for how it can be
|
23
|
+
improved, *please* create a new issue on GitHub so we can talk about it.
|
24
|
+
|
25
|
+
- [New issue][gh-ruby]
|
26
|
+
|
27
|
+
Or, you can ask questions on the [Google Cloud Platform Slack][slack-ruby]. You
|
28
|
+
can use the "ruby" channel for general Ruby questions, or use the
|
29
|
+
"google-cloud-ruby" channel if you have questions about this gem in particular.
|
30
|
+
|
31
|
+
[so-ruby]: http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby+bigtable
|
32
|
+
|
33
|
+
[gh-search-ruby]: https://github.com/googlecloudplatform/google-cloud-ruby/issues?q=label%3A%22api%3A+bigtable%22
|
34
|
+
|
35
|
+
[gh-ruby]: https://github.com/googlecloudplatform/google-cloud-ruby/issues/new
|
36
|
+
|
37
|
+
[slack-ruby]: https://gcp-slack.appspot.com/
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-bigtable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-gax
|
@@ -171,8 +171,14 @@ extensions: []
|
|
171
171
|
extra_rdoc_files: []
|
172
172
|
files:
|
173
173
|
- ".yardopts"
|
174
|
+
- AUTHENTICATION.md
|
175
|
+
- CHANGELOG.md
|
176
|
+
- CODE_OF_CONDUCT.md
|
177
|
+
- CONTRIBUTING.md
|
174
178
|
- LICENSE
|
175
|
-
-
|
179
|
+
- LOGGING.md
|
180
|
+
- OVERVIEW.md
|
181
|
+
- TROUBLESHOOTING.md
|
176
182
|
- lib/google-cloud-bigtable.rb
|
177
183
|
- lib/google/bigtable/admin/v2/bigtable_instance_admin_pb.rb
|
178
184
|
- lib/google/bigtable/admin/v2/bigtable_instance_admin_services_pb.rb
|
data/README.md
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
# Ruby Client for Cloud Bigtable API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-ruby#versioning))
|
2
|
-
|
3
|
-
[Cloud Bigtable API][Product Documentation]:
|
4
|
-
API for reading and writing the contents of Bigtables associated with a
|
5
|
-
cloud project.
|
6
|
-
- [Client Library Documentation][]
|
7
|
-
- [Product Documentation][]
|
8
|
-
|
9
|
-
## Quick Start
|
10
|
-
In order to use this library, you first need to go through the following
|
11
|
-
steps:
|
12
|
-
|
13
|
-
1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
14
|
-
2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
15
|
-
3. [Enable the Cloud Bigtable API.](https://console.cloud.google.com/apis/api/bigtable)
|
16
|
-
4. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-ruby/docs/google-cloud-bigtable/latest/file.AUTHENTICATION)
|
17
|
-
|
18
|
-
### Installation
|
19
|
-
```
|
20
|
-
$ gem install google-cloud-bigtable
|
21
|
-
```
|
22
|
-
|
23
|
-
### Next Steps
|
24
|
-
- Read the [Client Library Documentation][] for Cloud Bigtable API
|
25
|
-
to see other available methods on the client.
|
26
|
-
- Read the [Cloud Bigtable API Product documentation][Product Documentation]
|
27
|
-
to learn more about the product and see How-to Guides.
|
28
|
-
- View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md)
|
29
|
-
to see the full list of Cloud APIs that we cover.
|
30
|
-
|
31
|
-
## Enabling Logging
|
32
|
-
|
33
|
-
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below, or a [`Google::Cloud::Logging::Logger`](https://googlecloudplatform.github.io/google-cloud-ruby/docs/google-cloud-logging/latest/Google/Cloud/Logging/Logger) that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
34
|
-
|
35
|
-
Configuring a Ruby stdlib logger:
|
36
|
-
|
37
|
-
```ruby
|
38
|
-
require "logger"
|
39
|
-
|
40
|
-
module MyLogger
|
41
|
-
LOGGER = Logger.new $stderr, level: Logger::WARN
|
42
|
-
def logger
|
43
|
-
LOGGER
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
48
|
-
module GRPC
|
49
|
-
extend MyLogger
|
50
|
-
end
|
51
|
-
```
|
52
|
-
|
53
|
-
## Supported Ruby Versions
|
54
|
-
|
55
|
-
This library is supported on Ruby 2.3+.
|
56
|
-
|
57
|
-
Google provides official support for Ruby versions that are actively supported
|
58
|
-
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
59
|
-
in security maintenance, and not end of life. Currently, this means Ruby 2.3
|
60
|
-
and later. Older versions of Ruby _may_ still work, but are unsupported and not
|
61
|
-
recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
|
62
|
-
about the Ruby support schedule.
|
63
|
-
|
64
|
-
[Client Library Documentation]: https://googlecloudplatform.github.io/google-cloud-ruby/docs/google-cloud-bigtable/latest
|
65
|
-
[Product Documentation]: https://cloud.google.com/bigtable
|