|
1 | | -.. This file is automatically generated. Do not edit this file directly. |
| 1 | +These samples have been moved. |
2 | 2 |
|
3 | | -Cloud Logging Python Samples |
4 | | -=============================================================================== |
5 | | - |
6 | | -.. image:: https://gstatic.com/cloudssh/images/open-btn.png |
7 | | - :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 |
8 | | - |
9 | | - |
10 | | -This directory contains samples for `Cloud Logging`_, which you can use to store, search, analyze, monitor, and alert on log data and events from Google Cloud Platform and Amazon Web Services. |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | -.. _Cloud Logging: https://cloud.google.com/logging/docs |
16 | | - |
17 | | -Setup |
18 | | -------------------------------------------------------------------------------- |
19 | | - |
20 | | - |
21 | | -Authentication |
22 | | -++++++++++++++ |
23 | | - |
24 | | -This sample requires you to have authentication setup. Refer to the |
25 | | -`Authentication Getting Started Guide`_ for instructions on setting up |
26 | | -credentials for applications. |
27 | | - |
28 | | -.. _Authentication Getting Started Guide: |
29 | | - https://cloud.google.com/docs/authentication/getting-started |
30 | | - |
31 | | -Install Dependencies |
32 | | -++++++++++++++++++++ |
33 | | - |
34 | | -#. Clone python-docs-samples and change directory to the sample directory you want to use. |
35 | | - |
36 | | - .. code-block:: bash |
37 | | -
|
38 | | - $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git |
39 | | -
|
40 | | -#. 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. |
41 | | - |
42 | | - .. _Python Development Environment Setup Guide: |
43 | | - https://cloud.google.com/python/setup |
44 | | - |
45 | | -#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. |
46 | | - |
47 | | - .. code-block:: bash |
48 | | -
|
49 | | - $ virtualenv env |
50 | | - $ source env/bin/activate |
51 | | -
|
52 | | -#. Install the dependencies needed to run the samples. |
53 | | - |
54 | | - .. code-block:: bash |
55 | | -
|
56 | | - $ pip install -r requirements.txt |
57 | | -
|
58 | | -.. _pip: https://pip.pypa.io/ |
59 | | -.. _virtualenv: https://virtualenv.pypa.io/ |
60 | | - |
61 | | -Samples |
62 | | -------------------------------------------------------------------------------- |
63 | | - |
64 | | -Quickstart |
65 | | -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
66 | | - |
67 | | -.. image:: https://gstatic.com/cloudssh/images/open-btn.png |
68 | | - :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 |
69 | | - |
70 | | - |
71 | | - |
72 | | - |
73 | | -To run this sample: |
74 | | - |
75 | | -.. code-block:: bash |
76 | | -
|
77 | | - $ python quickstart.py |
78 | | -
|
79 | | -
|
80 | | -Snippets |
81 | | -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
82 | | - |
83 | | -.. image:: https://gstatic.com/cloudssh/images/open-btn.png |
84 | | - :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 |
85 | | - |
86 | | - |
87 | | - |
88 | | - |
89 | | -To run this sample: |
90 | | - |
91 | | -.. code-block:: bash |
92 | | -
|
93 | | - $ python snippets.py |
94 | | -
|
95 | | - usage: snippets.py [-h] logger_name {list,write,delete} ... |
96 | | -
|
97 | | - This application demonstrates how to perform basic operations on logs and |
98 | | - log entries with Cloud Logging. |
99 | | -
|
100 | | - For more information, see the README.md under /logging and the |
101 | | - documentation at https://cloud.google.com/logging/docs. |
102 | | -
|
103 | | - positional arguments: |
104 | | - logger_name Logger name |
105 | | - {list,write,delete} |
106 | | - list Lists the most recent entries for a given logger. |
107 | | - write Writes log entries to the given logger. |
108 | | - delete Deletes a logger and all its entries. Note that a |
109 | | - deletion can take several minutes to take effect. |
110 | | -
|
111 | | - optional arguments: |
112 | | - -h, --help show this help message and exit |
113 | | -
|
114 | | -
|
115 | | -
|
116 | | -Export |
117 | | -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
118 | | - |
119 | | -.. image:: https://gstatic.com/cloudssh/images/open-btn.png |
120 | | - :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 |
121 | | - |
122 | | - |
123 | | - |
124 | | - |
125 | | -To run this sample: |
126 | | - |
127 | | -.. code-block:: bash |
128 | | -
|
129 | | - $ python export.py |
130 | | -
|
131 | | - usage: export.py [-h] {list,create,update,delete} ... |
132 | | -
|
133 | | - positional arguments: |
134 | | - {list,create,update,delete} |
135 | | - list Lists all sinks. |
136 | | - create Lists all sinks. |
137 | | - update Changes a sink's filter. The filter determines which |
138 | | - logs this sink matches and will be exported to the |
139 | | - destination. For example a filter of 'severity>=INFO' |
140 | | - will send all logs that have a severity of INFO or |
141 | | - greater to the destination. See https://cloud.google.c |
142 | | - om/logging/docs/view/advanced_filters for more filter |
143 | | - information. |
144 | | - delete Deletes a sink. |
145 | | -
|
146 | | - optional arguments: |
147 | | - -h, --help show this help message and exit |
148 | | -
|
149 | | -
|
150 | | -
|
151 | | -
|
152 | | -
|
153 | | -The client library |
154 | | -------------------------------------------------------------------------------- |
155 | | -
|
156 | | -This sample uses the `Google Cloud Client Library for Python`_. |
157 | | -You can read the documentation for more details on API usage and use GitHub |
158 | | -to `browse the source`_ and `report issues`_. |
159 | | -
|
160 | | -.. _Google Cloud Client Library for Python: |
161 | | - https://googlecloudplatform.github.io/google-cloud-python/ |
162 | | -.. _browse the source: |
163 | | - https://github.com/GoogleCloudPlatform/google-cloud-python |
164 | | -.. _report issues: |
165 | | - https://github.com/GoogleCloudPlatform/google-cloud-python/issues |
166 | | -
|
167 | | -
|
168 | | -.. _Google Cloud SDK: https://cloud.google.com/sdk/ |
| 3 | +https://github.com/googleapis/python-logging/tree/master/samples |
0 commit comments