From 7624359def115f02a4cc27ac72b619aeda6e89b4 Mon Sep 17 00:00:00 2001 From: Alexa B Date: Fri, 7 Aug 2020 14:11:43 -0400 Subject: [PATCH] docs: Generate using new common.py_samples() synthtool functionality (#35) * docs: Generate using new common.py_samples() synthtool functionality * docs: Generate using new common.py_samples() synthtool functionality * Delete old README * Updated README to remove duplicate info * Minor change --- kms/snippets/README.md | 54 +++++++++++++++++++++ kms/snippets/README.rst | 98 -------------------------------------- kms/snippets/README.rst.in | 19 -------- 3 files changed, 54 insertions(+), 117 deletions(-) create mode 100644 kms/snippets/README.md delete mode 100644 kms/snippets/README.rst delete mode 100644 kms/snippets/README.rst.in diff --git a/kms/snippets/README.md b/kms/snippets/README.md new file mode 100644 index 000000000000..f2bb82908a72 --- /dev/null +++ b/kms/snippets/README.md @@ -0,0 +1,54 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." + +## Python Samples for Google Cloud Key Management Service + +This directory contains samples for Google Cloud Key Management Service, which may be used as a refererence for how to use Google Cloud Key Management Service. +The Google Cloud KMS API is a service that allows you to keep encryption keys centrally in the cloud, for direct use by cloud services. More info about Cloud KMS can be found at https://cloud.google.com/kms/docs/ +Samples, quickstarts, and other documentation are available at cloud.google.com. + + +### Quickstart + +This quickstart shows you how to create and use encryption keys with Cloud Key Management Service. + + +Open in Cloud Shell + + +To run this sample: + +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]. + +1. Make a fork of this repo and clone the branch locally, then navigate to the sample directory you want to use. + +1. Install the dependencies needed to run the samples. + + pip install -r requirements.txt + +1. Run the sample using + + python quickstart.py + + +More information about the Cloud KMS quickstart is available at https://cloud.google.com/kms/docs/quickstart + +## Additional Information + +These samples use the [Google Cloud Client Library for Python][client_library_python]. +You can read the documentation for more details on API usage and use GitHub +to [browse the source][source] and [report issues][issues]. + +### Contributing +For [contributing guidelines][contrib_guide], the [Python style guide][py_style], and more information on prerequisite steps to contribute, view the source code at googleapis/python-kms. + +[authentication]: https://cloud.google.com/docs/authentication/getting-started +[enable_billing]:https://cloud.google.com/apis/docs/getting-started#enabling_billing +[client_library_python]: https://googlecloudplatform.github.io/google-cloud-python/ +[source]: https://github.com/GoogleCloudPlatform/google-cloud-python +[issues]: https://github.com/GoogleCloudPlatform/google-cloud-python/issues +[contrib_guide]: https://github.com/googleapis/google-cloud-python/blob/master/CONTRIBUTING.rst +[py_style]: http://google.github.io/styleguide/pyguide.html +[cloud_sdk]: https://cloud.google.com/sdk/docs +[gcloud_shell]: https://cloud.google.com/shell/docs +[gcloud_shell]: https://cloud.google.com/shell/docs diff --git a/kms/snippets/README.rst b/kms/snippets/README.rst deleted file mode 100644 index 7a52a0817bf3..000000000000 --- a/kms/snippets/README.rst +++ /dev/null @@ -1,98 +0,0 @@ - -.. This file is automatically generated. Do not edit this file directly. - -Google Cloud KMS API Python Samples -=============================================================================== - -.. image:: https://gstatic.com/cloudssh/images/open-btn.png - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=kms/api-client/README.rst - - -This directory contains samples for Google Cloud KMS API. The `Google Cloud KMS API`_ is a service that allows you to keep encryption keys centrally in the cloud, for direct use by cloud services. - - - - -.. _Google Cloud KMS API: https://cloud.google.com/kms/docs/ - - -Setup -------------------------------------------------------------------------------- - - - -Authentication -++++++++++++++ - -This sample requires you to have authentication setup. Refer to the -`Authentication Getting Started Guide`_ for instructions on setting up -credentials for applications. - -.. _Authentication Getting Started Guide: - https://cloud.google.com/docs/authentication/getting-started - - - - -Install Dependencies -++++++++++++++++++++ - -#. Clone python-docs-samples and change directory to the sample directory you want to use. - - .. code-block:: bash - - $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git - -#. 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. - - .. _Python Development Environment Setup Guide: - https://cloud.google.com/python/setup - -#. Create a virtualenv. Samples are compatible with Python 3.6+. - - .. code-block:: bash - - $ virtualenv env - $ source env/bin/activate - -#. Install the dependencies needed to run the samples. - - .. code-block:: bash - - $ pip install -r requirements.txt - -.. _pip: https://pip.pypa.io/ -.. _virtualenv: https://virtualenv.pypa.io/ - - - - - - -Samples -------------------------------------------------------------------------------- - - -Quickstart -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -.. image:: https://gstatic.com/cloudssh/images/open-btn.png - :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=kms/api-client/quickstart.py,kms/api-client/README.rst - - - - -To run this sample: - -.. code-block:: bash - - $ python quickstart.py - - - - - - - - -.. _Google Cloud SDK: https://cloud.google.com/sdk/ diff --git a/kms/snippets/README.rst.in b/kms/snippets/README.rst.in deleted file mode 100644 index cfd81fc800bd..000000000000 --- a/kms/snippets/README.rst.in +++ /dev/null @@ -1,19 +0,0 @@ -# This file is used to generate README.rst - -product: - name: Google Cloud KMS API - short_name: Cloud KMS API - url: https://cloud.google.com/kms/docs/ - description: > - The `Google Cloud KMS API`_ is a service that allows you to keep encryption - keys centrally in the cloud, for direct use by cloud services. - -setup: -- auth -- install_deps - -samples: -- name: Quickstart - file: quickstart.py - -folder: kms/api-client