|
| 1 | +.. This file is automatically generated. Do not edit this file directly. |
| 2 | +
|
| 3 | +
|
| 4 | +Google Cloud Bigtable table creation |
| 5 | +=============================================================================== |
| 6 | + |
| 7 | +https://cloud.google.com/bigtable/docs/quickstart-cbt |
| 8 | + |
| 9 | +This page explains how to use the cbt command to connect to a Cloud Bigtable instance, perform basic administrative tasks, and read and write data in a table. |
| 10 | + |
| 11 | +Google Cloud Bigtable Python Samples |
| 12 | +=============================================================================== |
| 13 | + |
| 14 | +.. image:: https://gstatic.com/cloudssh/images/open-btn.png |
| 15 | + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=bigtable/hello/README.rst |
| 16 | + |
| 17 | + |
| 18 | +This directory contains samples for Google Cloud Bigtable. `Google Cloud Bigtable`_ is Google's NoSQL Big Data database service. It's the same database that powers many core Google services, including Search, Analytics, Maps, and Gmail. |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | +.. _Google Cloud Bigtable: https://cloud.google.com/bigtable/docs |
| 24 | + |
| 25 | +Setup |
| 26 | +------------------------------------------------------------------------------- |
| 27 | + |
| 28 | + |
| 29 | +Authentication |
| 30 | +++++++++++++++ |
| 31 | + |
| 32 | +This sample requires you to have authentication setup. Refer to the |
| 33 | +`Authentication Getting Started Guide`_ for instructions on setting up |
| 34 | +credentials for applications. |
| 35 | + |
| 36 | +.. _Authentication Getting Started Guide: |
| 37 | + https://cloud.google.com/docs/authentication/getting-started |
| 38 | + |
| 39 | +Install Dependencies |
| 40 | +++++++++++++++++++++ |
| 41 | + |
| 42 | +#. Clone python-docs-samples and change directory to the sample directory you want to use. |
| 43 | + |
| 44 | + .. code-block:: bash |
| 45 | +
|
| 46 | + $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git |
| 47 | +
|
| 48 | +#. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions. |
| 49 | + |
| 50 | + .. _Python Development Environment Setup Guide: |
| 51 | + https://cloud.google.com/python/setup |
| 52 | + |
| 53 | +#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. |
| 54 | + |
| 55 | + .. code-block:: bash |
| 56 | +
|
| 57 | + $ virtualenv env |
| 58 | + $ source env/bin/activate |
| 59 | +
|
| 60 | +#. Install the dependencies needed to run the samples. |
| 61 | + |
| 62 | + .. code-block:: bash |
| 63 | +
|
| 64 | + $ pip install -r requirements.txt |
| 65 | +
|
| 66 | +.. _pip: https://pip.pypa.io/ |
| 67 | +.. _virtualenv: https://virtualenv.pypa.io/ |
| 68 | + |
| 69 | +Samples |
| 70 | +------------------------------------------------------------------------------- |
| 71 | + |
| 72 | +Basic example |
| 73 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 74 | + |
| 75 | +.. image:: https://gstatic.com/cloudssh/images/open-btn.png |
| 76 | + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=bigtable/instanceadmin.py,bigtable/instanceadmin/README.rst |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | +To run this sample: |
| 82 | + |
| 83 | +.. code-block:: bash |
| 84 | +
|
| 85 | + $ python instanceadmin.py |
| 86 | +
|
| 87 | + usage: instanceadmin.py [-h] [run] [dev-instance] [del-instance] [add-cluster] [del-cluster] project_id instance_id cluster_id |
| 88 | +
|
| 89 | + Demonstrates how to connect to Cloud Bigtable and run some basic operations |
| 90 | + to create instance, create cluster, delete instance and delete cluster. |
| 91 | + Prerequisites: - Create a Cloud Bigtable cluster. |
| 92 | + https://cloud.google.com/bigtable/docs/creating-cluster - Set your Google |
| 93 | + Application Default Credentials. |
| 94 | + https://developers.google.com/identity/protocols/application-default- |
| 95 | + credentials |
| 96 | +
|
| 97 | + positional arguments: |
| 98 | + project_id Your Cloud Platform project ID. |
| 99 | + instance_id ID of the Cloud Bigtable instance to connect to. |
| 100 | + cluster_id ID of the Cloud Bigtable cluster to connect to. |
| 101 | +
|
| 102 | + optional arguments: |
| 103 | + -h, --help show this help message and exit |
| 104 | +
|
| 105 | +The client library |
| 106 | +------------------------------------------------------------------------------- |
| 107 | + |
| 108 | +This sample uses the `Google Cloud Client Library for Python`_. |
| 109 | +You can read the documentation for more details on API usage and use GitHub |
| 110 | +to `browse the source`_ and `report issues`_. |
| 111 | + |
| 112 | +.. _Google Cloud Client Library for Python: |
| 113 | + https://googlecloudplatform.github.io/google-cloud-python/ |
| 114 | +.. _browse the source: |
| 115 | + https://github.com/GoogleCloudPlatform/google-cloud-python |
| 116 | +.. _report issues: |
| 117 | + https://github.com/GoogleCloudPlatform/google-cloud-python/issues |
| 118 | + |
| 119 | + |
| 120 | +.. _Google Cloud SDK: https://cloud.google.com/sdk/ |
0 commit comments