@@ -14,6 +14,15 @@ This directory contains samples for Google Data Loss Prevention. `Google Data Lo
14
14
15
15
.. _Google Data Loss Prevention : https://cloud.google.com/dlp/docs/
16
16
17
+ To run the sample, you need to enable the API at: https://console.cloud.google.com/apis/library/dlp.googleapis.com
18
+
19
+
20
+ To run the sample, you need to have the following roles:
21
+ * `DLP Administrator `
22
+ * `DLP API Service Agent `
23
+
24
+
25
+
17
26
Setup
18
27
-------------------------------------------------------------------------------
19
28
@@ -58,15 +67,6 @@ Install Dependencies
58
67
.. _pip : https://pip.pypa.io/
59
68
.. _virtualenv : https://virtualenv.pypa.io/
60
69
61
- #. For running *_test.py files, install test dependencies
62
-
63
- .. code-block :: bash
64
-
65
- $ pip install -r requirements-test.txt
66
- $ pytest inspect_content_test.py
67
-
68
- ** *_test.py files are demo wrappers and make API calls. You may get rate limited for making high number of requests. * *
69
-
70
70
Samples
71
71
-------------------------------------------------------------------------------
72
72
@@ -83,7 +83,7 @@ To run this sample:
83
83
84
84
.. code-block :: bash
85
85
86
- $ python quickstart.py < project-id >
86
+ $ python quickstart.py
87
87
88
88
89
89
Inspect Content
@@ -101,15 +101,16 @@ To run this sample:
101
101
102
102
$ python inspect_content.py
103
103
104
- usage: inspect_content.py [-h] {string,file,gcs,datastore,bigquery} ...
104
+ usage: inspect_content.py [-h] {string,table, file,gcs,datastore,bigquery} ...
105
105
106
106
Sample app that uses the Data Loss Prevention API to inspect a string, a local
107
107
file or a file on Google Cloud Storage.
108
108
109
109
positional arguments:
110
- {string,file,gcs,datastore,bigquery}
110
+ {string,table, file,gcs,datastore,bigquery}
111
111
Select how to submit content to the API.
112
112
string Inspect a string.
113
+ table Inspect a table.
113
114
file Inspect a local file.
114
115
gcs Inspect files on Google Cloud Storage.
115
116
datastore Inspect files on Google Datastore.
@@ -135,13 +136,14 @@ To run this sample:
135
136
136
137
$ python redact.py
137
138
138
- usage: redact.py [-h] [--project PROJECT] [--info_types INFO_TYPES]
139
+ usage: redact.py [-h] [--project PROJECT]
140
+ [--info_types INFO_TYPES [INFO_TYPES ...]]
139
141
[--min_likelihood {LIKELIHOOD_UNSPECIFIED,VERY_UNLIKELY,UNLIKELY,POSSIBLE,LIKELY,VERY_LIKELY}]
140
142
[--mime_type MIME_TYPE]
141
143
filename output_filename
142
144
143
- Sample app that uses the Data Loss Prevent API to redact the contents of a
144
- string or an image file.
145
+ Sample app that uses the Data Loss Prevent API to redact the contents of an
146
+ image file.
145
147
146
148
positional arguments:
147
149
filename The path to the file to inspect.
@@ -151,7 +153,7 @@ To run this sample:
151
153
-h , --help show this help message and exit
152
154
--project PROJECT The Google Cloud project id to use as a parent
153
155
resource.
154
- --info_types INFO_TYPES
156
+ --info_types INFO_TYPES [INFO_TYPES ...]
155
157
Strings representing info types to look for. A full
156
158
list of info categories and types is available from
157
159
the API. Examples include " FIRST_NAME" , " LAST_NAME" ,
0 commit comments