-
Notifications
You must be signed in to change notification settings - Fork 57
chore: add samples to microgen #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
c5217f9
Update logging samples to fit new style guide and match Node.js sampl…
9401475
Fix test conflict.
c94e662
Fix logging test.
22afe69
Auto-update dependencies. [(#456)](https://github.com/GoogleCloudPlat…
dpebot 8ae5f10
Fix import order lint errors
052f3e5
Auto-update dependencies. [(#540)](https://github.com/GoogleCloudPlat…
dpebot f53c654
Auto-update dependencies. [(#542)](https://github.com/GoogleCloudPlat…
dpebot 49cf318
Move to google-cloud [(#544)](https://github.com/GoogleCloudPlatform/…
4271a02
Add new "quickstart" samples [(#547)](https://github.com/GoogleCloudP…
jmdobry 7024024
Quickstart tests [(#569)](https://github.com/GoogleCloudPlatform/pyth…
9aecaa2
Generate readmes for most service samples [(#599)](https://github.com…
957eb57
Update samples to support latest Google Cloud Python [(#656)](https:/…
d270cbf
Auto-update dependencies. [(#715)](https://github.com/GoogleCloudPlat…
dpebot ec152a2
Remove cloud config fixture [(#887)](https://github.com/GoogleCloudPl…
68078a3
Fix reference to our testing tools
006a15d
Auto-update dependencies. [(#914)](https://github.com/GoogleCloudPlat…
dpebot e387e65
Re-generate all readmes
aa308d6
Fix README rst links [(#962)](https://github.com/GoogleCloudPlatform/…
waprin 148d61e
Auto-update dependencies. [(#1004)](https://github.com/GoogleCloudPla…
dpebot 14786d6
Auto-update dependencies. [(#1055)](https://github.com/GoogleCloudPla…
dpebot 9dcd1e7
Fix logging tests
9c986cb
Auto-update dependencies. [(#1093)](https://github.com/GoogleCloudPla…
dpebot 5e1b0ef
Update all generated readme auth instructions [(#1121)](https://githu…
cc71331
Added Link to Python Setup Guide [(#1158)](https://github.com/GoogleC…
de4dbfa
Fix a few more lint issues
049f1fd
Auto-update dependencies. [(#1186)](https://github.com/GoogleCloudPla…
dpebot b1c379a
Add sample for standard library logging handler configuration [(#1233…
andrewsg 51a20c0
Added "Open in Cloud Shell" buttons to README files [(#1254)](https:/…
ef1fd81
Auto-update dependencies. [(#1359)](https://github.com/GoogleCloudPla…
dpebot 908af21
Auto-update dependencies. [(#1377)](https://github.com/GoogleCloudPla…
dpebot afa6c2e
Regenerate the README files and fix the Open in Cloud Shell link for …
cd2b128
Update READMEs to fix numbering and add git clone [(#1464)](https://g…
frankyn 12bf3da
Update logging doc tags. [(#1634)](https://github.com/GoogleCloudPlat…
SurferJeffAtGoogle 5262931
Fix deprecation warning [(#1801)](https://github.com/GoogleCloudPlatf…
andrewsg 8afd09d
Auto-update dependencies. [(#1846)](https://github.com/GoogleCloudPla…
dpebot c0fa69f
Auto-update dependencies. [(#1980)](https://github.com/GoogleCloudPla…
dpebot 3958331
Adds split updates for Firebase ... opencensus [(#2438)](https://gith…
gguuss 609284c
Auto-update dependencies. [(#2005)](https://github.com/GoogleCloudPla…
dpebot 10dab41
chore(deps): update dependency google-cloud-logging to v1.15.0 [(#316…
renovate-bot 6a53a84
Simplify noxfile setup. [(#2806)](https://github.com/GoogleCloudPlatf…
kurtisvg 5999d8e
[logging] chore: remove gcp-devrel-py-tools [(#3477)](https://github.…
ff2cea8
Update logging example to retrieve the default handler [(#3691)](http…
darrencarlton d6789bd
testing: various cleanups [(#3877)](https://github.com/GoogleCloudPla…
121d6df
chore(deps): update dependency pytest to v5.4.3 [(#4279)](https://git…
renovate-bot d28afc9
Update dependency pytest to v6 [(#4390)](https://github.com/GoogleClo…
renovate-bot be25bb0
chore(deps): update dependency google-cloud-logging to v1.15.1 [(#445…
renovate-bot a44921f
chore: update templates
busunkim96 2b57b0e
chore: remove multiprocessing note
busunkim96 fd8440a
Merge branch 'master' into microgen
busunkim96 ca80508
docs: fix samples README
busunkim96 d8ff32f
chore: regen samples noxfile
busunkim96 0d8437a
docs: remove stackdriver logging
busunkim96 eab2f26
chore: run formatter
busunkim96 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| #!/bin/bash | ||
| # Copyright 2020 Google LLC. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| set -eo pipefail | ||
|
|
||
| function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;} | ||
| function msg { println "$*" >&2 ;} | ||
| function println { printf '%s\n' "$(now) $*" ;} | ||
|
|
||
|
|
||
| # Populates requested secrets set in SECRET_MANAGER_KEYS from service account: | ||
| # kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com | ||
| SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" | ||
| msg "Creating folder on disk for secrets: ${SECRET_LOCATION}" | ||
| mkdir -p ${SECRET_LOCATION} | ||
| for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g") | ||
| do | ||
| msg "Retrieving secret ${key}" | ||
| docker run --entrypoint=gcloud \ | ||
| --volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \ | ||
| gcr.io/google.com/cloudsdktool/cloud-sdk \ | ||
| secrets versions access latest \ | ||
| --project cloud-devrel-kokoro-resources \ | ||
| --secret ${key} > \ | ||
| "${SECRET_LOCATION}/${key}" | ||
| if [[ $? == 0 ]]; then | ||
| msg "Secret written to ${SECRET_LOCATION}/${key}" | ||
| else | ||
| msg "Error retrieving secret ${key}" | ||
| fi | ||
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| See https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/CONTRIBUTING.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,172 @@ | ||
| .. This file is automatically generated. Do not edit this file directly. | ||
|
|
||
| Cloud Logging 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=logging/cloud-client/README.rst | ||
|
|
||
|
|
||
| This directory contains samples for Cloud Logging. `Cloud Logging`_ allows you to store, search, analyze, monitor, and alert on log data and events from Google Cloud Platform and Amazon Web Services. | ||
|
|
||
|
|
||
|
|
||
|
|
||
| .. _Cloud Logging: https://cloud.google.com/logging/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-logging and change directory to the sample directory you want to use. | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| $ git clone https://github.com/googleapis/python-logging.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=logging/cloud-client/quickstart.py,logging/cloud-client/README.rst | ||
|
|
||
|
|
||
|
|
||
|
|
||
| To run this sample: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| $ python quickstart.py | ||
|
|
||
|
|
||
| Snippets | ||
| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
|
|
||
| .. 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=logging/cloud-client/snippets.py,logging/cloud-client/README.rst | ||
|
|
||
|
|
||
|
|
||
|
|
||
| To run this sample: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| $ python snippets.py | ||
|
|
||
| usage: snippets.py [-h] logger_name {list,write,delete} ... | ||
|
|
||
| This application demonstrates how to perform basic operations on logs and | ||
| log entries with Cloud Logging. | ||
|
|
||
| For more information, see the README.md under /logging and the | ||
| documentation at https://cloud.google.com/logging/docs. | ||
|
|
||
| positional arguments: | ||
| logger_name Logger name | ||
| {list,write,delete} | ||
| list Lists the most recent entries for a given logger. | ||
| write Writes log entries to the given logger. | ||
| delete Deletes a logger and all its entries. Note that a | ||
| deletion can take several minutes to take effect. | ||
|
|
||
| optional arguments: | ||
| -h, --help show this help message and exit | ||
|
|
||
|
|
||
|
|
||
| Export | ||
| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
|
|
||
| .. 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=logging/cloud-client/export.py,logging/cloud-client/README.rst | ||
|
|
||
|
|
||
|
|
||
|
|
||
| To run this sample: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| $ python export.py | ||
|
|
||
| usage: export.py [-h] {list,create,update,delete} ... | ||
|
|
||
| positional arguments: | ||
| {list,create,update,delete} | ||
| list Lists all sinks. | ||
| create Lists all sinks. | ||
| update Changes a sink's filter. The filter determines which | ||
| logs this sink matches and will be exported to the | ||
| destination. For example a filter of 'severity>=INFO' | ||
| will send all logs that have a severity of INFO or | ||
| greater to the destination. See https://cloud.google.c | ||
| om/logging/docs/view/advanced_filters for more filter | ||
| information. | ||
| delete Deletes a sink. | ||
|
|
||
| optional arguments: | ||
| -h, --help show this help message and exit | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| The client library | ||
| ------------------------------------------------------------------------------- | ||
|
|
||
| This sample uses the `Google Cloud Client Library for Python`_. | ||
| You can read the documentation for more details on API usage and use GitHub | ||
| to `browse the source`_ and `report issues`_. | ||
|
|
||
| .. _Google Cloud Client Library for Python: | ||
| https://googlecloudplatform.github.io/google-cloud-python/ | ||
| .. _browse the source: | ||
| https://github.com/GoogleCloudPlatform/google-cloud-python | ||
| .. _report issues: | ||
| https://github.com/GoogleCloudPlatform/google-cloud-python/issues | ||
|
|
||
|
|
||
| .. _Google Cloud SDK: https://cloud.google.com/sdk/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # This file is used to generate README.rst | ||
|
|
||
| product: | ||
| name: Cloud Logging | ||
| short_name: Cloud Logging | ||
| url: https://cloud.google.com/logging/docs | ||
| description: > | ||
| `Cloud Logging`_ allows you to store, search, analyze, monitor, | ||
| and alert on log data and events from Google Cloud Platform and Amazon | ||
| Web Services. | ||
|
|
||
| setup: | ||
| - auth | ||
| - install_deps | ||
|
|
||
| samples: | ||
| - name: Quickstart | ||
| file: quickstart.py | ||
| - name: Snippets | ||
| file: snippets.py | ||
| show_help: true | ||
| - name: Export | ||
| file: export.py | ||
| show_help: true | ||
|
|
||
| cloud_client_library: true | ||
|
|
||
| folder: logging/cloud-client |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intentional? Won't this get overwritten by the upstream since we're now using synthtool for this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This session was duplicated on accident (see
docfxbelow)