Skip to content

Commit 4b56a23

Browse files
committed
Merge pull request #66 from jgeewax/storage-tutorial
Fixed #37 - Added getting started tutorial for gcloud.storage.
2 parents 6ebf806 + 8a89841 commit 4b56a23

File tree

6 files changed

+348
-93
lines changed

6 files changed

+348
-93
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
* **Create a project**
2+
3+
Start off by visiting https://cloud.google.com/console
4+
and click on the big red button
5+
that says "Create Project".
6+
7+
* **Choose a name**
8+
9+
In the box that says "name",
10+
choose something friendly.
11+
This is going to be the *human-readable* name
12+
for your project.
13+
14+
* **Choose an ID**
15+
16+
In the box that says "ID",
17+
choose something unique
18+
(hyphens are OK).
19+
I typically choose a project name
20+
that starts with my initials,
21+
then a hyphen,
22+
then a unique identifier for the work I'm doing.
23+
For this example,
24+
you might choose ``<initials>-quickstart``.
25+
26+
Then click OK
27+
(give it a second to create your project).
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Now that you have a project,
2+
we need to make sure we are able to access our data.
3+
There are many ways to authenticate,
4+
but we're going to use a Service Account for today.
5+
6+
A *Service Account* is sort of like a username and password
7+
(like when you're connecting to your MySQL database),
8+
except the username is automatically generated
9+
(and is an e-mail address)
10+
and the password is actually a private key file.
11+
12+
To create a Service Account:
13+
14+
* **Click on Credentials**
15+
under the "APIs & Auth" section.
16+
17+
* **Click the big red button**
18+
that says "Create New Client ID"
19+
under the OAuth section
20+
(the first one).
21+
22+
* **Choose "Service Account"**
23+
and click the blue button
24+
that says "Create Client ID".
25+
26+
* **This will automatically**
27+
download a private key file.
28+
**Do not lose this.**
29+
30+
* **Rename your key** something shorter.
31+
I like to name the key ``<project name>.p12``.
32+
33+
This is like your password for the account.
34+
35+
* **Copy the long weird e-mail address**
36+
labeled "E-mail address"
37+
in the information section
38+
for the Service Account
39+
you just created.
40+
41+
This is like your username for the account.

docs/datastore-getting-started.rst

Lines changed: 6 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,13 @@ Getting started with Cloud Datastore
88
Creating a project
99
------------------
1010

11-
* **Create a project**
11+
.. include:: _components/creating-a-project.rst
1212

13-
Start off by visiting https://cloud.google.com/console
14-
and click on the big red button
15-
that says "Create Project".
16-
17-
* **Choose a name**
18-
19-
In the box that says "name",
20-
choose something friendly.
21-
This is going to be the *human-readable* name
22-
for your project.
23-
24-
* **Choose an ID**
25-
26-
In the box that says "ID",
27-
choose something unique
28-
(hyphens are OK).
29-
I typically choose a project name
30-
that starts with my initials,
31-
then a hyphen,
32-
then a unique identifier for the work I'm doing.
33-
For this example,
34-
you might choose ``<initials>-quickstart``.
35-
36-
Then click OK
37-
(give it a second to create your project).
38-
39-
Enable the Cloud Datastore API
40-
------------------------------
13+
Enabling the API
14+
----------------
4115

4216
Now that you created a project,
43-
you need to *turn on* the Cloud Datastore API.
17+
you need to **turn on** the Cloud Datastore API.
4418
This is sort of like telling Google
4519
which services you intend to use for this project.
4620

@@ -53,54 +27,10 @@ which services you intend to use for this project.
5327
on the right side
5428
to turn it into an "On" button.
5529

56-
Enable a "Service Account"
30+
Enabling a service account
5731
--------------------------
5832

59-
Now that you have a project
60-
that has access to the Cloud Datastore API,
61-
we need to make sure we are able to access our data.
62-
There are many ways to authenticate,
63-
but we're going to use a Service Account for today.
64-
65-
A *Service Account* is sort of like a username and password
66-
(like when you're connecting to your MySQL database),
67-
except the username is automatically generated
68-
(and is an e-mail address)
69-
and the password is actually a private key file.
70-
71-
To create a Service Account:
72-
73-
* **Click on Credentials**
74-
under the "APIs & Auth" section.
75-
76-
* **Click the big red button**
77-
that says "Create New Client ID"
78-
under the OAuth section
79-
(the first one).
80-
81-
* **Choose "Service Account"**
82-
and click the blue button
83-
that says "Create Client ID".
84-
85-
* **This will automatically**
86-
download a private key file.
87-
**Do not lost this.**
88-
89-
* **Rename your key** something shorter.
90-
I like to name the key ``<project name>.key``.
91-
92-
This is like your password for the account.
93-
94-
* **Copy the long weird e-mail address**
95-
labeled "E-mail address"
96-
in the information section
97-
for the Service Account
98-
you just created.
99-
100-
This is like your username for the account.
101-
102-
OK. That's it!
103-
Time to start doing things with your Cloud Datastore project.
33+
.. include:: _components/enabling-a-service-account.rst
10434

10535
Add some data to your dataset
10636
-----------------------------

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Services
4343

4444
- Google's `official documentation <https://developers.google.com/storage/>`_
4545
- :doc:`storage-quickstart`
46-
- `Getting started with Cloud Storage <https://github.com/GoogleCloudPlatform/gcloud-python/issues/37>`_
46+
- :doc:`Getting started with Cloud Storage <storage-getting-started>`
4747
- :doc:`Cloud Storage API Documentation <storage-api>`
4848

4949
.. topic:: Compute Engine

0 commit comments

Comments
 (0)