The Security Command Center API enables you to control whether asset discovery for Security Command Center is turned on or off for an organization. This guide shows you how to get an organization's current configuration settings and use the API to turn on asset discovery.
Asset discovery is not required unless you are using the deprecated asset functionality of the Security Command Center API or the asset-related Security Command Center commands of the Google Cloud CLI. Asset discovery does not affect the assets that are displayed on the Assets page.
The IAM roles for Security Command Center can be granted at the organization, folder, or project level. Your ability to view, edit, create, or update findings, assets, and security sources depends on the level for which you are granted access. To learn more about Security Command Center roles, see Access control.
Before you begin
Before you configure asset discovery, you need to authenticate with the Security Command Center API.
Getting organization settings configuration
Python
Java
Go
Node.js
Turning on asset discovery
The API call below uses a field mask so only the setting for asset discovery is turned on or off.