MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / listJobs

Function listJobs

dlp/listJobs.js:39–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37 // The type of job to list (either 'INSPECT_JOB' or 'RISK_ANALYSIS_JOB')
38 // const jobType = 'INSPECT_JOB';
39 async function listJobs() {
40 // Construct request for listing DLP scan jobs
41 const request = {
42 parent: `projects/${projectId}/locations/global`,
43 filter: filter,
44 type: jobType,
45 };
46
47 // Run job-listing request
48 const [jobs] = await dlp.listDlpJobs(request);
49 jobs.forEach(job => {
50 console.log(`Job ${job.name} status: ${job.state}`);
51 });
52 }
53
54 listJobs();
55 // [END dlp_list_jobs]

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected