@@ -7,7 +7,7 @@ Google Data Loss Prevention Python Samples
7
7
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=dlp/README.rst
8
8
9
9
10
- This directory contains samples for Google Data Loss Prevention. `Google Data Loss Prevention `_ provides programmatic access to a powerful detection engine for personally identifiable information and other privacy-sensitive data in unstructured data streams. ** This api is currently in beta **.
10
+ This directory contains samples for Google Data Loss Prevention. `Google Data Loss Prevention `_ provides programmatic access to a powerful detection engine for personally identifiable information and other privacy-sensitive data in unstructured data streams.
11
11
12
12
13
13
@@ -59,7 +59,7 @@ Quickstart
59
59
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
60
60
61
61
.. image :: https://gstatic.com/cloudssh/images/open-btn.png
62
- :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=dlp/quickstart.py, dlp/README.rst
62
+ :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=dlp/quickstart.py; dlp/README.rst
63
63
64
64
65
65
@@ -75,7 +75,7 @@ Inspect Content
75
75
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
76
76
77
77
.. image :: https://gstatic.com/cloudssh/images/open-btn.png
78
- :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=dlp/inspect_content.py, dlp/README.rst
78
+ :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=dlp/inspect_content.py; dlp/README.rst
79
79
80
80
81
81
@@ -109,7 +109,7 @@ Redact Content
109
109
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
110
110
111
111
.. image :: https://gstatic.com/cloudssh/images/open-btn.png
112
- :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=dlp/redact.py, dlp/README.rst
112
+ :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=dlp/redact.py; dlp/README.rst
113
113
114
114
115
115
@@ -152,11 +152,11 @@ To run this sample:
152
152
153
153
154
154
155
- Display Metadata
155
+ Metadata
156
156
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
157
157
158
158
.. image:: https://gstatic.com/cloudssh/images/open-btn.png
159
- :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=dlp/metadata.py, dlp/README.rst
159
+ :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=dlp/metadata.py; dlp/README.rst
160
160
161
161
162
162
@@ -182,6 +182,168 @@ To run this sample:
182
182
183
183
184
184
185
+ Jobs
186
+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
187
+
188
+ .. image:: https://gstatic.com/cloudssh/images/open-btn.png
189
+ :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=dlp/jobs.py;dlp/README.rst
190
+
191
+
192
+
193
+
194
+ To run this sample:
195
+
196
+ .. code-block:: bash
197
+
198
+ $ python jobs.py
199
+
200
+ usage: jobs.py [-h] {list,delete} ...
201
+
202
+ Sample app to list and delete DLP jobs using the Data Loss Prevent API.
203
+
204
+ positional arguments:
205
+ {list,delete} Select how to submit content to the API.
206
+ list List Data Loss Prevention API jobs corresponding to a given
207
+ filter.
208
+ delete Delete results of a Data Loss Prevention API job.
209
+
210
+ optional arguments:
211
+ -h, --help show this help message and exit
212
+
213
+
214
+
215
+ Templates
216
+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
217
+
218
+ .. image:: https://gstatic.com/cloudssh/images/open-btn.png
219
+ :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=dlp/templates.py;dlp/README.rst
220
+
221
+
222
+
223
+
224
+ To run this sample:
225
+
226
+ .. code-block:: bash
227
+
228
+ $ python templates.py
229
+
230
+ usage: templates.py [-h] {create,list,delete} ...
231
+
232
+ Sample app that sets up Data Loss Prevention API inspect templates.
233
+
234
+ positional arguments:
235
+ {create,list,delete} Select which action to perform.
236
+ create Create a template.
237
+ list List all templates.
238
+ delete Delete a template.
239
+
240
+ optional arguments:
241
+ -h, --help show this help message and exit
242
+
243
+
244
+
245
+ Triggers
246
+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
247
+
248
+ .. image:: https://gstatic.com/cloudssh/images/open-btn.png
249
+ :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=dlp/triggers.py;dlp/README.rst
250
+
251
+
252
+
253
+
254
+ To run this sample:
255
+
256
+ .. code-block:: bash
257
+
258
+ $ python triggers.py
259
+
260
+ usage: triggers.py [-h] {create,list,delete} ...
261
+
262
+ Sample app that sets up Data Loss Prevention API automation triggers.
263
+
264
+ positional arguments:
265
+ {create,list,delete} Select which action to perform.
266
+ create Create a trigger.
267
+ list List all triggers.
268
+ delete Delete a trigger.
269
+
270
+ optional arguments:
271
+ -h, --help show this help message and exit
272
+
273
+
274
+
275
+ Risk Analysis
276
+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
277
+
278
+ .. image:: https://gstatic.com/cloudssh/images/open-btn.png
279
+ :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=dlp/risk.py;dlp/README.rst
280
+
281
+
282
+
283
+
284
+ To run this sample:
285
+
286
+ .. code-block:: bash
287
+
288
+ $ python risk.py
289
+
290
+ usage: risk.py [-h] {numerical,categorical,k_anonymity,l_diversity,k_map} ...
291
+
292
+ Sample app that uses the Data Loss Prevent API to perform risk anaylsis.
293
+
294
+ positional arguments:
295
+ {numerical,categorical,k_anonymity,l_diversity,k_map}
296
+ Select how to submit content to the API.
297
+ numerical
298
+ categorical
299
+ k_anonymity Computes the k-anonymity of a column set in a Google
300
+ BigQuerytable.
301
+ l_diversity Computes the l-diversity of a column set in a Google
302
+ BigQuerytable.
303
+ k_map Computes the k-map risk estimation of a column set in
304
+ a GoogleBigQuery table.
305
+
306
+ optional arguments:
307
+ -h, --help show this help message and exit
308
+
309
+
310
+
311
+ DeID
312
+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
313
+
314
+ .. image:: https://gstatic.com/cloudssh/images/open-btn.png
315
+ :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=dlp/deid.py;dlp/README.rst
316
+
317
+
318
+
319
+
320
+ To run this sample:
321
+
322
+ .. code-block:: bash
323
+
324
+ $ python deid.py
325
+
326
+ usage: deid.py [-h] {deid_mask,deid_fpe,reid_fpe,deid_date_shift} ...
327
+
328
+ Uses of the Data Loss Prevention API for deidentifying sensitive data.
329
+
330
+ positional arguments:
331
+ {deid_mask,deid_fpe,reid_fpe,deid_date_shift}
332
+ Select how to submit content to the API.
333
+ deid_mask Deidentify sensitive data in a string by masking it
334
+ with a character.
335
+ deid_fpe Deidentify sensitive data in a string using Format
336
+ Preserving Encryption (FPE).
337
+ reid_fpe Reidentify sensitive data in a string using Format
338
+ Preserving Encryption (FPE).
339
+ deid_date_shift Deidentify dates in a CSV file by pseudorandomly
340
+ shifting them.
341
+
342
+ optional arguments:
343
+ -h, --help show this help message and exit
344
+
345
+
346
+
185
347
186
348
187
349
The client library
0 commit comments