From 07e2920857852688b86f98f731568b6acb92a087 Mon Sep 17 00:00:00 2001 From: Anthony Date: Wed, 27 Jan 2021 13:45:13 -0800 Subject: [PATCH] docs: wrap samples with future prefix (#348) --- security-center/snippets/v1/addDeleteSecurityMarks.js | 2 ++ security-center/snippets/v1/addFindingSecurityMarks.js | 2 ++ security-center/snippets/v1/addSecurityMarks.js | 2 ++ security-center/snippets/v1/createFinding.js | 2 ++ security-center/snippets/v1/createFindingSourceProperties.js | 2 ++ security-center/snippets/v1/createNotificationConfig.js | 2 ++ security-center/snippets/v1/createSource.js | 2 ++ security-center/snippets/v1/deleteNotificationConfig.js | 2 ++ security-center/snippets/v1/deleteSecurityMarks.js | 2 ++ security-center/snippets/v1/enableAssetDiscovery.js | 2 ++ security-center/snippets/v1/getNotificationConfig.js | 2 ++ security-center/snippets/v1/getOrganizationSettings.js | 2 ++ security-center/snippets/v1/getSource.js | 2 ++ security-center/snippets/v1/getSourceIam.js | 2 ++ security-center/snippets/v1/listAllAssets.js | 2 ++ security-center/snippets/v1/listAllFindings.js | 2 ++ security-center/snippets/v1/listAllSources.js | 2 ++ security-center/snippets/v1/listAssetsAndChanges.js | 2 ++ security-center/snippets/v1/listAssetsAtTime.js | 2 ++ security-center/snippets/v1/listAssetsWithSecurityMarks.js | 2 ++ security-center/snippets/v1/listFilteredAssets.js | 2 ++ security-center/snippets/v1/listFilteredFindings.js | 2 ++ security-center/snippets/v1/listFindingsAtTime.js | 2 ++ security-center/snippets/v1/listFindingsWithSecurityMarks.js | 2 ++ security-center/snippets/v1/listNotificationConfigs.js | 2 ++ security-center/snippets/v1/receiveNotifications.js | 2 ++ security-center/snippets/v1/setFindingState.js | 2 ++ security-center/snippets/v1/setSourceIam.js | 2 ++ security-center/snippets/v1/testIam.js | 2 ++ security-center/snippets/v1/updateFindingSourceProperties.js | 2 ++ security-center/snippets/v1/updateNotificationConfig.js | 2 ++ security-center/snippets/v1/updateSource.js | 2 ++ 32 files changed, 64 insertions(+) diff --git a/security-center/snippets/v1/addDeleteSecurityMarks.js b/security-center/snippets/v1/addDeleteSecurityMarks.js index 74cf3115a2..45096eba6e 100644 --- a/security-center/snippets/v1/addDeleteSecurityMarks.js +++ b/security-center/snippets/v1/addDeleteSecurityMarks.js @@ -18,6 +18,7 @@ * marks from an asset. */ function main(assetName = 'full asset path to add marks to') { + // [START securitycenter_add_delete_security_marks] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -44,6 +45,7 @@ function main(assetName = 'full asset path to add marks to') { } addDeleteSecurityMarks(); // [END demo] + // [END securitycenter_add_delete_security_marks] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/addFindingSecurityMarks.js b/security-center/snippets/v1/addFindingSecurityMarks.js index 6117078f21..c1516de62e 100644 --- a/security-center/snippets/v1/addFindingSecurityMarks.js +++ b/security-center/snippets/v1/addFindingSecurityMarks.js @@ -17,6 +17,7 @@ * Demostrates adding security marks to a finding. */ function main(findingName = 'full finding path to add marks to') { + // [START securitycenter_add_finding_security_marks] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -44,6 +45,7 @@ function main(findingName = 'full finding path to add marks to') { } addFindingSecurityMarks(); // [END demo] + // [END securitycenter_add_finding_security_marks] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/addSecurityMarks.js b/security-center/snippets/v1/addSecurityMarks.js index 24d607c05d..ce68e5f025 100644 --- a/security-center/snippets/v1/addSecurityMarks.js +++ b/security-center/snippets/v1/addSecurityMarks.js @@ -18,6 +18,7 @@ * Demostrates adding security marks to an asset. */ function main(assetName = 'full asset path to add marks to') { + // [START securitycenter_add_security_marks] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -44,6 +45,7 @@ function main(assetName = 'full asset path to add marks to') { } addSecurityMarks(); // [END demo] + // [END securitycenter_add_security_marks] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/createFinding.js b/security-center/snippets/v1/createFinding.js index b91f580e09..5e8a7f8654 100644 --- a/security-center/snippets/v1/createFinding.js +++ b/security-center/snippets/v1/createFinding.js @@ -18,6 +18,7 @@ * Demonstrates how to create a new security finding in CSCC. */ function main(sourceName = 'FULL_PATH_TO_SOURCE_FOR_FINDING') { + // [START securitycenter_create_finding] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -56,6 +57,7 @@ function main(sourceName = 'FULL_PATH_TO_SOURCE_FOR_FINDING') { } createFinding(); // [END demo] + // [END securitycenter_create_finding] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/createFindingSourceProperties.js b/security-center/snippets/v1/createFindingSourceProperties.js index e63882c773..18f2a7e195 100644 --- a/security-center/snippets/v1/createFindingSourceProperties.js +++ b/security-center/snippets/v1/createFindingSourceProperties.js @@ -19,6 +19,7 @@ * properties. */ function main(sourceName = 'FULL_PATH_TO_SOURCE_FOR_FINDING') { + // [START securitycenter_create_finding_source_properties] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -61,6 +62,7 @@ function main(sourceName = 'FULL_PATH_TO_SOURCE_FOR_FINDING') { } createFinding(); // [END demo] + // [END securitycenter_create_finding_source_properties] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/createNotificationConfig.js b/security-center/snippets/v1/createNotificationConfig.js index 2edcb82543..d9539c2906 100644 --- a/security-center/snippets/v1/createNotificationConfig.js +++ b/security-center/snippets/v1/createNotificationConfig.js @@ -18,6 +18,7 @@ function main( configId = 'your-config-name', pubsubTopic = 'projects/{your-project}/topics/{your-topic}' ) { + // [START securitycenter_create_notification_config] // [START scc_create_notification_config] // npm install @google-cloud/security-center/ const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -46,6 +47,7 @@ function main( createNotificationConfig(); // [END scc_create_notification_config] + // [END securitycenter_create_notification_config] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/createSource.js b/security-center/snippets/v1/createSource.js index 8fcc7cded7..e96af5f7cb 100644 --- a/security-center/snippets/v1/createSource.js +++ b/security-center/snippets/v1/createSource.js @@ -18,6 +18,7 @@ * createSource demonstrates how to create a new security finding source. */ function main(organizationId = 'YOUR_NUMERIC_ORG_ID') { + // [START securitycenter_create_source] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -41,6 +42,7 @@ function main(organizationId = 'YOUR_NUMERIC_ORG_ID') { } createSource(); // [END demo] + // [END securitycenter_create_source] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/deleteNotificationConfig.js b/security-center/snippets/v1/deleteNotificationConfig.js index fc90afd2a2..19d413121d 100644 --- a/security-center/snippets/v1/deleteNotificationConfig.js +++ b/security-center/snippets/v1/deleteNotificationConfig.js @@ -14,6 +14,7 @@ 'use strict'; function main(organizationId = 'your-org-id', configId = 'your-config-id') { + // [START securitycenter_delete_notification_config] // [START scc_delete_notification_config] // npm install @google-cloud/security-center/ const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -34,6 +35,7 @@ function main(organizationId = 'your-org-id', configId = 'your-config-id') { deleteNotificationConfg(); // [END scc_delete_notification_config] + // [END securitycenter_delete_notification_config] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/deleteSecurityMarks.js b/security-center/snippets/v1/deleteSecurityMarks.js index de0811c3cf..a5a988711d 100644 --- a/security-center/snippets/v1/deleteSecurityMarks.js +++ b/security-center/snippets/v1/deleteSecurityMarks.js @@ -18,6 +18,7 @@ * Demostrates deleting security marks on an asset. */ function main(assetName = 'full asset path to add marks to') { + // [START securitycenter_delete_security_marks] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -44,6 +45,7 @@ function main(assetName = 'full asset path to add marks to') { } deleteSecurityMarks(); // [END demo] + // [END securitycenter_delete_security_marks] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/enableAssetDiscovery.js b/security-center/snippets/v1/enableAssetDiscovery.js index 617c432761..3fdd401161 100644 --- a/security-center/snippets/v1/enableAssetDiscovery.js +++ b/security-center/snippets/v1/enableAssetDiscovery.js @@ -18,6 +18,7 @@ * Demostrates enabling asset discovery for an organization. */ function main(organizationId = 'YOUR_NUMERIC_ORG_ID') { + // [START securitycenter_enable_asset_discovery] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -45,6 +46,7 @@ function main(organizationId = 'YOUR_NUMERIC_ORG_ID') { } updateOrgSettings(); // [END demo] + // [END securitycenter_enable_asset_discovery] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/getNotificationConfig.js b/security-center/snippets/v1/getNotificationConfig.js index f874e14167..2c3eadccca 100644 --- a/security-center/snippets/v1/getNotificationConfig.js +++ b/security-center/snippets/v1/getNotificationConfig.js @@ -14,6 +14,7 @@ 'use strict'; function main(organizationId = 'your-org-id', configId = 'your-config-id') { + // [START securitycenter_get_notification_configs] // [START scc_get_notification_configs] // npm install @google-cloud/security-center/ const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -36,6 +37,7 @@ function main(organizationId = 'your-org-id', configId = 'your-config-id') { getNotificationConfg(); // [END scc_get_notification_configs] + // [END securitycenter_get_notification_configs] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/getOrganizationSettings.js b/security-center/snippets/v1/getOrganizationSettings.js index 9ec421afb7..5d058920db 100644 --- a/security-center/snippets/v1/getOrganizationSettings.js +++ b/security-center/snippets/v1/getOrganizationSettings.js @@ -19,6 +19,7 @@ * includes the current status of asset recovery. */ function main(organizationId = 'YOUR_NUMERIC_ORG_ID') { + // [START securitycenter_get_organization_settings] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -41,6 +42,7 @@ function main(organizationId = 'YOUR_NUMERIC_ORG_ID') { } getOrgSettings(); // [END demo] + // [END securitycenter_get_organization_settings] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/getSource.js b/security-center/snippets/v1/getSource.js index 28be020833..4e0c855c51 100644 --- a/security-center/snippets/v1/getSource.js +++ b/security-center/snippets/v1/getSource.js @@ -19,6 +19,7 @@ * source. */ function main(sourceName = 'FULL_PATH_TO_SOURCE') { + // [START securitycenter_get_source] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -37,6 +38,7 @@ function main(sourceName = 'FULL_PATH_TO_SOURCE') { getSource(); // [END demo] + // [END securitycenter_get_source] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/getSourceIam.js b/security-center/snippets/v1/getSourceIam.js index 0dd157d9c2..4ff3ae2529 100644 --- a/security-center/snippets/v1/getSourceIam.js +++ b/security-center/snippets/v1/getSourceIam.js @@ -18,6 +18,7 @@ * Demostrates retrieving the current IAM policy for a source. */ function main(sourceName = 'FULL_PATH_TO_SOURCE') { + // [START securitycenter_get_source_iam] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -40,6 +41,7 @@ function main(sourceName = 'FULL_PATH_TO_SOURCE') { } getSourceIamPolicy(); // [END demo] + // [END securitycenter_get_source_iam] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/listAllAssets.js b/security-center/snippets/v1/listAllAssets.js index 99badddf48..32fb7e9b89 100644 --- a/security-center/snippets/v1/listAllAssets.js +++ b/security-center/snippets/v1/listAllAssets.js @@ -16,6 +16,7 @@ /** Prints all assets in an organization. */ function main(organizationId = 'YOUR_NUMERIC_ORG_ID') { + // [START securitycenter_list_all_assets] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -43,6 +44,7 @@ function main(organizationId = 'YOUR_NUMERIC_ORG_ID') { listAssets(); // [END demo] + // [END securitycenter_list_all_assets] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/listAllFindings.js b/security-center/snippets/v1/listAllFindings.js index 269aba9d9a..6e2ecdbc5a 100644 --- a/security-center/snippets/v1/listAllFindings.js +++ b/security-center/snippets/v1/listAllFindings.js @@ -16,6 +16,7 @@ /** Prints all findings across all sources. */ function main(organizationId = 'YOUR_NUMERIC_ORG_ID') { + // [START securitycenter_list_all_findings] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -42,6 +43,7 @@ function main(organizationId = 'YOUR_NUMERIC_ORG_ID') { } listAllFindings(); // [END demo] + // [END securitycenter_list_all_findings] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/listAllSources.js b/security-center/snippets/v1/listAllSources.js index 4b5b68d1b0..b8517623d8 100644 --- a/security-center/snippets/v1/listAllSources.js +++ b/security-center/snippets/v1/listAllSources.js @@ -16,6 +16,7 @@ /** Prints all sources in an organization. */ function main(organizationId = 'YOUR_NUMERIC_ORG_ID') { + // [START securitycenter_list_all_sources] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -40,6 +41,7 @@ function main(organizationId = 'YOUR_NUMERIC_ORG_ID') { listSources(); // [END demo] + // [END securitycenter_list_all_sources] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/listAssetsAndChanges.js b/security-center/snippets/v1/listAssetsAndChanges.js index 7712b8bbf7..a735462014 100644 --- a/security-center/snippets/v1/listAssetsAndChanges.js +++ b/security-center/snippets/v1/listAssetsAndChanges.js @@ -19,6 +19,7 @@ * days ago. */ function main(organizationId = 'YOUR_NUMERIC_ORG_ID') { + // [START securitycenter_list_assets_and_changes] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -51,6 +52,7 @@ function main(organizationId = 'YOUR_NUMERIC_ORG_ID') { listAssetsAndChanges(); // [END demo] + // [END securitycenter_list_assets_and_changes] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/listAssetsAtTime.js b/security-center/snippets/v1/listAssetsAtTime.js index f97f057fbc..042be1d6f9 100644 --- a/security-center/snippets/v1/listAssetsAtTime.js +++ b/security-center/snippets/v1/listAssetsAtTime.js @@ -18,6 +18,7 @@ * Prints project assets for the organization as of yesterday. */ function main(organizationId = 'YOUR_NUMERIC_ORG_ID') { + // [START securitycenter_list_assets_at_time] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -59,6 +60,7 @@ function main(organizationId = 'YOUR_NUMERIC_ORG_ID') { listAssetsAtTime(); // [END demo] + // [END securitycenter_list_assets_at_time] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/listAssetsWithSecurityMarks.js b/security-center/snippets/v1/listAssetsWithSecurityMarks.js index e263d41fb1..10035529b9 100644 --- a/security-center/snippets/v1/listAssetsWithSecurityMarks.js +++ b/security-center/snippets/v1/listAssetsWithSecurityMarks.js @@ -18,6 +18,7 @@ * Prints assets with security mark of key_a == value_a. */ function main(organizationId = 'YOUR_NUMERIC_ORG_ID') { + // [START securitycenter_list_assets_with_security_marks] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -49,6 +50,7 @@ function main(organizationId = 'YOUR_NUMERIC_ORG_ID') { listAssetsWithSecurityMarks(); // [END demo] + // [END securitycenter_list_assets_with_security_marks] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/listFilteredAssets.js b/security-center/snippets/v1/listFilteredAssets.js index 473fd6956c..2e8228c7c2 100644 --- a/security-center/snippets/v1/listFilteredAssets.js +++ b/security-center/snippets/v1/listFilteredAssets.js @@ -18,6 +18,7 @@ * Prints current project assets for the organization. */ function main(organizationId = 'YOUR_NUMERIC_ORG_ID') { + // [START securitycenter_list_filtered_assets] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -50,6 +51,7 @@ function main(organizationId = 'YOUR_NUMERIC_ORG_ID') { listFilteredAssets(); // [END demo] + // [END securitycenter_list_filtered_assets] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/listFilteredFindings.js b/security-center/snippets/v1/listFilteredFindings.js index e66c57c46b..8c616f002a 100644 --- a/security-center/snippets/v1/listFilteredFindings.js +++ b/security-center/snippets/v1/listFilteredFindings.js @@ -16,6 +16,7 @@ /** Demonstrates listing only specific findings. */ function main(sourceName = 'YOUR_NUMERIC_ORG_ID') { + // [START securitycenter_list_filtered_findings] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -44,6 +45,7 @@ function main(sourceName = 'YOUR_NUMERIC_ORG_ID') { } listFilteredFindings(); // [END demo] + // [END securitycenter_list_filtered_findings] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/listFindingsAtTime.js b/security-center/snippets/v1/listFindingsAtTime.js index 438d2def3d..3ead9c1c98 100644 --- a/security-center/snippets/v1/listFindingsAtTime.js +++ b/security-center/snippets/v1/listFindingsAtTime.js @@ -16,6 +16,7 @@ /** Demonstrates listing findings at a point in time. */ function main(sourceName = 'FULL RESOURCE PATH TO PARENT SOURCE') { + // [START securitycenter_list_findings_at_time] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -50,6 +51,7 @@ function main(sourceName = 'FULL RESOURCE PATH TO PARENT SOURCE') { } listFindingsAtTime(); // [END demo] + // [END securitycenter_list_findings_at_time] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/listFindingsWithSecurityMarks.js b/security-center/snippets/v1/listFindingsWithSecurityMarks.js index d7b2ede4be..3fca1cd24d 100644 --- a/security-center/snippets/v1/listFindingsWithSecurityMarks.js +++ b/security-center/snippets/v1/listFindingsWithSecurityMarks.js @@ -16,6 +16,7 @@ /** Demonstrates listing findings by filtering on security marks. */ function main(sourceName = 'YOUR_NUMERIC_ORG_ID') { + // [START securitycenter_list_findings_with_security_marks] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -44,6 +45,7 @@ function main(sourceName = 'YOUR_NUMERIC_ORG_ID') { } listFindingsWithSecurityMarks(); // [END demo] + // [END securitycenter_list_findings_with_security_marks] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/listNotificationConfigs.js b/security-center/snippets/v1/listNotificationConfigs.js index 00fe63dc2a..cca1fd77a7 100644 --- a/security-center/snippets/v1/listNotificationConfigs.js +++ b/security-center/snippets/v1/listNotificationConfigs.js @@ -14,6 +14,7 @@ 'use strict'; function main(organizationId = 'your-org-id') { + // [START securitycenter_list_notification_configs] // [START scc_list_notification_configs] // npm install @google-cloud/security-center/ const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -33,6 +34,7 @@ function main(organizationId = 'your-org-id') { listNotificationConfigs(); // [END scc_list_notification_configs] + // [END securitycenter_list_notification_configs] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/receiveNotifications.js b/security-center/snippets/v1/receiveNotifications.js index d9318853cf..e1ab9d0b55 100644 --- a/security-center/snippets/v1/receiveNotifications.js +++ b/security-center/snippets/v1/receiveNotifications.js @@ -17,6 +17,7 @@ function main( projectId = 'your-project-id', subscriptionId = 'your-subscription-id' ) { + // [START securitycenter_receive_notifications] // [START scc_receive_notifications] const {PubSub} = require('@google-cloud/pubsub'); const {StringDecoder} = require('string_decoder'); @@ -55,6 +56,7 @@ function main( listenForMessages(); // [END scc_receive_notifications] + // [END securitycenter_receive_notifications] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/setFindingState.js b/security-center/snippets/v1/setFindingState.js index a4e1b1fa60..090753bed6 100644 --- a/security-center/snippets/v1/setFindingState.js +++ b/security-center/snippets/v1/setFindingState.js @@ -19,6 +19,7 @@ * CSCC. */ function main(findingName = 'FULL_FINDING_PATH') { + // [START securitycenter_set_finding_state] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -48,6 +49,7 @@ function main(findingName = 'FULL_FINDING_PATH') { } setFindingState(); // [END demo] + // [END securitycenter_set_finding_state] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/setSourceIam.js b/security-center/snippets/v1/setSourceIam.js index a501ae95af..5e4f8f93f0 100644 --- a/security-center/snippets/v1/setSourceIam.js +++ b/security-center/snippets/v1/setSourceIam.js @@ -21,6 +21,7 @@ function main( sourceName = 'FULL_PATH_TO_SOURCE', user = 'someuser@domain.com' ) { + // [START securitycenter_set_source_iam] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -59,6 +60,7 @@ function main( } setSourceIamPolicy(); // [END demo] + // [END securitycenter_set_source_iam] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/testIam.js b/security-center/snippets/v1/testIam.js index 248075670a..35c081726e 100644 --- a/security-center/snippets/v1/testIam.js +++ b/security-center/snippets/v1/testIam.js @@ -19,6 +19,7 @@ * access to create and update findings. */ function main(sourceName = 'FULL_SOURCE_PATH') { + // [START securitycenter_test_iam] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -55,6 +56,7 @@ function main(sourceName = 'FULL_SOURCE_PATH') { } testIam(); // [END demo] + // [END securitycenter_test_iam] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/updateFindingSourceProperties.js b/security-center/snippets/v1/updateFindingSourceProperties.js index f4191e4da3..09532cd6b1 100644 --- a/security-center/snippets/v1/updateFindingSourceProperties.js +++ b/security-center/snippets/v1/updateFindingSourceProperties.js @@ -18,6 +18,7 @@ * Demonstrates how to update a security finding in CSCC. */ function main(findingName = 'FULL_FINDING_PATH') { + // [START securitycenter_update_finding_source_properties] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -54,6 +55,7 @@ function main(findingName = 'FULL_FINDING_PATH') { } updateFinding(); // [END demo] + // [END securitycenter_update_finding_source_properties] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/updateNotificationConfig.js b/security-center/snippets/v1/updateNotificationConfig.js index 4392f52a64..f745bce0d7 100644 --- a/security-center/snippets/v1/updateNotificationConfig.js +++ b/security-center/snippets/v1/updateNotificationConfig.js @@ -18,6 +18,7 @@ function main( configId = 'your-config-name', pubsubTopic = 'projects/{your-project}/topics/{your-topic}' ) { + // [START securitycenter_update_notification_config] // [START scc_update_notification_config] // npm install @google-cloud/security-center/ const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -51,6 +52,7 @@ function main( updateNotificationConfig(); // [END scc_update_notification_config] + // [END securitycenter_update_notification_config] } main(...process.argv.slice(2)); diff --git a/security-center/snippets/v1/updateSource.js b/security-center/snippets/v1/updateSource.js index 245910b612..fbb219e6be 100644 --- a/security-center/snippets/v1/updateSource.js +++ b/security-center/snippets/v1/updateSource.js @@ -19,6 +19,7 @@ * source. */ function main(sourceName = 'FULL_PATH_TO_SOURCE') { + // [START securitycenter_update_source] // [START demo] // Imports the Google Cloud client library. const {SecurityCenterClient} = require('@google-cloud/security-center'); @@ -45,6 +46,7 @@ function main(sourceName = 'FULL_PATH_TO_SOURCE') { updateSource(); // [END demo] + // [END securitycenter_update_source] } main(...process.argv.slice(2));