Skip to content

Commit cb6dbb8

Browse files
Improve the Spanner landing page. (#4060)
1 parent 3eecdc3 commit cb6dbb8

File tree

3 files changed

+83
-84
lines changed

3 files changed

+83
-84
lines changed

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@
122122
'github_user': 'GoogleCloudPlatform',
123123
'github_repo': 'google-cloud-python',
124124
'github_banner': True,
125-
'travis_button': True,
126125
'font_family': "'Roboto', Georgia, sans",
127126
'head_font_family': "'Roboto', Georgia, serif",
128127
'code_font_family': "'Roboto Mono', 'Consolas', monospace",

docs/spanner/client-usage.rst

Lines changed: 0 additions & 68 deletions
This file was deleted.

docs/spanner/usage.rst

Lines changed: 83 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
Spanner
2-
=======
2+
^^^^^^^
3+
4+
`Cloud Spanner`_ is the world's first fully managed relational database service
5+
to offer both strong consistency and horizontal scalability for
6+
mission-critical online transaction processing (OLTP) applications. With Cloud
7+
Spanner you enjoy all the traditional benefits of a relational database; but
8+
unlike any other relational database service, Cloud Spanner scales horizontally
9+
to hundreds or thousands of servers to handle the biggest transactional
10+
workloads.
11+
12+
.. _Cloud Spanner: https://cloud.google.com/spanner/
313

414
.. toctree::
5-
:maxdepth: 2
15+
:maxdepth: 1
16+
:titlesonly:
617
:hidden:
718

8-
client-usage
919
instance-usage
1020
database-usage
1121
batch-usage
@@ -14,19 +24,77 @@ Spanner
1424
advanced-session-pool-topics
1525
api-reference
1626

17-
API requests are sent to the `Cloud Spanner`_ API via RPC over
18-
HTTP/2. In order to support this, we'll rely on `gRPC`_.
27+
Spanner Client
28+
==============
29+
30+
.. _spanner-client:
31+
32+
33+
Instantiating a Client
34+
----------------------
35+
36+
To use the API, the :class:`~google.cloud.spanner.client.Client`
37+
class defines a high-level interface which handles authorization
38+
and creating other objects:
39+
40+
.. code:: python
41+
42+
from google.cloud import spanner
43+
client = spanner.Client()
44+
45+
Long-lived Defaults
46+
-------------------
47+
48+
When creating a :class:`~google.cloud.spanner.client.Client`, the
49+
``user_agent`` and ``timeout_seconds`` arguments have sensible
50+
defaults
51+
(:data:`~google.cloud.spanner.client.DEFAULT_USER_AGENT` and
52+
:data:`~google.cloud.spanner.client.DEFAULT_TIMEOUT_SECONDS`).
53+
However, you may over-ride them and these will be used throughout all API
54+
requests made with the ``client`` you create.
55+
56+
Configuration
57+
-------------
58+
59+
- For an overview of authentication in ``google.cloud-python``,
60+
see :doc:`/core/auth`.
61+
62+
- In addition to any authentication configuration, you can also set the
63+
:envvar:`GCLOUD_PROJECT` environment variable for the Google Cloud Console
64+
project you'd like to interact with. If your code is running in Google App
65+
Engine or Google Compute Engine the project will be detected automatically.
66+
(Setting this environment variable is not required, you may instead pass the
67+
``project`` explicitly when constructing a
68+
:class:`~google.cloud.storage.client.Client`).
69+
70+
- After configuring your environment, create a
71+
:class:`~google.cloud.storage.client.Client`
72+
73+
.. code::
74+
75+
>>> from google.cloud import spanner
76+
>>> client = spanner.Client()
77+
78+
or pass in ``credentials`` and ``project`` explicitly
79+
80+
.. code::
81+
82+
>>> from google.cloud import spanner
83+
>>> client = spanner.Client(project='my-project', credentials=creds)
84+
85+
.. tip::
86+
87+
Be sure to use the **Project ID**, not the **Project Number**.
88+
1989

20-
Get started by learning about the :class:`~google.cloud.spanner.client.Client`
21-
on the :doc:`client-usage` page.
90+
Next Step
91+
---------
2292

23-
In the hierarchy of API concepts
93+
After a :class:`~google.cloud.spanner.client.Client`, the next
94+
highest-level object is an :class:`~google.cloud.spanner.instance.Instance`.
95+
You'll need one before you can interact with databases.
2496

25-
* a :class:`~google.cloud.spanner.client.Client` owns an
26-
:class:`~google.cloud.spanner.instance.Instance`
27-
* an :class:`~google.cloud.spanner.instance.Instance` owns a
28-
:class:`~google.cloud.spanner.database.Database`
97+
Next, learn about the :doc:`instance-usage`.
2998

30-
.. _Cloud Spanner: https://cloud.google.com/spanner/docs/
31-
.. _gRPC: http://www.grpc.io/
32-
.. _grpcio: https://pypi.org/project/grpcio/
99+
.. _Instance Admin: https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.instance.v1
100+
.. _Database Admin: https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.database.v1

0 commit comments

Comments
 (0)