* Demonstrates how to update fields on a security findings * source.
(sourceName = 'FULL_PATH_TO_SOURCE')
| 19 | * source. |
| 20 | */ |
| 21 | function 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 | |
| 42 | main(...process.argv.slice(2)); |