You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds some new generation code to the synth.py to handle generation of the Python sample docs! Content of the sample descriptions/custom content is predominantly pulled from the existing docs
Copy file name to clipboardExpand all lines: .repo-metadata.json
+55-1Lines changed: 55 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -9,5 +9,59 @@
9
9
"repo": "googleapis/python-bigtable",
10
10
"distribution_name": "google-cloud-bigtable",
11
11
"api_id": "bigtable.googleapis.com",
12
-
"requires_billing": true
12
+
"requires_billing": true,
13
+
"samples": [
14
+
{"name": "Hello World in Cloud Bigtable",
15
+
"description": "Demonstrates how to connect to Cloud Bigtable and run some basic operations. More information available at: https://cloud.google.com/bigtable/docs/samples-python-hello",
16
+
"file": "main.py",
17
+
"runnable": true,
18
+
"custom_content": "<pre>usage: main.py [-h] [--table TABLE] project_id instance_id<br>Demonstrates how to connect to Cloud Bigtable and run some basic operations.<br>Prerequisites: - Create a Cloud Bigtable cluster.<br>https://cloud.google.com/bigtable/docs/creating-cluster - Set your Google<br>Application Default Credentials.<br>https://developers.google.com/identity/protocols/application-default-<br>credentials<br><br><br>positional arguments:<br> project_id Your Cloud Platform project ID.<br> instance_id ID of the Cloud Bigtable instance to connect to.<br><br><br>optional arguments:<br> -h, --help show this help message and exit<br> --table TABLE Table to create and destroy. (default: Hello-Bigtable)</pre>",
19
+
"override_path": "hello"},
20
+
21
+
{"name": "Hello World using HappyBase",
22
+
"description": "This sample demonstrates using the Google Cloud Client Library HappyBase package, an implementation of the HappyBase API to connect to and interact with Cloud Bigtable. More information available at: https://cloud.google.com/bigtable/docs/samples-python-hello-happybase",
23
+
"file": "main.py",
24
+
"runnable": true,
25
+
"custom_content": "<pre>usage: main.py [-h] [--table TABLE] project_id instance_id<br>Demonstrates how to connect to Cloud Bigtable and run some basic operations.<br>Prerequisites: - Create a Cloud Bigtable cluster.<br>https://cloud.google.com/bigtable/docs/creating-cluster - Set your Google<br>Application Default Credentials.<br>https://developers.google.com/identity/protocols/application-default-<br>credentials<br><br><br>positional arguments:<br> project_id Your Cloud Platform project ID.<br> instance_id ID of the Cloud Bigtable instance to connect to.<br><br><br>optional arguments:<br> -h, --help show this help message and exit<br> --table TABLE Table to create and destroy. (default: Hello-Bigtable)</pre>",
26
+
"override_path": "hello_happybase"},
27
+
28
+
{"name": "cbt Command Demonstration",
29
+
"description": "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. More information about this quickstart is available at https://cloud.google.com/bigtable/docs/quickstart-cbt",
30
+
"file": "instanceadmin.py",
31
+
"runnable": true,
32
+
"custom_content" : "<pre>usage: instanceadmin.py [-h] [run] [dev-instance] [del-instance] [add-cluster] [del-cluster] project_id instance_id cluster_id<br>Demonstrates how to connect to Cloud Bigtable and run some basic operations.<br>Prerequisites: - Create a Cloud Bigtable cluster.<br>https://cloud.google.com/bigtable/docs/creating-cluster - Set your Google<br>Application Default Credentials.<br>https://developers.google.com/identity/protocols/application-default-<br>credentials<br><br><br>positional arguments:<br> project_id Your Cloud Platform project ID.<br> instance_id ID of the Cloud Bigtable instance to connect to.<br><br><br>optional arguments:<br> -h, --help show this help message and exit<br> --table TABLE Table to create and destroy. (default: Hello-Bigtable)</pre>",
33
+
"override_path": "instanceadmin"},
34
+
35
+
{"name": "Metric Scaler",
36
+
"description": "This sample demonstrates how to use Stackdriver Monitoring to scale Cloud Bigtable based on CPU usage.",
37
+
"file": "metricscaler.py",
38
+
"runnable": true,
39
+
"custom_content": "<pre>usage: metricscaler.py [-h] [--high_cpu_threshold HIGH_CPU_THRESHOLD] [--low_cpu_threshold LOW_CPU_THRESHOLD] [--short_sleep SHORT_SLEEP] [--long_sleep LONG_SLEEP] bigtable_instance bigtable_cluster<br>usage: metricscaler.py [-h] [--high_cpu_threshold HIGH_CPU_THRESHOLD] <br> [--low_cpu_threshold LOW_CPU_THRESHOLD] <br> [--short_sleep SHORT_SLEEP] [--long_sleep LONG_SLEEP] <br> bigtable_instance bigtable_cluster <br><br> <br>Scales Cloud Bigtable clusters based on CPU usage. <br><br> <br>positional arguments: <br> bigtable_instance ID of the Cloud Bigtable instance to connect to. <br> bigtable_cluster ID of the Cloud Bigtable cluster to connect to. <br><br> <br>optional arguments: <br> -h, --help show this help message and exit <br> --high_cpu_threshold HIGH_CPU_THRESHOLD <br> If Cloud Bigtable CPU usage is above this threshold, <br> scale up <br> --low_cpu_threshold LOW_CPU_THRESHOLD <br> If Cloud Bigtable CPU usage is below this threshold, <br> scale down <br> --short_sleep SHORT_SLEEP <br> How long to sleep in seconds between checking metrics <br> after no scale operation <br> --long_sleep LONG_SLEEP <br> How long to sleep in seconds between checking metrics <br> after a scaling operation</pre>",
40
+
"override_path": "metricscaler"},
41
+
42
+
{"name": "Quickstart",
43
+
"description": "Demonstrates of Cloud Bigtable. This sample creates a Bigtable client, connects to an instance and then to a table, then closes the connection.",
44
+
"file": "main.py",
45
+
"runnable": true,
46
+
"custom_content": "<pre>usage: main.py [-h] [--table TABLE] project_id instance_id<br>usage: main.py [-h] [--table TABLE] project_id instance_id <br><br> <br>positional arguments: <br> project_id Your Cloud Platform project ID. <br> instance_id ID of the Cloud Bigtable instance to connect to. <br><br> <br>optional arguments: <br> -h, --help show this help message and exit <br> --table TABLE Existing table used in the quickstart. (default: my-table)</pre>",
47
+
"override_path": "quickstart"},
48
+
49
+
{"name": "Quickstart using HappyBase",
50
+
"description": "Demonstrates of Cloud Bigtable using HappyBase. This sample creates a Bigtable client, connects to an instance and then to a table, then closes the connection.",
51
+
"file": "main.py",
52
+
"runnable": true,
53
+
"custom_content": "<pre>usage: main.py [-h] [--table TABLE] project_id instance_id<br>usage: main.py [-h] [--table TABLE] project_id instance_id <br><br> <br>positional arguments: <br> project_id Your Cloud Platform project ID. <br> instance_id ID of the Cloud Bigtable instance to connect to. <br><br> <br>optional arguments: <br> -h, --help show this help message and exit <br> --table TABLE Existing table used in the quickstart. (default: my-table)</code",
54
+
"override_path": "quickstart_happybase"},
55
+
56
+
{"name": "Snippets",
57
+
"description": "This folder contains snippets for Python Cloud Bigtable.",
58
+
"override_path": "snippets"},
59
+
60
+
{"name": "Table Admin",
61
+
"description": "Demonstrates how to connect to Cloud Bigtable and run some basic operations.",
62
+
"file": "tableadmin.py",
63
+
"runnable": true,
64
+
"custom_content": "<pre>usage: tableadmin.py [-h] [run] [delete] [--table TABLE] project_id instance_id<br>usage: tableadmin.py [-h] [run] [delete] [--table TABLE] project_id instance_id <br><br> <br>Demonstrates how to connect to Cloud Bigtable and run some basic operations. <br>Prerequisites: - Create a Cloud Bigtable cluster. <br>https://cloud.google.com/bigtable/docs/creating-cluster - Set your Google <br>Application Default Credentials. <br>https://developers.google.com/identity/protocols/application-default- <br>credentials <br><br> <br>positional arguments: <br> project_id Your Cloud Platform project ID. <br> instance_id ID of the Cloud Bigtable instance to connect to. <br><br> <br>optional arguments: <br> -h, --help show this help message and exit <br> --table TABLE Table to create and destroy. (default: Hello-Bigtable)</pre>",
[//]: #"This README.md file is auto-generated, all changes to this file will be lost."
2
+
[//]: #"To regenerate it, use `python -m synthtool`."
3
+
4
+
## Python Samples for Cloud Bigtable
5
+
6
+
This directory contains samples for Cloud Bigtable, which may be used as a refererence for how to use Cloud Bigtable.
7
+
8
+
## Additional Information
9
+
10
+
You can read the documentation for more details on API usage and use GitHub
11
+
to [browse the source][source] and [report issues][issues].
12
+
13
+
### Contributing
14
+
For [contributing guidelines][contrib_guide], the [Python style guide][py_style], and more information on prerequisite steps to contribute, view the source code at <ahref="https://github.com/googleapis/python-bigtable">googleapis/python-bigtable</a>.
[//]: #"This README.md file is auto-generated, all changes to this file will be lost."
2
+
[//]: #"To regenerate it, use `python -m synthtool`."
3
+
4
+
## Python Samples for Cloud Bigtable
5
+
6
+
This directory contains samples for Cloud Bigtable, which may be used as a refererence for how to use Cloud Bigtable.
7
+
Samples, quickstarts, and other documentation are available at <ahref="https://cloud.google.com/bigtable">cloud.google.com</a>.
8
+
9
+
10
+
### Hello World in Cloud Bigtable
11
+
12
+
Demonstrates how to connect to Cloud Bigtable and run some basic operations. More information available at: https://cloud.google.com/bigtable/docs/samples-python-hello
13
+
14
+
15
+
<ahref="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/python-bigtable&page=editor&open_in_editor=main.py"><imgalt="Open in Cloud Shell"src="http://gstatic.com/cloudssh/images/open-btn.png">
16
+
</a>
17
+
18
+
To run this sample:
19
+
20
+
1. If this is your first time working with GCP products, you will need to set up [the Cloud SDK][cloud_sdk] or utilize [Google Cloud Shell][gcloud_shell]. This sample may [require authetication][authentication] and you will need to [enable billing][enable_billing].
21
+
22
+
1. Make a fork of this repo and clone the branch locally, then navigate to the sample directory you want to use.
23
+
24
+
1. Install the dependencies needed to run the samples.
25
+
26
+
pip install -r requirements.txt
27
+
28
+
1. Run the sample using
29
+
30
+
python main.py
31
+
32
+
33
+
<pre>usage: main.py [-h] [--table TABLE] project_id instance_id<br>Demonstrates how to connect to Cloud Bigtable and run some basic operations.<br>Prerequisites: - Create a Cloud Bigtable cluster.<br>https://cloud.google.com/bigtable/docs/creating-cluster - Set your Google<br>Application Default Credentials.<br>https://developers.google.com/identity/protocols/application-default-<br>credentials<br><br><br>positional arguments:<br> project_id Your Cloud Platform project ID.<br> instance_id ID of the Cloud Bigtable instance to connect to.<br><br><br>optional arguments:<br> -h, --help show this help message and exit<br> --table TABLE Table to create and destroy. (default: Hello-Bigtable)</pre>
34
+
35
+
## Additional Information
36
+
37
+
You can read the documentation for more details on API usage and use GitHub
38
+
to [browse the source][source] and [report issues][issues].
39
+
40
+
### Contributing
41
+
For [contributing guidelines][contrib_guide], the [Python style guide][py_style], and more information on prerequisite steps to contribute, view the source code at <ahref="https://github.com/googleapis/python-bigtable">googleapis/python-bigtable</a>.
0 commit comments