11# Cloud Bigtable Hello World
22
33This is a simple application that demonstrates using the [ Google Cloud Client
4- Library] [ gcloud-python ] to connect to and interact with Cloud Bigtable.
4+ Library] [ gcloud-python-bigtable ] to connect to and interact with Cloud Bigtable.
55
6- [ gcloud-python ] : https://github.com/GoogleCloudPlatform/gcloud-python
6+ <!-- auto-doc-link -->
7+ These samples are used on the following documentation page:
78
9+ > https://cloud.google.com/bigtable/docs/samples-python-hello
810
9- ## Provision a cluster
11+ <!-- end-auto-doc-link -->
1012
11- Follow the instructions in the [ user documentation] ( https://cloud.google.com/bigtable/docs/creating-cluster )
12- to create a Google Cloud Platform project and Cloud Bigtable cluster if necessary.
13- You'll need to reference your project ID, zone and cluster ID to run the application.
13+ [ gcloud-python-bigtable ] : https://googlecloudplatform.github.io/gcloud-python/stable/bigtable-usage.html
14+ [ sample-docs ] : https://cloud.google.com/bigtable/docs/samples-python-hello
1415
1516
16- ## Run the application
17+ <!-- START doctoc generated TOC please keep comment here to allow auto update -->
18+ <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
19+ ** Table of Contents**
20+
21+ - [ Downloading the sample] ( #downloading-the-sample )
22+ - [ Costs] ( #costs )
23+ - [ Provisioning an instance] ( #provisioning-an-instance )
24+ - [ Running the application] ( #running-the-application )
25+ - [ Cleaning up] ( #cleaning-up )
26+
27+ <!-- END doctoc generated TOC please keep comment here to allow auto update -->
28+
29+
30+ ## Downloading the sample
31+
32+ Download the sample app and navigate into the app directory:
33+
34+ 1 . Clone the [ Python samples
35+ repository] ( https://github.com/GoogleCloudPlatform/python-docs-samples ) , to
36+ your local machine:
37+
38+ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
39+
40+ Alternatively, you can [ download the
41+ sample] ( https://github.com/GoogleCloudPlatform/python-docs-samples/archive/master.zip )
42+ as a zip file and extract it.
43+
44+ 2 . Change to the sample directory.
45+
46+ cd python-docs-samples/bigtable/hello
47+
48+
49+ ## Costs
50+
51+ This sample uses billable components of Cloud Platform, including:
52+
53+ + Google Cloud Bigtable
54+
55+ Use the [ Pricing Calculator] [ bigtable-pricing ] to generate a cost estimate
56+ based on your projected usage. New Cloud Platform users might be eligible for
57+ a [ free trial] [ free-trial ] .
58+
59+ [ bigtable-pricing ] : https://cloud.google.com/products/calculator/#id=1eb47664-13a2-4be1-9d16-6722902a7572
60+ [ free-trial ] : https://cloud.google.com/free-trial
61+
62+
63+ ## Provisioning an instance
64+
65+ Follow the instructions in the [ user
66+ documentation] ( https://cloud.google.com/bigtable/docs/creating-instance ) to
67+ create a Google Cloud Platform project and Cloud Bigtable instance if necessary.
68+ You'll need to reference your project id and instance id to run the
69+ application.
70+
71+
72+ ## Running the application
1773
1874First, set your [ Google Application Default Credentials] ( https://developers.google.com/identity/protocols/application-default-credentials )
1975
@@ -23,20 +79,29 @@ Install the dependencies with pip.
2379$ pip install -r requirements.txt
2480```
2581
26- Run the application. Replace the command-line parameters with values for your cluster .
82+ Run the application. Replace the command-line parameters with values for your instance .
2783
2884```
29- $ python main.py my-project my-cluster us-central1-c
85+ $ python main.py my-project my-instance
3086```
3187
3288You will see output resembling the following:
3389
3490```
35- Create table Hello-Bigtable-1234
91+ Create table Hello-Bigtable
3692Write some greetings to the table
3793Scan for all greetings:
3894 greeting0: Hello World!
3995 greeting1: Hello Cloud Bigtable!
4096 greeting2: Hello HappyBase!
41- Delete table Hello-Bigtable-1234
97+ Delete table Hello-Bigtable
4298```
99+
100+
101+ ## Cleaning up
102+
103+ To avoid incurring extra charges to your Google Cloud Platform account, remove
104+ the resources created for this sample.
105+
106+ - [ Delete the Cloud Bigtable
107+ instance] ( https://cloud.google.com/bigtable/docs/deleting-instance ) .
0 commit comments