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

Function main

security-center/snippets/v1/getSource.js:21–40  ·  view source on GitHub ↗

* Demonstrates how to update fields on a security findings * source.

(sourceName = 'FULL_PATH_TO_SOURCE')

Source from the content-addressed store, hash-verified

19 * source.
20 */
21function main(sourceName = 'FULL_PATH_TO_SOURCE') {
22 // [START securitycenter_get_source]
23 // Imports the Google Cloud client library.
24 const {SecurityCenterClient} = require('@google-cloud/security-center');
25
26 // Creates a new client.
27 const client = new SecurityCenterClient();
28 // sourceName is the full resource name of the source to be retrieved.
29 /*
30 * TODO(developer): Uncomment the following lines
31 */
32 // const sourceName = "organizations/111122222444/sources/1234";
33 async function getSource() {
34 const [source] = await client.getSource({name: sourceName});
35 console.log('Source: %j', source);
36 }
37
38 getSource();
39 // [END securitycenter_get_source]
40}
41
42main(...process.argv.slice(2));

Callers 1

getSource.jsFile · 0.70

Calls 1

getSourceFunction · 0.70

Tested by

no test coverage detected