Skip to content

Commit 3075fc3

Browse files
authored
Merge branch 'main' into delete-schema
2 parents 21add44 + ea2995a commit 3075fc3

File tree

11 files changed

+925
-233
lines changed

11 files changed

+925
-233
lines changed

cloud-tasks/snippets/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ app.get('*', (req, res) => {
4141
});
4242

4343
const PORT = process.env.PORT || 8080;
44-
app.listen(process.env.PORT || 8080, () => {
44+
app.listen(PORT, () => {
4545
console.log(`App listening on port ${PORT}`);
4646
console.log('Press Ctrl+C to quit.');
4747
});

dlp/createStoredInfoType.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// title: Create stored infotype.
1919
// description: Uses the Data Loss Prevention API to create a stored infotype.
2020
// usage: node createStoredInfoType.js projectId infoTypeId, outputPath, dataProjectId, datasetId, tableId, fieldName
21-
function main(
21+
async function main(
2222
projectId,
2323
infoTypeId,
2424
outputPath,
@@ -99,7 +99,7 @@ function main(
9999
// Print results
100100
console.log(`InfoType stored successfully: ${response.name}`);
101101
}
102-
createStoredInfoType();
102+
await createStoredInfoType();
103103
// [END dlp_create_stored_infotype]
104104
}
105105

@@ -108,4 +108,7 @@ process.on('unhandledRejection', err => {
108108
process.exitCode = 1;
109109
});
110110

111-
main(...process.argv.slice(2));
111+
// TODO(developer): Please uncomment below line before running sample
112+
// main(...process.argv.slice(2));
113+
114+
module.exports = main;

dlp/inspectBigQuery.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// description: Inspects a BigQuery table using the Data Loss Prevention API using Pub/Sub for job notifications.
1818
// usage: node inspectBigQuery.js my-project dataProjectId datasetId tableId topicId subscriptionId minLikelihood maxFindings infoTypes customInfoTypes
1919

20-
function main(
20+
async function main(
2121
projectId,
2222
dataProjectId,
2323
datasetId,
@@ -158,11 +158,13 @@ function main(
158158
}
159159
}
160160

161-
inspectBigquery();
161+
await inspectBigquery();
162162
// [END dlp_inspect_bigquery]
163163
}
164164

165-
main(...process.argv.slice(2));
165+
// TODO(developer): Please uncomment below line before running sample
166+
// main(...process.argv.slice(2));
167+
166168
process.on('unhandledRejection', err => {
167169
console.error(err.message);
168170
process.exitCode = 1;
@@ -193,3 +195,5 @@ function transformCLI(infoTypes, customInfoTypes) {
193195

194196
return [infoTypes, customInfoTypes];
195197
}
198+
199+
module.exports = main;

dlp/inspectDatastore.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
// description: Inspect a Datastore instance using the Data Loss Prevention API using Pub/Sub for job notifications.
2020
// usage: node inspectDatastore.js my-project dataProjectId namespaceId kind topicId subscriptionId minLikelihood maxFindings infoTypes customInfoTypes
2121

22-
function main(
22+
async function main(
2323
projectId,
2424
dataProjectId,
2525
namespaceId,
@@ -161,11 +161,13 @@ function main(
161161
console.log('No findings.');
162162
}
163163
}
164-
inspectDatastore();
164+
await inspectDatastore();
165165
// [END dlp_inspect_datastore]
166166
}
167167

168-
main(...process.argv.slice(2));
168+
// TODO(developer): Please uncomment below line before running sample
169+
// main(...process.argv.slice(2));
170+
169171
process.on('unhandledRejection', err => {
170172
console.error(err.message);
171173
process.exitCode = 1;
@@ -196,3 +198,5 @@ function transformCLI(infoTypes, customInfoTypes) {
196198

197199
return [infoTypes, customInfoTypes];
198200
}
201+
202+
module.exports = main;

dlp/inspectGCSFile.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// description: Inspects a text file stored on Google Cloud Storage with the Data Loss Prevention API, using Pub/Sub for job notifications.
1818
// usage: node inspectGCSFile.js my-project filepath minLikelihood maxFindings infoTypes customInfoTypes includeQuote
1919

20-
function main(
20+
async function main(
2121
projectId,
2222
bucketName,
2323
fileName,
@@ -150,11 +150,13 @@ function main(
150150
console.log('No findings.');
151151
}
152152
}
153-
inspectGCSFile();
153+
await inspectGCSFile();
154154
// [END dlp_inspect_gcs]
155155
}
156156

157-
main(...process.argv.slice(2));
157+
// TODO(developer): Please uncomment below line before running sample
158+
// main(...process.argv.slice(2));
159+
158160
process.on('unhandledRejection', err => {
159161
console.error(err.message);
160162
process.exitCode = 1;
@@ -185,3 +187,5 @@ function transformCLI(infoTypes, customInfoTypes) {
185187

186188
return [infoTypes, customInfoTypes];
187189
}
190+
191+
module.exports = main;

0 commit comments

Comments
 (0)