Skip to content

Commit 469be5f

Browse files
committed
Merge pull request #247 from ajkannan/standardize-readme
Standardize readme files
2 parents e844c36 + ea493d5 commit 469be5f

File tree

6 files changed

+120
-97
lines changed

6 files changed

+120
-97
lines changed

README.md

Lines changed: 42 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,12 @@ Java idiomatic client for [Google Cloud Platform][cloud-platform] services.
99

1010
- [Homepage] (https://googlecloudplatform.github.io/gcloud-java/)
1111
- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/apidocs)
12-
- [Examples] (http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/examples/package-summary.html)
1312

1413
This client supports the following Google Cloud Platform services:
1514

1615
- [Google Cloud Datastore] (#google-cloud-datastore)
1716
- [Google Cloud Storage] (#google-cloud-storage)
1817

19-
<!---
20-
- [Google Cloud Storage] (https://cloud.google.com/storage/)
21-
--->
22-
2318
> Note: This client is a work-in-progress, and may occasionally
2419
> make backwards-incompatible changes.
2520
@@ -34,28 +29,35 @@ Add this to your pom.xml file
3429
</dependency>
3530
```
3631

37-
<!---
3832
Example Applications
3933
--------------------
4034

41-
- `java-datastore-sample`_ - A sample using Cloud Datastore
42-
.. _java-datastore-sample: https://github.com/GoogleCloudPlatform/java-datastore-sample
43-
--->
35+
- [`DatastoreExample`](https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/gcloud-java-examples/src/main/java/com/google/gcloud/examples/DatastoreExample.java) - A simple command line interface for the Cloud Datastore
36+
- Read more about using this application on the [`gcloud-java-examples` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/gcloud/examples/DatastoreExample.html).
37+
- [`StorageExample`](https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/gcloud-java-examples/src/main/java/com/google/gcloud/examples/StorageExample.java) - A simple command line interface providing some of Cloud Storage's functionality
38+
- Read more about using this application on the [`gcloud-java-examples` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/gcloud/examples/StorageExample.html).
39+
40+
Authentication
41+
--------------
42+
43+
There are multiple ways to authenticate to use Google Cloud services.
44+
45+
1. When using `gcloud-java` libraries from within Compute/App Engine, no additional authentication steps are necessary.
46+
2. When using `gcloud-java` libraries elsewhere, there are two options:
47+
* [Generate a JSON service account key](https://cloud.google.com/storage/docs/authentication?hl=en#service_accounts). Supply a path to the downloaded JSON credentials file when building the options supplied to datastore/storage constructor.
48+
* If running locally for development/testing, you can use use [Google Cloud SDK](https://cloud.google.com/sdk/?hl=en). To use the SDK authentication, [download the SDK](https://cloud.google.com/sdk/?hl=en) if you haven't already. Then login using the SDK (`gcloud auth login` in command line), and set your current project using `gcloud config set project PROJECT_ID`.
4449

4550
Google Cloud Datastore
4651
----------------------
4752

48-
[Google Cloud Datastore][cloud-datastore] is a fully managed, schemaless database for
49-
storing non-relational data. Cloud Datastore automatically scales with
50-
your users and supports ACID transactions, high availability of reads and
51-
writes, strong consistency for reads and ancestor queries, and eventual
52-
consistency for all other queries.
53+
- [API Documentation][datastore-api]
54+
- [Official Documentation][cloud-datastore-docs]
55+
56+
*Follow the [activation instructions][cloud-datastore-activation] to use the Google Cloud Datastore API with your project.*
5357

54-
See the [Google Cloud Datastore docs][cloud-datastore-activation] for more details on how to activate
55-
Cloud Datastore for your project.
58+
#### Preview
5659

57-
See the ``gcloud-java`` API [datastore documentation][datastore-api] to learn how to interact
58-
with the Cloud Datastore using this Client Library.
60+
Here is a code snippet showing a simple usage example from within Compute/App Engine. Note that you must [supply credentials](#authentication) and a project ID if running this snippet elsewhere.
5961

6062
```java
6163
import com.google.gcloud.datastore.Datastore;
@@ -66,8 +68,7 @@ import com.google.gcloud.datastore.Entity;
6668
import com.google.gcloud.datastore.Key;
6769
import com.google.gcloud.datastore.KeyFactory;
6870

69-
DatastoreOptions options = DatastoreOptions.builder().projectId(PROJECT_ID).build();
70-
Datastore datastore = DatastoreFactory.instance().get(options);
71+
Datastore datastore = DatastoreFactory.instance().get(DatastoreOptions.getDefaultInstance());
7172
KeyFactory keyFactory = datastore.newKeyFactory().kind(KIND);
7273
Key key = keyFactory.newKey(keyName);
7374
Entity entity = datastore.get(key);
@@ -90,16 +91,14 @@ if (entity == null) {
9091
Google Cloud Storage
9192
----------------------
9293

93-
[Google Cloud Storage][cloud-storage] is a durable and highly available
94-
object storage service. Google Cloud Storage is almost infinitely scalable
95-
and guarantees consistency: when a write succeeds, the latest copy of the
96-
object will be returned to any GET, globally.
94+
- [API Documentation][storage-api]
95+
- [Official Documentation][cloud-storage-docs]
9796

98-
See the [Google Cloud Storage docs][cloud-storage-activation] for more details on how to activate
99-
Cloud Storage for your project.
97+
*Follow the [activation instructions][cloud-storage-activation] to use the Google Cloud Storage API with your project.*
10098

101-
See the ``gcloud-java`` API [storage documentation][storage-api] to learn how to interact
102-
with the Cloud Storage using this Client Library.
99+
#### Preview
100+
101+
Here is a code snippet showing a simple usage example from within Compute/App Engine. Note that you must [supply credentials](#authentication) and a project ID if running this snippet elsewhere.
103102

104103
```java
105104
import static java.nio.charset.StandardCharsets.UTF_8;
@@ -112,8 +111,7 @@ import com.google.gcloud.storage.StorageOptions;
112111
import java.nio.ByteBuffer;
113112
import java.nio.channels.WritableByteChannel;
114113

115-
StorageOptions options = StorageOptions.builder().projectId(PROJECT_ID).build();
116-
Storage storage = StorageFactory.instance().get(options);
114+
Storage storage = StorageFactory.instance().get(StorageOptions.getDefaultInstance());
117115
Blob blob = new Blob(storage, "bucket", "blob_name");
118116
if (!blob.exists()) {
119117
storage2.create(blob.info(), "Hello, Cloud Storage!".getBytes(UTF_8));
@@ -127,27 +125,18 @@ if (!blob.exists()) {
127125
}
128126
```
129127

128+
Java Versions
129+
-------------
130+
131+
Java 7 or above is required for using this client.
132+
130133
Testing
131134
-------
132135

133136
This library provides tools to help write tests for code that uses gcloud-java services.
134137

135138
See [TESTING] to read more about using our testing helpers.
136139

137-
Contributing
138-
------------
139-
140-
Contributions to this library are always welcome and highly encouraged.
141-
142-
See [CONTRIBUTING] for more information on how to get started.
143-
144-
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more information.
145-
146-
Java Versions
147-
-------------
148-
149-
Java 7 or above is required for using this client.
150-
151140
Versioning
152141
----------
153142

@@ -157,6 +146,15 @@ It is currently in major version zero (``0.y.z``), which means that anything
157146
may change at any time and the public API should not be considered
158147
stable.
159148

149+
Contributing
150+
------------
151+
152+
Contributions to this library are always welcome and highly encouraged.
153+
154+
See [CONTRIBUTING] for more information on how to get started.
155+
156+
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more information.
157+
160158
License
161159
-------
162160

gcloud-java-core/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ This module provides common functionality required by service-specific modules o
55

66
[![Build Status](https://travis-ci.org/GoogleCloudPlatform/gcloud-java.svg?branch=master)](https://travis-ci.org/GoogleCloudPlatform/gcloud-java)
77
[![Coverage Status](https://coveralls.io/repos/GoogleCloudPlatform/gcloud-java/badge.svg?branch=master)](https://coveralls.io/r/GoogleCloudPlatform/gcloud-java?branch=master)
8+
[![Maven](https://img.shields.io/maven-central/v/com.google.gcloud/gcloud-java-core.svg)](https://img.shields.io/maven-central/v/com.google.gcloud/gcloud-java-core.svg)
89

910
- [Homepage] (https://googlecloudplatform.github.io/gcloud-java/)
1011
- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/package-summary.html)
11-
- [Examples] (http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/examples/package-summary.html)
1212

1313
Quickstart
1414
----------
@@ -21,18 +21,18 @@ Add this to your pom.xml file
2121
</dependency>
2222
```
2323

24+
Java Versions
25+
-------------
26+
27+
Java 7 or above is required for using this client.
28+
2429
Contributing
2530
------------
2631

2732
Contributions to this library are always welcome and highly encouraged.
2833

2934
See [CONTRIBUTING] for more information on how to get started.
3035

31-
Java Versions
32-
-------------
33-
34-
Java 7 or above is required for using this client.
35-
3636
Versioning
3737
----------
3838

gcloud-java-datastore/README.md

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ Java idiomatic client for [Google Cloud Datastore] (https://cloud.google.com/dat
55

66
[![Build Status](https://travis-ci.org/GoogleCloudPlatform/gcloud-java.svg?branch=master)](https://travis-ci.org/GoogleCloudPlatform/gcloud-java)
77
[![Coverage Status](https://coveralls.io/repos/GoogleCloudPlatform/gcloud-java/badge.svg?branch=master)](https://coveralls.io/r/GoogleCloudPlatform/gcloud-java?branch=master)
8+
[![Maven](https://img.shields.io/maven-central/v/com.google.gcloud/gcloud-java-datastore.svg)]( https://img.shields.io/maven-central/v/com.google.gcloud/gcloud-java-datastore.svg)
89

910
- [Homepage] (https://googlecloudplatform.github.io/gcloud-java/)
1011
- [API Documentation] (http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/datastore/package-summary.html)
11-
- [Examples] (http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/gcloud/examples/DatastoreExample.html)
1212

1313
> Note: This client is a work-in-progress, and may occasionally
1414
> make backwards-incompatible changes.
@@ -24,6 +24,18 @@ Add this to your pom.xml file
2424
</dependency>
2525
```
2626

27+
Example Application
28+
--------------------
29+
[`DatastoreExample`](https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/gcloud-java-examples/src/main/java/com/google/gcloud/examples/DatastoreExample.java) is a simple command line interface for the Cloud Datastore. Read more about using the application on the [`gcloud-java-examples` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/gcloud/examples/DatastoreExample.html).
30+
31+
Authentication
32+
--------------
33+
34+
See the [Authentication](https://github.com/GoogleCloudPlatform/gcloud-java#authentication) section in the base directory's README.
35+
36+
About Google Cloud Datastore
37+
----------------------------
38+
2739
Google [Cloud Datastore][cloud-datastore] is a fully managed, schemaless database for
2840
storing non-relational data. Cloud Datastore automatically scales with
2941
your users and supports ACID transactions, high availability of reads and
@@ -36,6 +48,8 @@ Cloud Datastore for your project.
3648
See the ``gcloud-java`` API [datastore documentation][datastore-api] to learn how to interact
3749
with the Cloud Datastore using this Client Library.
3850

51+
Here is a code snippet showing a simple usage example from within Compute/App Engine. Note that you must [supply credentials](https://github.com/GoogleCloudPlatform/gcloud-java#authentication) and a project ID if running this snippet elsewhere.
52+
3953
```java
4054
import com.google.gcloud.datastore.Datastore;
4155
import com.google.gcloud.datastore.DatastoreFactory;
@@ -45,8 +59,7 @@ import com.google.gcloud.datastore.Entity;
4559
import com.google.gcloud.datastore.Key;
4660
import com.google.gcloud.datastore.KeyFactory;
4761

48-
DatastoreOptions options = DatastoreOptions.builder().projectId(PROJECT_ID).build();
49-
Datastore datastore = DatastoreFactory.instance().get(options);
62+
Datastore datastore = DatastoreFactory.instance().get(DatastoreOptions.getDefaultInstance());
5063
KeyFactory keyFactory = datastore.newKeyFactory().kind(KIND);
5164
Key key = keyFactory.newKey(keyName);
5265
Entity entity = datastore.get(key);
@@ -66,25 +79,18 @@ if (entity == null) {
6679
}
6780
```
6881

82+
Java Versions
83+
-------------
84+
85+
Java 7 or above is required for using this client.
86+
6987
Testing
7088
-------
7189

7290
This library has tools to help write tests for code that uses the Datastore.
7391

7492
See [TESTING] to read more about testing.
7593

76-
Contributing
77-
------------
78-
79-
Contributions to this library are always welcome and highly encouraged.
80-
81-
See [CONTRIBUTING] for more information on how to get started.
82-
83-
Java Versions
84-
-------------
85-
86-
Java 7 or above is required for using this client.
87-
8894
Versioning
8995
----------
9096

@@ -94,6 +100,13 @@ It is currently in major version zero (``0.y.z``), which means that anything
94100
may change at any time and the public API should not be considered
95101
stable.
96102

103+
Contributing
104+
------------
105+
106+
Contributions to this library are always welcome and highly encouraged.
107+
108+
See [CONTRIBUTING] for more information on how to get started.
109+
97110
License
98111
-------
99112

gcloud-java-examples/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Examples for gcloud-java (Java idiomatic client for [Google Cloud Platform][clou
55

66
[![Build Status](https://travis-ci.org/GoogleCloudPlatform/gcloud-java.svg?branch=master)](https://travis-ci.org/GoogleCloudPlatform/gcloud-java)
77
[![Coverage Status](https://coveralls.io/repos/GoogleCloudPlatform/gcloud-java/badge.svg?branch=master)](https://coveralls.io/r/GoogleCloudPlatform/gcloud-java?branch=master)
8+
[![Maven](https://img.shields.io/maven-central/v/com.google.gcloud/gcloud-java-examples.svg)]( https://img.shields.io/maven-central/v/com.google.gcloud/gcloud-java-examples.svg)
89

910
- [Homepage] (https://googlecloudplatform.github.io/gcloud-java/)
1011
- [Examples] (http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html?com/google/gcloud/examples/package-summary.html)
@@ -49,13 +50,6 @@ To run examples from your command line:
4950
$mvn exec:java -Dexec.mainClass="com.google.gcloud.examples.StorageExample" -Dexec.args="delete <bucket_name> test.txt"
5051
```
5152

52-
Contributing
53-
------------
54-
55-
Contributions to this library are always welcome and highly encouraged.
56-
57-
See [CONTRIBUTING] for more information on how to get started.
58-
5953
Java Versions
6054
-------------
6155

@@ -70,6 +64,13 @@ It is currently in major version zero (``0.y.z``), which means that anything
7064
may change at any time and the public API should not be considered
7165
stable.
7266

67+
Contributing
68+
------------
69+
70+
Contributions to this library are always welcome and highly encouraged.
71+
72+
See [CONTRIBUTING] for more information on how to get started.
73+
7374
License
7475
-------
7576

0 commit comments

Comments
 (0)