Reference documentation and code samples for the Google Cloud Security Command Center V2 Client class SecurityCenterClient.
Service Description: V2 APIs for Security Center service.
This class provides the ability to make remote calls to the backing service through method
calls that map to API methods.
Many parameters require resource names to be formatted in a particular way. To
assist with these names, this class includes a format method for each type of
name, and additionally a parseName method to extract the individual identifiers
contained within formatted names that are returned by the API.
Namespace
Google \ Cloud \ SecurityCenter \ V2 \ Client
Methods
__construct
Parameters |
Name |
Description |
options |
array
Optional. Options for configuring the service API wrapper.
|
↳ apiEndpoint |
string
The address of the API remote host. May optionally include the port, formatted as "
|
↳ credentials |
string|array|FetchAuthTokenInterface|CredentialsWrapper
The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored.
|
↳ credentialsConfig |
array
Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() .
|
↳ disableRetries |
bool
Determines whether or not retries defined by the client configuration should be disabled. Defaults to false .
|
↳ clientConfig |
string|array
Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder.
|
↳ transport |
string|TransportInterface
The transport used for executing network requests. May be either the string rest or grpc . Defaults to grpc if gRPC support is detected on the system. Advanced usage: Additionally, it is possible to pass in an already instantiated Google\ApiCore\Transport\TransportInterface object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.
|
↳ transportConfig |
array
Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options.
|
↳ clientCertSource |
callable
A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS.
|
batchCreateResourceValueConfigs
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\BatchCreateResourceValueConfigsRequest;
use Google\Cloud\SecurityCenter\V2\BatchCreateResourceValueConfigsResponse;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\CreateResourceValueConfigRequest;
use Google\Cloud\SecurityCenter\V2\ResourceValueConfig;
/**
* @param string $formattedParent Resource name of the new ResourceValueConfig's parent.
* The parent field in the CreateResourceValueConfigRequest
* messages must either be empty or match this field. Please see
* {@see SecurityCenterClient::organizationLocationName()} for help formatting this field.
* @param string $formattedRequestsParent Resource name of the new ResourceValueConfig's parent. Please see
* {@see SecurityCenterClient::organizationLocationName()} for help formatting this field.
*/
function batch_create_resource_value_configs_sample(
string $formattedParent,
string $formattedRequestsParent
): void {
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$requestsResourceValueConfig = new ResourceValueConfig();
$createResourceValueConfigRequest = (new CreateResourceValueConfigRequest())
->setParent($formattedRequestsParent)
->setResourceValueConfig($requestsResourceValueConfig);
$requests = [$createResourceValueConfigRequest,];
$request = (new BatchCreateResourceValueConfigsRequest())
->setParent($formattedParent)
->setRequests($requests);
// Call the API and handle any network failures.
try {
/** @var BatchCreateResourceValueConfigsResponse $response */
$response = $securityCenterClient->batchCreateResourceValueConfigs($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecurityCenterClient::organizationLocationName('[ORGANIZATION]', '[LOCATION]');
$formattedRequestsParent = SecurityCenterClient::organizationLocationName(
'[ORGANIZATION]',
'[LOCATION]'
);
batch_create_resource_value_configs_sample($formattedParent, $formattedRequestsParent);
}
bulkMuteFindings
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecurityCenter\V2\BulkMuteFindingsRequest;
use Google\Cloud\SecurityCenter\V2\BulkMuteFindingsResponse;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Rpc\Status;
/**
* @param string $parent The parent, at which bulk action needs to be applied. If no
* location is specified, findings are updated in global. The following list
* shows some examples:
*
* + `organizations/[organization_id]`
* + `organizations/[organization_id]/locations/[location_id]`
* + `folders/[folder_id]`
* + `folders/[folder_id]/locations/[location_id]`
* + `projects/[project_id]`
* + `projects/[project_id]/locations/[location_id]`
*/
function bulk_mute_findings_sample(string $parent): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new BulkMuteFindingsRequest())
->setParent($parent);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $securityCenterClient->bulkMuteFindings($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var BulkMuteFindingsResponse $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$parent = '[PARENT]';
bulk_mute_findings_sample($parent);
}
createBigQueryExport
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\BigQueryExport;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\CreateBigQueryExportRequest;
/**
* @param string $formattedParent The name of the parent resource of the new BigQuery export. Its
* format is `organizations/[organization_id]/locations/[location_id]`,
* `folders/[folder_id]/locations/[location_id]`, or
* `projects/[project_id]/locations/[location_id]`. Please see
* {@see SecurityCenterClient::organizationLocationName()} for help formatting this field.
* @param string $bigQueryExportId Unique identifier provided by the client within the parent scope.
* It must consist of only lowercase letters, numbers, and hyphens, must start
* with a letter, must end with either a letter or a number, and must be 63
* characters or less.
*/
function create_big_query_export_sample(string $formattedParent, string $bigQueryExportId): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$bigQueryExport = new BigQueryExport();
$request = (new CreateBigQueryExportRequest())
->setParent($formattedParent)
->setBigQueryExport($bigQueryExport)
->setBigQueryExportId($bigQueryExportId);
// Call the API and handle any network failures.
try {
/** @var BigQueryExport $response */
$response = $securityCenterClient->createBigQueryExport($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecurityCenterClient::organizationLocationName('[ORGANIZATION]', '[LOCATION]');
$bigQueryExportId = '[BIG_QUERY_EXPORT_ID]';
create_big_query_export_sample($formattedParent, $bigQueryExportId);
}
createFinding
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\CreateFindingRequest;
use Google\Cloud\SecurityCenter\V2\Finding;
/**
* @param string $formattedParent Resource name of the new finding's parent. The following list
* shows some examples of the format:
* +
* `organizations/[organization_id]/sources/[source_id]`
* +
* `organizations/[organization_id]/sources/[source_id]/locations/[location_id]`
* Please see {@see SecurityCenterClient::sourceName()} for help formatting this field.
* @param string $findingId Unique identifier provided by the client within the parent scope.
* It must be alphanumeric and less than or equal to 32 characters and
* greater than 0 characters in length.
*/
function create_finding_sample(string $formattedParent, string $findingId): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$finding = new Finding();
$request = (new CreateFindingRequest())
->setParent($formattedParent)
->setFindingId($findingId)
->setFinding($finding);
// Call the API and handle any network failures.
try {
/** @var Finding $response */
$response = $securityCenterClient->createFinding($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecurityCenterClient::sourceName('[ORGANIZATION]', '[SOURCE]');
$findingId = '[FINDING_ID]';
create_finding_sample($formattedParent, $findingId);
}
createMuteConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\CreateMuteConfigRequest;
use Google\Cloud\SecurityCenter\V2\MuteConfig;
use Google\Cloud\SecurityCenter\V2\MuteConfig\MuteConfigType;
/**
* @param string $formattedParent Resource name of the new mute configs's parent. Its format is
* `organizations/[organization_id]/locations/[location_id]`,
* `folders/[folder_id]/locations/[location_id]`, or
* `projects/[project_id]/locations/[location_id]`. Please see
* {@see SecurityCenterClient::organizationLocationName()} for help formatting this field.
* @param string $muteConfigFilter An expression that defines the filter to apply across
* create/update events of findings. While creating a filter string, be
* mindful of the scope in which the mute configuration is being created.
* E.g., If a filter contains project = X but is created under the project = Y
* scope, it might not match any findings.
*
* The following field and operator combinations are supported:
*
* * severity: `=`, `:`
* * category: `=`, `:`
* * resource.name: `=`, `:`
* * resource.project_name: `=`, `:`
* * resource.project_display_name: `=`, `:`
* * resource.folders.resource_folder: `=`, `:`
* * resource.parent_name: `=`, `:`
* * resource.parent_display_name: `=`, `:`
* * resource.type: `=`, `:`
* * finding_class: `=`, `:`
* * indicator.ip_addresses: `=`, `:`
* * indicator.domains: `=`, `:`
* @param int $muteConfigType The type of the mute config, which determines what type of mute
* state the config affects. Immutable after creation.
* @param string $muteConfigId Unique identifier provided by the client within the parent scope.
* It must consist of only lowercase letters, numbers, and hyphens, must start
* with a letter, must end with either a letter or a number, and must be 63
* characters or less.
*/
function create_mute_config_sample(
string $formattedParent,
string $muteConfigFilter,
int $muteConfigType,
string $muteConfigId
): void {
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$muteConfig = (new MuteConfig())
->setFilter($muteConfigFilter)
->setType($muteConfigType);
$request = (new CreateMuteConfigRequest())
->setParent($formattedParent)
->setMuteConfig($muteConfig)
->setMuteConfigId($muteConfigId);
// Call the API and handle any network failures.
try {
/** @var MuteConfig $response */
$response = $securityCenterClient->createMuteConfig($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecurityCenterClient::organizationLocationName('[ORGANIZATION]', '[LOCATION]');
$muteConfigFilter = '[FILTER]';
$muteConfigType = MuteConfigType::MUTE_CONFIG_TYPE_UNSPECIFIED;
$muteConfigId = '[MUTE_CONFIG_ID]';
create_mute_config_sample($formattedParent, $muteConfigFilter, $muteConfigType, $muteConfigId);
}
createNotificationConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\CreateNotificationConfigRequest;
use Google\Cloud\SecurityCenter\V2\NotificationConfig;
/**
* @param string $formattedParent Resource name of the new notification config's parent. Its format
* is `organizations/[organization_id]/locations/[location_id]`,
* `folders/[folder_id]/locations/[location_id]`, or
* `projects/[project_id]/locations/[location_id]`. Please see
* {@see SecurityCenterClient::organizationLocationName()} for help formatting this field.
* @param string $configId Required.
* Unique identifier provided by the client within the parent scope.
* It must be between 1 and 128 characters and contain alphanumeric
* characters, underscores, or hyphens only.
*/
function create_notification_config_sample(string $formattedParent, string $configId): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$notificationConfig = new NotificationConfig();
$request = (new CreateNotificationConfigRequest())
->setParent($formattedParent)
->setConfigId($configId)
->setNotificationConfig($notificationConfig);
// Call the API and handle any network failures.
try {
/** @var NotificationConfig $response */
$response = $securityCenterClient->createNotificationConfig($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecurityCenterClient::organizationLocationName('[ORGANIZATION]', '[LOCATION]');
$configId = '[CONFIG_ID]';
create_notification_config_sample($formattedParent, $configId);
}
createSource
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\CreateSourceRequest;
use Google\Cloud\SecurityCenter\V2\Source;
/**
* @param string $formattedParent Resource name of the new source's parent. Its format should be
* `organizations/[organization_id]`. Please see
* {@see SecurityCenterClient::organizationName()} for help formatting this field.
*/
function create_source_sample(string $formattedParent): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$source = new Source();
$request = (new CreateSourceRequest())
->setParent($formattedParent)
->setSource($source);
// Call the API and handle any network failures.
try {
/** @var Source $response */
$response = $securityCenterClient->createSource($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecurityCenterClient::organizationName('[ORGANIZATION]');
create_source_sample($formattedParent);
}
deleteBigQueryExport
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\DeleteBigQueryExportRequest;
/**
* @param string $formattedName The name of the BigQuery export to delete. The following list
* shows some examples of the format:
*
* +
* `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}`
* + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}`
* + `projects/{project}/locations/{location}/bigQueryExports/{export_id}`
* Please see {@see SecurityCenterClient::bigQueryExportName()} for help formatting this field.
*/
function delete_big_query_export_sample(string $formattedName): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new DeleteBigQueryExportRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$securityCenterClient->deleteBigQueryExport($request);
printf('Call completed successfully.' . PHP_EOL);
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecurityCenterClient::bigQueryExportName(
'[ORGANIZATION]',
'[LOCATION]',
'[EXPORT]'
);
delete_big_query_export_sample($formattedName);
}
deleteMuteConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\DeleteMuteConfigRequest;
/**
* @param string $formattedName Name of the mute config to delete. The following list shows some
* examples of the format:
*
* + `organizations/{organization}/muteConfigs/{config_id}`
* +
* `organizations/{organization}/locations/{location}/muteConfigs/{config_id}`
* + `folders/{folder}/muteConfigs/{config_id}`
* + `folders/{folder}/locations/{location}/muteConfigs/{config_id}`
* + `projects/{project}/muteConfigs/{config_id}`
* + `projects/{project}/locations/{location}/muteConfigs/{config_id}`
* Please see {@see SecurityCenterClient::muteConfigName()} for help formatting this field.
*/
function delete_mute_config_sample(string $formattedName): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new DeleteMuteConfigRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$securityCenterClient->deleteMuteConfig($request);
printf('Call completed successfully.' . PHP_EOL);
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecurityCenterClient::muteConfigName('[ORGANIZATION]', '[MUTE_CONFIG]');
delete_mute_config_sample($formattedName);
}
deleteNotificationConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\DeleteNotificationConfigRequest;
/**
* @param string $formattedName Name of the notification config to delete. The following list
* shows some examples of the format:
*
* +
* `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]`
* +
* `folders/[folder_id]/locations/[location_id]notificationConfigs/[config_id]`
* +
* `projects/[project_id]/locations/[location_id]notificationConfigs/[config_id]`
* Please see {@see SecurityCenterClient::notificationConfigName()} for help formatting this field.
*/
function delete_notification_config_sample(string $formattedName): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new DeleteNotificationConfigRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$securityCenterClient->deleteNotificationConfig($request);
printf('Call completed successfully.' . PHP_EOL);
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecurityCenterClient::notificationConfigName(
'[ORGANIZATION]',
'[LOCATION]',
'[NOTIFICATION_CONFIG]'
);
delete_notification_config_sample($formattedName);
}
deleteResourceValueConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\DeleteResourceValueConfigRequest;
/**
* @param string $formattedName Name of the ResourceValueConfig to delete
* Please see {@see SecurityCenterClient::resourceValueConfigName()} for help formatting this field.
*/
function delete_resource_value_config_sample(string $formattedName): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new DeleteResourceValueConfigRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$securityCenterClient->deleteResourceValueConfig($request);
printf('Call completed successfully.' . PHP_EOL);
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecurityCenterClient::resourceValueConfigName(
'[ORGANIZATION]',
'[RESOURCE_VALUE_CONFIG]'
);
delete_resource_value_config_sample($formattedName);
}
getBigQueryExport
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\BigQueryExport;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\GetBigQueryExportRequest;
/**
* @param string $formattedName Name of the BigQuery export to retrieve. The following list shows
* some examples of the format:
*
* +
* `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}`
* + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}`
* + `projects/{project}locations/{location}//bigQueryExports/{export_id}`
* Please see {@see SecurityCenterClient::bigQueryExportName()} for help formatting this field.
*/
function get_big_query_export_sample(string $formattedName): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new GetBigQueryExportRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var BigQueryExport $response */
$response = $securityCenterClient->getBigQueryExport($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecurityCenterClient::bigQueryExportName(
'[ORGANIZATION]',
'[LOCATION]',
'[EXPORT]'
);
get_big_query_export_sample($formattedName);
}
getIamPolicy
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
/**
* @param string $resource REQUIRED: The resource for which the policy is being requested.
* See the operation documentation for the appropriate value for this field.
*/
function get_iam_policy_sample(string $resource): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new GetIamPolicyRequest())
->setResource($resource);
// Call the API and handle any network failures.
try {
/** @var Policy $response */
$response = $securityCenterClient->getIamPolicy($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$resource = '[RESOURCE]';
get_iam_policy_sample($resource);
}
getMuteConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\GetMuteConfigRequest;
use Google\Cloud\SecurityCenter\V2\MuteConfig;
/**
* @param string $formattedName Name of the mute config to retrieve. The following list shows
* some examples of the format:
*
* + `organizations/{organization}/muteConfigs/{config_id}`
* +
* `organizations/{organization}/locations/{location}/muteConfigs/{config_id}`
* + `folders/{folder}/muteConfigs/{config_id}`
* + `folders/{folder}/locations/{location}/muteConfigs/{config_id}`
* + `projects/{project}/muteConfigs/{config_id}`
* + `projects/{project}/locations/{location}/muteConfigs/{config_id}`
* Please see {@see SecurityCenterClient::muteConfigName()} for help formatting this field.
*/
function get_mute_config_sample(string $formattedName): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new GetMuteConfigRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var MuteConfig $response */
$response = $securityCenterClient->getMuteConfig($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecurityCenterClient::muteConfigName('[ORGANIZATION]', '[MUTE_CONFIG]');
get_mute_config_sample($formattedName);
}
getNotificationConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\GetNotificationConfigRequest;
use Google\Cloud\SecurityCenter\V2\NotificationConfig;
/**
* @param string $formattedName Name of the notification config to get. The following list shows
* some examples of the format:
*
* +
* `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]`
* +
* `folders/[folder_id]/locations/[location_id]/notificationConfigs/[config_id]`
* +
* `projects/[project_id]/locations/[location_id]/notificationConfigs/[config_id]`
* Please see {@see SecurityCenterClient::notificationConfigName()} for help formatting this field.
*/
function get_notification_config_sample(string $formattedName): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new GetNotificationConfigRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var NotificationConfig $response */
$response = $securityCenterClient->getNotificationConfig($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecurityCenterClient::notificationConfigName(
'[ORGANIZATION]',
'[LOCATION]',
'[NOTIFICATION_CONFIG]'
);
get_notification_config_sample($formattedName);
}
getResourceValueConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\GetResourceValueConfigRequest;
use Google\Cloud\SecurityCenter\V2\ResourceValueConfig;
/**
* @param string $formattedName Name of the resource value config to retrieve. Its format is
* organizations/{organization}/resourceValueConfigs/{config_id}. Please see
* {@see SecurityCenterClient::resourceValueConfigName()} for help formatting this field.
*/
function get_resource_value_config_sample(string $formattedName): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new GetResourceValueConfigRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var ResourceValueConfig $response */
$response = $securityCenterClient->getResourceValueConfig($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecurityCenterClient::resourceValueConfigName(
'[ORGANIZATION]',
'[RESOURCE_VALUE_CONFIG]'
);
get_resource_value_config_sample($formattedName);
}
getSimulation
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\GetSimulationRequest;
use Google\Cloud\SecurityCenter\V2\Simulation;
/**
* @param string $formattedName The organization name or simulation name of this simulation
*
* Valid format:
* `organizations/{organization}/simulations/latest`
* `organizations/{organization}/simulations/{simulation}`
* Please see {@see SecurityCenterClient::simulationName()} for help formatting this field.
*/
function get_simulation_sample(string $formattedName): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new GetSimulationRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Simulation $response */
$response = $securityCenterClient->getSimulation($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecurityCenterClient::simulationName('[ORGANIZATION]', '[SIMULATION]');
get_simulation_sample($formattedName);
}
getSource
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\GetSourceRequest;
use Google\Cloud\SecurityCenter\V2\Source;
/**
* @param string $formattedName Relative resource name of the source. Its format is
* `organizations/[organization_id]/source/[source_id]`. Please see
* {@see SecurityCenterClient::sourceName()} for help formatting this field.
*/
function get_source_sample(string $formattedName): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new GetSourceRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Source $response */
$response = $securityCenterClient->getSource($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecurityCenterClient::sourceName('[ORGANIZATION]', '[SOURCE]');
get_source_sample($formattedName);
}
getValuedResource
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\GetValuedResourceRequest;
use Google\Cloud\SecurityCenter\V2\ValuedResource;
/**
* @param string $formattedName The name of this valued resource
*
* Valid format:
* `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}`
* Please see {@see SecurityCenterClient::valuedResourceName()} for help formatting this field.
*/
function get_valued_resource_sample(string $formattedName): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new GetValuedResourceRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var ValuedResource $response */
$response = $securityCenterClient->getValuedResource($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecurityCenterClient::valuedResourceName(
'[ORGANIZATION]',
'[SIMULATION]',
'[VALUED_RESOURCE]'
);
get_valued_resource_sample($formattedName);
}
groupFindings
Filters an organization or source's findings and groups them by their
specified properties in a location. If no location is specified, findings
are assumed to be in global
To group across all sources provide a -
as the source id.
The following list shows some examples:
/v2/organizations/{organization_id}/sources/-/findings
+
/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings
/v2/folders/{folder_id}/sources/-/findings
/v2/folders/{folder_id}/sources/-/locations/{location_id}/findings
/v2/projects/{project_id}/sources/-/findings
/v2/projects/{project_id}/sources/-/locations/{location_id}/findings
The async variant is Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient::groupFindingsAsync() .
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\GroupFindingsRequest;
use Google\Cloud\SecurityCenter\V2\GroupResult;
/**
* @param string $formattedParent Name of the source to groupBy. If no location is specified,
* finding is assumed to be in global.
* The following list shows some examples:
*
* + `organizations/[organization_id]/sources/[source_id]`
* +
* `organizations/[organization_id]/sources/[source_id]/locations/[location_id]`
* + `folders/[folder_id]/sources/[source_id]`
* + `folders/[folder_id]/sources/[source_id]/locations/[location_id]`
* + `projects/[project_id]/sources/[source_id]`
* + `projects/[project_id]/sources/[source_id]/locations/[location_id]`
*
* To groupBy across all sources provide a source_id of `-`. The following
* list shows some examples:
*
* + `organizations/{organization_id}/sources/-`
* + `organizations/{organization_id}/sources/-/locations/[location_id]`
* + `folders/{folder_id}/sources/-`
* + `folders/{folder_id}/sources/-/locations/[location_id]`
* + `projects/{project_id}/sources/-`
* + `projects/{project_id}/sources/-/locations/[location_id]`
* Please see {@see SecurityCenterClient::sourceName()} for help formatting this field.
* @param string $groupBy Expression that defines what assets fields to use for grouping.
* The string value should follow SQL syntax: comma separated list of fields.
* For example: "parent,resource_name".
*/
function group_findings_sample(string $formattedParent, string $groupBy): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new GroupFindingsRequest())
->setParent($formattedParent)
->setGroupBy($groupBy);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $securityCenterClient->groupFindings($request);
/** @var GroupResult $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecurityCenterClient::sourceName('[ORGANIZATION]', '[SOURCE]');
$groupBy = '[GROUP_BY]';
group_findings_sample($formattedParent, $groupBy);
}
listAttackPaths
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\SecurityCenter\V2\AttackPath;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\ListAttackPathsRequest;
/**
* @param string $formattedParent Name of parent to list attack paths.
*
* Valid formats:
* `organizations/{organization}`,
* `organizations/{organization}/simulations/{simulation}`
* `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}`
* `organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}`
* Please see {@see SecurityCenterClient::organizationValuedResourceName()} for help formatting this field.
*/
function list_attack_paths_sample(string $formattedParent): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new ListAttackPathsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $securityCenterClient->listAttackPaths($request);
/** @var AttackPath $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecurityCenterClient::organizationValuedResourceName(
'[ORGANIZATION]',
'[LOCATION]',
'[SIMULATION]',
'[VALUED_RESOURCE]'
);
list_attack_paths_sample($formattedParent);
}
listBigQueryExports
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\SecurityCenter\V2\BigQueryExport;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\ListBigQueryExportsRequest;
/**
* @param string $formattedParent The parent, which owns the collection of BigQuery exports. Its
* format is `organizations/[organization_id]/locations/[location_id]`,
* `folders/[folder_id]/locations/[location_id]`, or
* `projects/[project_id]/locations/[location_id]`. Please see
* {@see SecurityCenterClient::organizationLocationName()} for help formatting this field.
*/
function list_big_query_exports_sample(string $formattedParent): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new ListBigQueryExportsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $securityCenterClient->listBigQueryExports($request);
/** @var BigQueryExport $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecurityCenterClient::organizationLocationName('[ORGANIZATION]', '[LOCATION]');
list_big_query_exports_sample($formattedParent);
}
listFindings
Lists an organization or source's findings.
To list across all sources for a given location provide a -
as the source
id. If no location is specified, finding are assumed to be in global.
The following list shows some examples:
/v2/organizations/{organization_id}/sources/-/findings
+
/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings
The async variant is Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient::listFindingsAsync() .
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\ListFindingsRequest;
use Google\Cloud\SecurityCenter\V2\ListFindingsResponse\ListFindingsResult;
/**
* @param string $formattedParent Name of the source the findings belong to. If no location is
* specified, the default is global. The following list shows some examples:
*
* + `organizations/[organization_id]/sources/[source_id]`
* +
* `organizations/[organization_id]/sources/[source_id]/locations/[location_id]`
* + `folders/[folder_id]/sources/[source_id]`
* + `folders/[folder_id]/sources/[source_id]/locations/[location_id]`
* + `projects/[project_id]/sources/[source_id]`
* + `projects/[project_id]/sources/[source_id]/locations/[location_id]`
*
* To list across all sources provide a source_id of `-`. The following
* list shows some examples:
*
* + `organizations/{organization_id}/sources/-`
* + `organizations/{organization_id}/sources/-/locations/{location_id}`
* + `folders/{folder_id}/sources/-`
* + `folders/{folder_id}/sources/-locations/{location_id}`
* + `projects/{projects_id}/sources/-`
* + `projects/{projects_id}/sources/-/locations/{location_id}`
* Please see {@see SecurityCenterClient::sourceName()} for help formatting this field.
*/
function list_findings_sample(string $formattedParent): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new ListFindingsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $securityCenterClient->listFindings($request);
/** @var ListFindingsResult $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecurityCenterClient::sourceName('[ORGANIZATION]', '[SOURCE]');
list_findings_sample($formattedParent);
}
listMuteConfigs
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\ListMuteConfigsRequest;
use Google\Cloud\SecurityCenter\V2\MuteConfig;
/**
* @param string $formattedParent The parent, which owns the collection of mute configs. Its format
* is `organizations/[organization_id]", "folders/[folder_id]`,
* `projects/[project_id]`,
* `organizations/[organization_id]/locations/[location_id]`,
* `folders/[folder_id]/locations/[location_id]`,
* `projects/[project_id]/locations/[location_id]`. Please see
* {@see SecurityCenterClient::organizationLocationName()} for help formatting this field.
*/
function list_mute_configs_sample(string $formattedParent): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new ListMuteConfigsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $securityCenterClient->listMuteConfigs($request);
/** @var MuteConfig $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecurityCenterClient::organizationLocationName('[ORGANIZATION]', '[LOCATION]');
list_mute_configs_sample($formattedParent);
}
listNotificationConfigs
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\ListNotificationConfigsRequest;
use Google\Cloud\SecurityCenter\V2\NotificationConfig;
/**
* @param string $formattedParent The name of the parent in which to list the notification
* configurations. Its format is
* "organizations/[organization_id]/locations/[location_id]",
* "folders/[folder_id]/locations/[location_id]", or
* "projects/[project_id]/locations/[location_id]". Please see
* {@see SecurityCenterClient::organizationLocationName()} for help formatting this field.
*/
function list_notification_configs_sample(string $formattedParent): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new ListNotificationConfigsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $securityCenterClient->listNotificationConfigs($request);
/** @var NotificationConfig $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecurityCenterClient::organizationLocationName('[ORGANIZATION]', '[LOCATION]');
list_notification_configs_sample($formattedParent);
}
listResourceValueConfigs
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\ListResourceValueConfigsRequest;
use Google\Cloud\SecurityCenter\V2\ResourceValueConfig;
/**
* @param string $formattedParent The parent, which owns the collection of resource value configs.
* Its format is
* `organizations/[organization_id]`
* Please see {@see SecurityCenterClient::organizationLocationName()} for help formatting this field.
*/
function list_resource_value_configs_sample(string $formattedParent): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new ListResourceValueConfigsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $securityCenterClient->listResourceValueConfigs($request);
/** @var ResourceValueConfig $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecurityCenterClient::organizationLocationName('[ORGANIZATION]', '[LOCATION]');
list_resource_value_configs_sample($formattedParent);
}
listSources
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\ListSourcesRequest;
use Google\Cloud\SecurityCenter\V2\Source;
/**
* @param string $formattedParent Resource name of the parent of sources to list. Its format should
* be `organizations/[organization_id]`, `folders/[folder_id]`, or
* `projects/[project_id]`. Please see
* {@see SecurityCenterClient::projectName()} for help formatting this field.
*/
function list_sources_sample(string $formattedParent): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new ListSourcesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $securityCenterClient->listSources($request);
/** @var Source $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecurityCenterClient::projectName('[PROJECT]');
list_sources_sample($formattedParent);
}
listValuedResources
Example
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\ListValuedResourcesRequest;
use Google\Cloud\SecurityCenter\V2\ValuedResource;
/**
* @param string $formattedParent Name of parent to list exposed resources.
*
* Valid formats:
* `organizations/{organization}`,
* `organizations/{organization}/simulations/{simulation}`
* `organizations/{organization}/simulations/{simulation}/attackExposureResults/{attack_exposure_result_v2}`
* Please see {@see SecurityCenterClient::simulationName()} for help formatting this field.
*/
function list_valued_resources_sample(string $formattedParent): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new ListValuedResourcesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $securityCenterClient->listValuedResources($request);
/** @var ValuedResource $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecurityCenterClient::simulationName('[ORGANIZATION]', '[SIMULATION]');
list_valued_resources_sample($formattedParent);
}
setFindingState
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\Finding;
use Google\Cloud\SecurityCenter\V2\Finding\State;
use Google\Cloud\SecurityCenter\V2\SetFindingStateRequest;
/**
* @param string $formattedName The [relative resource
* name](https://cloud.google.com/apis/design/resource_names#relative_resource_name)
* of the finding. If no location is specified, finding is assumed to be in
* global. The following list shows some examples:
*
* +
* `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
* +
* `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
* + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
* +
* `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
* + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
* +
* `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
* Please see {@see SecurityCenterClient::findingName()} for help formatting this field.
* @param int $state The desired State of the finding.
*/
function set_finding_state_sample(string $formattedName, int $state): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new SetFindingStateRequest())
->setName($formattedName)
->setState($state);
// Call the API and handle any network failures.
try {
/** @var Finding $response */
$response = $securityCenterClient->setFindingState($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecurityCenterClient::findingName('[ORGANIZATION]', '[SOURCE]', '[FINDING]');
$state = State::STATE_UNSPECIFIED;
set_finding_state_sample($formattedName, $state);
}
setIamPolicy
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\Iam\V1\SetIamPolicyRequest;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
/**
* @param string $resource REQUIRED: The resource for which the policy is being specified.
* See the operation documentation for the appropriate value for this field.
*/
function set_iam_policy_sample(string $resource): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$policy = new Policy();
$request = (new SetIamPolicyRequest())
->setResource($resource)
->setPolicy($policy);
// Call the API and handle any network failures.
try {
/** @var Policy $response */
$response = $securityCenterClient->setIamPolicy($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$resource = '[RESOURCE]';
set_iam_policy_sample($resource);
}
setMute
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\Finding;
use Google\Cloud\SecurityCenter\V2\Finding\Mute;
use Google\Cloud\SecurityCenter\V2\SetMuteRequest;
/**
* @param string $formattedName The [relative resource
* name](https://cloud.google.com/apis/design/resource_names#relative_resource_name)
* of the finding. If no location is specified, finding is assumed to be in
* global. The following list shows some examples:
*
* +
* `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
* +
* `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
* + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
* +
* `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
* + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
* +
* `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
* Please see {@see SecurityCenterClient::findingName()} for help formatting this field.
* @param int $mute The desired state of the Mute.
*/
function set_mute_sample(string $formattedName, int $mute): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$request = (new SetMuteRequest())
->setName($formattedName)
->setMute($mute);
// Call the API and handle any network failures.
try {
/** @var Finding $response */
$response = $securityCenterClient->setMute($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecurityCenterClient::findingName('[ORGANIZATION]', '[SOURCE]', '[FINDING]');
$mute = Mute::MUTE_UNSPECIFIED;
set_mute_sample($formattedName, $mute);
}
testIamPermissions
Example
use Google\ApiCore\ApiException;
use Google\Cloud\Iam\V1\TestIamPermissionsRequest;
use Google\Cloud\Iam\V1\TestIamPermissionsResponse;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
/**
* @param string $resource REQUIRED: The resource for which the policy detail is being requested.
* See the operation documentation for the appropriate value for this field.
* @param string $permissionsElement The set of permissions to check for the `resource`. Permissions with
* wildcards (such as '*' or 'storage.*') are not allowed. For more
* information see
* [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
*/
function test_iam_permissions_sample(string $resource, string $permissionsElement): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$permissions = [$permissionsElement,];
$request = (new TestIamPermissionsRequest())
->setResource($resource)
->setPermissions($permissions);
// Call the API and handle any network failures.
try {
/** @var TestIamPermissionsResponse $response */
$response = $securityCenterClient->testIamPermissions($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$resource = '[RESOURCE]';
$permissionsElement = '[PERMISSIONS]';
test_iam_permissions_sample($resource, $permissionsElement);
}
updateBigQueryExport
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\BigQueryExport;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\UpdateBigQueryExportRequest;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_big_query_export_sample(): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$bigQueryExport = new BigQueryExport();
$request = (new UpdateBigQueryExportRequest())
->setBigQueryExport($bigQueryExport);
// Call the API and handle any network failures.
try {
/** @var BigQueryExport $response */
$response = $securityCenterClient->updateBigQueryExport($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateExternalSystem
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\ExternalSystem;
use Google\Cloud\SecurityCenter\V2\UpdateExternalSystemRequest;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_external_system_sample(): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$externalSystem = new ExternalSystem();
$request = (new UpdateExternalSystemRequest())
->setExternalSystem($externalSystem);
// Call the API and handle any network failures.
try {
/** @var ExternalSystem $response */
$response = $securityCenterClient->updateExternalSystem($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateFinding
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\Finding;
use Google\Cloud\SecurityCenter\V2\UpdateFindingRequest;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_finding_sample(): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$finding = new Finding();
$request = (new UpdateFindingRequest())
->setFinding($finding);
// Call the API and handle any network failures.
try {
/** @var Finding $response */
$response = $securityCenterClient->updateFinding($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateMuteConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\MuteConfig;
use Google\Cloud\SecurityCenter\V2\MuteConfig\MuteConfigType;
use Google\Cloud\SecurityCenter\V2\UpdateMuteConfigRequest;
/**
* @param string $muteConfigFilter An expression that defines the filter to apply across
* create/update events of findings. While creating a filter string, be
* mindful of the scope in which the mute configuration is being created.
* E.g., If a filter contains project = X but is created under the project = Y
* scope, it might not match any findings.
*
* The following field and operator combinations are supported:
*
* * severity: `=`, `:`
* * category: `=`, `:`
* * resource.name: `=`, `:`
* * resource.project_name: `=`, `:`
* * resource.project_display_name: `=`, `:`
* * resource.folders.resource_folder: `=`, `:`
* * resource.parent_name: `=`, `:`
* * resource.parent_display_name: `=`, `:`
* * resource.type: `=`, `:`
* * finding_class: `=`, `:`
* * indicator.ip_addresses: `=`, `:`
* * indicator.domains: `=`, `:`
* @param int $muteConfigType The type of the mute config, which determines what type of mute
* state the config affects. Immutable after creation.
*/
function update_mute_config_sample(string $muteConfigFilter, int $muteConfigType): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$muteConfig = (new MuteConfig())
->setFilter($muteConfigFilter)
->setType($muteConfigType);
$request = (new UpdateMuteConfigRequest())
->setMuteConfig($muteConfig);
// Call the API and handle any network failures.
try {
/** @var MuteConfig $response */
$response = $securityCenterClient->updateMuteConfig($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$muteConfigFilter = '[FILTER]';
$muteConfigType = MuteConfigType::MUTE_CONFIG_TYPE_UNSPECIFIED;
update_mute_config_sample($muteConfigFilter, $muteConfigType);
}
updateNotificationConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\NotificationConfig;
use Google\Cloud\SecurityCenter\V2\UpdateNotificationConfigRequest;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_notification_config_sample(): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$notificationConfig = new NotificationConfig();
$request = (new UpdateNotificationConfigRequest())
->setNotificationConfig($notificationConfig);
// Call the API and handle any network failures.
try {
/** @var NotificationConfig $response */
$response = $securityCenterClient->updateNotificationConfig($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateResourceValueConfig
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\ResourceValueConfig;
use Google\Cloud\SecurityCenter\V2\UpdateResourceValueConfigRequest;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_resource_value_config_sample(): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$resourceValueConfig = new ResourceValueConfig();
$request = (new UpdateResourceValueConfigRequest())
->setResourceValueConfig($resourceValueConfig);
// Call the API and handle any network failures.
try {
/** @var ResourceValueConfig $response */
$response = $securityCenterClient->updateResourceValueConfig($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateSecurityMarks
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\SecurityMarks;
use Google\Cloud\SecurityCenter\V2\UpdateSecurityMarksRequest;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_security_marks_sample(): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$securityMarks = new SecurityMarks();
$request = (new UpdateSecurityMarksRequest())
->setSecurityMarks($securityMarks);
// Call the API and handle any network failures.
try {
/** @var SecurityMarks $response */
$response = $securityCenterClient->updateSecurityMarks($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateSource
Example
use Google\ApiCore\ApiException;
use Google\Cloud\SecurityCenter\V2\Client\SecurityCenterClient;
use Google\Cloud\SecurityCenter\V2\Source;
use Google\Cloud\SecurityCenter\V2\UpdateSourceRequest;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_source_sample(): void
{
// Create a client.
$securityCenterClient = new SecurityCenterClient();
// Prepare the request message.
$source = new Source();
$request = (new UpdateSourceRequest())
->setSource($source);
// Call the API and handle any network failures.
try {
/** @var Source $response */
$response = $securityCenterClient->updateSource($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
batchCreateResourceValueConfigsAsync
bulkMuteFindingsAsync
createBigQueryExportAsync
createFindingAsync
createMuteConfigAsync
createNotificationConfigAsync
createSourceAsync
deleteBigQueryExportAsync
deleteMuteConfigAsync
deleteNotificationConfigAsync
deleteResourceValueConfigAsync
getBigQueryExportAsync
getIamPolicyAsync
getMuteConfigAsync
getNotificationConfigAsync
getResourceValueConfigAsync
getSimulationAsync
getSourceAsync
getValuedResourceAsync
groupFindingsAsync
listAttackPathsAsync
listBigQueryExportsAsync
listFindingsAsync
listMuteConfigsAsync
listNotificationConfigsAsync
listResourceValueConfigsAsync
listSourcesAsync
listValuedResourcesAsync
setFindingStateAsync
setIamPolicyAsync
setMuteAsync
testIamPermissionsAsync
updateBigQueryExportAsync
updateExternalSystemAsync
updateFindingAsync
updateMuteConfigAsync
updateNotificationConfigAsync
updateResourceValueConfigAsync
updateSecurityMarksAsync
updateSourceAsync
getOperationsClient
Return an OperationsClient object with the same endpoint as $this.
Returns |
Type |
Description |
Google\LongRunning\Client\OperationsClient |
|
resumeOperation
Resume an existing long running operation that was previously started by a long
running API method. If $methodName is not provided, or does not match a long
running API method, then the operation can still be resumed, but the
OperationResponse object will not deserialize the final response.
Parameters |
Name |
Description |
operationName |
string
The name of the long running operation
|
methodName |
string
The name of the method used to start the operation
|
static::bigQueryExportName
Formats a string containing the fully-qualified path to represent a
big_query_export resource.
Parameters |
Name |
Description |
organization |
string
|
location |
string
|
export |
string
|
Returns |
Type |
Description |
string |
The formatted big_query_export resource. |
static::dlpJobName
Formats a string containing the fully-qualified path to represent a dlp_job
resource.
Parameters |
Name |
Description |
project |
string
|
dlpJob |
string
|
Returns |
Type |
Description |
string |
The formatted dlp_job resource. |
static::externalSystemName
Formats a string containing the fully-qualified path to represent a
external_system resource.
Parameters |
Name |
Description |
organization |
string
|
source |
string
|
finding |
string
|
externalsystem |
string
|
Returns |
Type |
Description |
string |
The formatted external_system resource. |
static::findingName
Formats a string containing the fully-qualified path to represent a finding
resource.
Parameters |
Name |
Description |
organization |
string
|
source |
string
|
finding |
string
|
Returns |
Type |
Description |
string |
The formatted finding resource. |
static::folderName
Formats a string containing the fully-qualified path to represent a folder
resource.
Parameter |
Name |
Description |
folder |
string
|
Returns |
Type |
Description |
string |
The formatted folder resource. |
static::folderAssetSecurityMarksName
Formats a string containing the fully-qualified path to represent a
folder_asset_securityMarks resource.
Parameters |
Name |
Description |
folder |
string
|
asset |
string
|
Returns |
Type |
Description |
string |
The formatted folder_asset_securityMarks resource. |
static::folderConstraintNameName
Formats a string containing the fully-qualified path to represent a
folder_constraint_name resource.
Parameters |
Name |
Description |
folder |
string
|
constraintName |
string
|
Returns |
Type |
Description |
string |
The formatted folder_constraint_name resource. |
static::folderLocationName
Formats a string containing the fully-qualified path to represent a
folder_location resource.
Parameters |
Name |
Description |
folder |
string
|
location |
string
|
Returns |
Type |
Description |
string |
The formatted folder_location resource. |
static::folderLocationExportName
Formats a string containing the fully-qualified path to represent a
folder_location_export resource.
Parameters |
Name |
Description |
folder |
string
|
location |
string
|
export |
string
|
Returns |
Type |
Description |
string |
The formatted folder_location_export resource. |
static::folderLocationMuteConfigName
Formats a string containing the fully-qualified path to represent a
folder_location_mute_config resource.
Parameters |
Name |
Description |
folder |
string
|
location |
string
|
muteConfig |
string
|
Returns |
Type |
Description |
string |
The formatted folder_location_mute_config resource. |
static::folderLocationNotificationConfigName
Formats a string containing the fully-qualified path to represent a
folder_location_notification_config resource.
Parameters |
Name |
Description |
folder |
string
|
location |
string
|
notificationConfig |
string
|
Returns |
Type |
Description |
string |
The formatted folder_location_notification_config resource. |
static::folderMuteConfigName
Formats a string containing the fully-qualified path to represent a
folder_mute_config resource.
Parameters |
Name |
Description |
folder |
string
|
muteConfig |
string
|
Returns |
Type |
Description |
string |
The formatted folder_mute_config resource. |
static::folderSourceName
Formats a string containing the fully-qualified path to represent a
folder_source resource.
Parameters |
Name |
Description |
folder |
string
|
source |
string
|
Returns |
Type |
Description |
string |
The formatted folder_source resource. |
static::folderSourceFindingName
Formats a string containing the fully-qualified path to represent a
folder_source_finding resource.
Parameters |
Name |
Description |
folder |
string
|
source |
string
|
finding |
string
|
Returns |
Type |
Description |
string |
The formatted folder_source_finding resource. |
static::folderSourceFindingExternalsystemName
Formats a string containing the fully-qualified path to represent a
folder_source_finding_externalsystem resource.
Parameters |
Name |
Description |
folder |
string
|
source |
string
|
finding |
string
|
externalsystem |
string
|
Returns |
Type |
Description |
string |
The formatted folder_source_finding_externalsystem resource. |
static::folderSourceFindingSecurityMarksName
Formats a string containing the fully-qualified path to represent a
folder_source_finding_securityMarks resource.
Parameters |
Name |
Description |
folder |
string
|
source |
string
|
finding |
string
|
Returns |
Type |
Description |
string |
The formatted folder_source_finding_securityMarks resource. |
static::folderSourceLocationFindingName
Formats a string containing the fully-qualified path to represent a
folder_source_location_finding resource.
Parameters |
Name |
Description |
folder |
string
|
source |
string
|
location |
string
|
finding |
string
|
Returns |
Type |
Description |
string |
The formatted folder_source_location_finding resource. |
static::folderSourceLocationFindingExternalsystemName
Formats a string containing the fully-qualified path to represent a
folder_source_location_finding_externalsystem resource.
Parameters |
Name |
Description |
folder |
string
|
source |
string
|
location |
string
|
finding |
string
|
externalsystem |
string
|
Returns |
Type |
Description |
string |
The formatted folder_source_location_finding_externalsystem resource. |
static::folderSourceLocationFindingSecurityMarksName
Formats a string containing the fully-qualified path to represent a
folder_source_location_finding_securityMarks resource.
Parameters |
Name |
Description |
folder |
string
|
source |
string
|
location |
string
|
finding |
string
|
Returns |
Type |
Description |
string |
The formatted folder_source_location_finding_securityMarks resource. |
static::locationName
Formats a string containing the fully-qualified path to represent a location
resource.
Parameters |
Name |
Description |
project |
string
|
location |
string
|
Returns |
Type |
Description |
string |
The formatted location resource. |
static::muteConfigName
Formats a string containing the fully-qualified path to represent a mute_config
resource.
Parameters |
Name |
Description |
organization |
string
|
muteConfig |
string
|
Returns |
Type |
Description |
string |
The formatted mute_config resource. |
static::notificationConfigName
Formats a string containing the fully-qualified path to represent a
notification_config resource.
Parameters |
Name |
Description |
organization |
string
|
location |
string
|
notificationConfig |
string
|
Returns |
Type |
Description |
string |
The formatted notification_config resource. |
static::organizationName
Formats a string containing the fully-qualified path to represent a organization
resource.
Parameter |
Name |
Description |
organization |
string
|
Returns |
Type |
Description |
string |
The formatted organization resource. |
static::organizationAssetSecurityMarksName
Formats a string containing the fully-qualified path to represent a
organization_asset_securityMarks resource.
Parameters |
Name |
Description |
organization |
string
|
asset |
string
|
Returns |
Type |
Description |
string |
The formatted organization_asset_securityMarks resource. |
static::organizationConstraintNameName
Formats a string containing the fully-qualified path to represent a
organization_constraint_name resource.
Parameters |
Name |
Description |
organization |
string
|
constraintName |
string
|
Returns |
Type |
Description |
string |
The formatted organization_constraint_name resource. |
static::organizationLocationName
Formats a string containing the fully-qualified path to represent a
organization_location resource.
Parameters |
Name |
Description |
organization |
string
|
location |
string
|
Returns |
Type |
Description |
string |
The formatted organization_location resource. |
static::organizationLocationExportName
Formats a string containing the fully-qualified path to represent a
organization_location_export resource.
Parameters |
Name |
Description |
organization |
string
|
location |
string
|
export |
string
|
Returns |
Type |
Description |
string |
The formatted organization_location_export resource. |
static::organizationLocationMuteConfigName
Formats a string containing the fully-qualified path to represent a
organization_location_mute_config resource.
Parameters |
Name |
Description |
organization |
string
|
location |
string
|
muteConfig |
string
|
Returns |
Type |
Description |
string |
The formatted organization_location_mute_config resource. |
static::organizationLocationNotificationConfigName
Formats a string containing the fully-qualified path to represent a
organization_location_notification_config resource.
Parameters |
Name |
Description |
organization |
string
|
location |
string
|
notificationConfig |
string
|
Returns |
Type |
Description |
string |
The formatted organization_location_notification_config resource. |
static::organizationLocationResourceValueConfigName
Formats a string containing the fully-qualified path to represent a
organization_location_resource_value_config resource.
Parameters |
Name |
Description |
organization |
string
|
location |
string
|
resourceValueConfig |
string
|
Returns |
Type |
Description |
string |
The formatted organization_location_resource_value_config resource. |
static::organizationLocationSimluationName
Formats a string containing the fully-qualified path to represent a
organization_location_simluation resource.
Parameters |
Name |
Description |
organization |
string
|
location |
string
|
simluation |
string
|
Returns |
Type |
Description |
string |
The formatted organization_location_simluation resource. |
static::organizationLocationSimluationValuedResourceName
Formats a string containing the fully-qualified path to represent a
organization_location_simluation_valued_resource resource.
Parameters |
Name |
Description |
organization |
string
|
location |
string
|
simluation |
string
|
valuedResource |
string
|
Returns |
Type |
Description |
string |
The formatted organization_location_simluation_valued_resource resource. |
static::organizationMuteConfigName
Formats a string containing the fully-qualified path to represent a
organization_mute_config resource.
Parameters |
Name |
Description |
organization |
string
|
muteConfig |
string
|
Returns |
Type |
Description |
string |
The formatted organization_mute_config resource. |
static::organizationResourceValueConfigName
Formats a string containing the fully-qualified path to represent a
organization_resource_value_config resource.
Parameters |
Name |
Description |
organization |
string
|
resourceValueConfig |
string
|
Returns |
Type |
Description |
string |
The formatted organization_resource_value_config resource. |
static::organizationSimulationName
Formats a string containing the fully-qualified path to represent a
organization_simulation resource.
Parameters |
Name |
Description |
organization |
string
|
simulation |
string
|
Returns |
Type |
Description |
string |
The formatted organization_simulation resource. |
static::organizationSimulationValuedResourceName
Formats a string containing the fully-qualified path to represent a
organization_simulation_valued_resource resource.
Parameters |
Name |
Description |
organization |
string
|
simulation |
string
|
valuedResource |
string
|
Returns |
Type |
Description |
string |
The formatted organization_simulation_valued_resource resource. |
static::organizationSourceName
Formats a string containing the fully-qualified path to represent a
organization_source resource.
Parameters |
Name |
Description |
organization |
string
|
source |
string
|
Returns |
Type |
Description |
string |
The formatted organization_source resource. |
static::organizationSourceFindingName
Formats a string containing the fully-qualified path to represent a
organization_source_finding resource.
Parameters |
Name |
Description |
organization |
string
|
source |
string
|
finding |
string
|
Returns |
Type |
Description |
string |
The formatted organization_source_finding resource. |
static::organizationSourceFindingExternalsystemName
Formats a string containing the fully-qualified path to represent a
organization_source_finding_externalsystem resource.
Parameters |
Name |
Description |
organization |
string
|
source |
string
|
finding |
string
|
externalsystem |
string
|
Returns |
Type |
Description |
string |
The formatted organization_source_finding_externalsystem resource. |
static::organizationSourceFindingSecurityMarksName
Formats a string containing the fully-qualified path to represent a
organization_source_finding_securityMarks resource.
Parameters |
Name |
Description |
organization |
string
|
source |
string
|
finding |
string
|
Returns |
Type |
Description |
string |
The formatted organization_source_finding_securityMarks resource. |
static::organizationSourceLocationFindingName
Formats a string containing the fully-qualified path to represent a
organization_source_location_finding resource.
Parameters |
Name |
Description |
organization |
string
|
source |
string
|
location |
string
|
finding |
string
|
Returns |
Type |
Description |
string |
The formatted organization_source_location_finding resource. |
static::organizationSourceLocationFindingExternalsystemName
Formats a string containing the fully-qualified path to represent a
organization_source_location_finding_externalsystem resource.
Parameters |
Name |
Description |
organization |
string
|
source |
string
|
location |
string
|
finding |
string
|
externalsystem |
string
|
Returns |
Type |
Description |
string |
The formatted organization_source_location_finding_externalsystem resource. |
static::organizationSourceLocationFindingSecurityMarksName
Formats a string containing the fully-qualified path to represent a
organization_source_location_finding_securityMarks resource.
Parameters |
Name |
Description |
organization |
string
|
source |
string
|
location |
string
|
finding |
string
|
Returns |
Type |
Description |
string |
The formatted organization_source_location_finding_securityMarks resource. |
static::organizationValuedResourceName
Formats a string containing the fully-qualified path to represent a
organization_valued_resource resource.
Parameters |
Name |
Description |
organization |
string
|
location |
string
|
simulation |
string
|
valuedResource |
string
|
Returns |
Type |
Description |
string |
The formatted organization_valued_resource resource. |
static::policyName
Formats a string containing the fully-qualified path to represent a policy
resource.
Parameters |
Name |
Description |
organization |
string
|
constraintName |
string
|
Returns |
Type |
Description |
string |
The formatted policy resource. |
static::projectName
Formats a string containing the fully-qualified path to represent a project
resource.
Parameter |
Name |
Description |
project |
string
|
Returns |
Type |
Description |
string |
The formatted project resource. |
static::projectAssetSecurityMarksName
Formats a string containing the fully-qualified path to represent a
project_asset_securityMarks resource.
Parameters |
Name |
Description |
project |
string
|
asset |
string
|
Returns |
Type |
Description |
string |
The formatted project_asset_securityMarks resource. |
static::projectConstraintNameName
Formats a string containing the fully-qualified path to represent a
project_constraint_name resource.
Parameters |
Name |
Description |
project |
string
|
constraintName |
string
|
Returns |
Type |
Description |
string |
The formatted project_constraint_name resource. |
static::projectDlpJobName
Formats a string containing the fully-qualified path to represent a
project_dlp_job resource.
Parameters |
Name |
Description |
project |
string
|
dlpJob |
string
|
Returns |
Type |
Description |
string |
The formatted project_dlp_job resource. |
static::projectLocationDlpJobName
Formats a string containing the fully-qualified path to represent a
project_location_dlp_job resource.
Parameters |
Name |
Description |
project |
string
|
location |
string
|
dlpJob |
string
|
Returns |
Type |
Description |
string |
The formatted project_location_dlp_job resource. |
static::projectLocationExportName
Formats a string containing the fully-qualified path to represent a
project_location_export resource.
Parameters |
Name |
Description |
project |
string
|
location |
string
|
export |
string
|
Returns |
Type |
Description |
string |
The formatted project_location_export resource. |
static::projectLocationMuteConfigName
Formats a string containing the fully-qualified path to represent a
project_location_mute_config resource.
Parameters |
Name |
Description |
project |
string
|
location |
string
|
muteConfig |
string
|
Returns |
Type |
Description |
string |
The formatted project_location_mute_config resource. |
static::projectLocationNotificationConfigName
Formats a string containing the fully-qualified path to represent a
project_location_notification_config resource.
Parameters |
Name |
Description |
project |
string
|
location |
string
|
notificationConfig |
string
|
Returns |
Type |
Description |
string |
The formatted project_location_notification_config resource. |
static::projectLocationTableProfileName
Formats a string containing the fully-qualified path to represent a
project_location_table_profile resource.
Parameters |
Name |
Description |
project |
string
|
location |
string
|
tableProfile |
string
|
Returns |
Type |
Description |
string |
The formatted project_location_table_profile resource. |
static::projectMuteConfigName
Formats a string containing the fully-qualified path to represent a
project_mute_config resource.
Parameters |
Name |
Description |
project |
string
|
muteConfig |
string
|
Returns |
Type |
Description |
string |
The formatted project_mute_config resource. |
static::projectSourceName
Formats a string containing the fully-qualified path to represent a
project_source resource.
Parameters |
Name |
Description |
project |
string
|
source |
string
|
Returns |
Type |
Description |
string |
The formatted project_source resource. |
static::projectSourceFindingName
Formats a string containing the fully-qualified path to represent a
project_source_finding resource.
Parameters |
Name |
Description |
project |
string
|
source |
string
|
finding |
string
|
Returns |
Type |
Description |
string |
The formatted project_source_finding resource. |
static::projectSourceFindingExternalsystemName
Formats a string containing the fully-qualified path to represent a
project_source_finding_externalsystem resource.
Parameters |
Name |
Description |
project |
string
|
source |
string
|
finding |
string
|
externalsystem |
string
|
Returns |
Type |
Description |
string |
The formatted project_source_finding_externalsystem resource. |
static::projectSourceFindingSecurityMarksName
Formats a string containing the fully-qualified path to represent a
project_source_finding_securityMarks resource.
Parameters |
Name |
Description |
project |
string
|
source |
string
|
finding |
string
|
Returns |
Type |
Description |
string |
The formatted project_source_finding_securityMarks resource. |
static::projectSourceLocationFindingName
Formats a string containing the fully-qualified path to represent a
project_source_location_finding resource.
Parameters |
Name |
Description |
project |
string
|
source |
string
|
location |
string
|
finding |
string
|
Returns |
Type |
Description |
string |
The formatted project_source_location_finding resource. |
static::projectSourceLocationFindingExternalsystemName
Formats a string containing the fully-qualified path to represent a
project_source_location_finding_externalsystem resource.
Parameters |
Name |
Description |
project |
string
|
source |
string
|
location |
string
|
finding |
string
|
externalsystem |
string
|
Returns |
Type |
Description |
string |
The formatted project_source_location_finding_externalsystem resource. |
static::projectSourceLocationFindingSecurityMarksName
Formats a string containing the fully-qualified path to represent a
project_source_location_finding_securityMarks resource.
Parameters |
Name |
Description |
project |
string
|
source |
string
|
location |
string
|
finding |
string
|
Returns |
Type |
Description |
string |
The formatted project_source_location_finding_securityMarks resource. |
static::projectTableProfileName
Formats a string containing the fully-qualified path to represent a
project_table_profile resource.
Parameters |
Name |
Description |
project |
string
|
tableProfile |
string
|
Returns |
Type |
Description |
string |
The formatted project_table_profile resource. |
static::resourceValueConfigName
Formats a string containing the fully-qualified path to represent a
resource_value_config resource.
Parameters |
Name |
Description |
organization |
string
|
resourceValueConfig |
string
|
Returns |
Type |
Description |
string |
The formatted resource_value_config resource. |
static::securityMarksName
Formats a string containing the fully-qualified path to represent a
security_marks resource.
Parameters |
Name |
Description |
organization |
string
|
asset |
string
|
Returns |
Type |
Description |
string |
The formatted security_marks resource. |
static::simulationName
Formats a string containing the fully-qualified path to represent a simulation
resource.
Parameters |
Name |
Description |
organization |
string
|
simulation |
string
|
Returns |
Type |
Description |
string |
The formatted simulation resource. |
static::sourceName
Formats a string containing the fully-qualified path to represent a source
resource.
Parameters |
Name |
Description |
organization |
string
|
source |
string
|
Returns |
Type |
Description |
string |
The formatted source resource. |
static::tableDataProfileName
Formats a string containing the fully-qualified path to represent a
table_data_profile resource.
Parameters |
Name |
Description |
project |
string
|
tableProfile |
string
|
Returns |
Type |
Description |
string |
The formatted table_data_profile resource. |
static::topicName
Formats a string containing the fully-qualified path to represent a topic
resource.
Parameters |
Name |
Description |
project |
string
|
topic |
string
|
Returns |
Type |
Description |
string |
The formatted topic resource. |
static::valuedResourceName
Formats a string containing the fully-qualified path to represent a
valued_resource resource.
Parameters |
Name |
Description |
organization |
string
|
simulation |
string
|
valuedResource |
string
|
Returns |
Type |
Description |
string |
The formatted valued_resource resource. |
static::parseName
Parses a formatted name string and returns an associative array of the components in the name.
The following name formats are supported:
Template: Pattern
- bigQueryExport: organizations/{organization}/locations/{location}/bigQueryExports/{export}
- dlpJob: projects/{project}/dlpJobs/{dlp_job}
- externalSystem: organizations/{organization}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}
- finding: organizations/{organization}/sources/{source}/findings/{finding}
- folder: folders/{folder}
- folderAssetSecurityMarks: folders/{folder}/assets/{asset}/securityMarks
- folderConstraintName: folders/{folder}/policies/{constraint_name}
- folderLocation: folders/{folder}/locations/{location}
- folderLocationExport: folders/{folder}/locations/{location}/bigQueryExports/{export}
- folderLocationMuteConfig: folders/{folder}/locations/{location}/muteConfigs/{mute_config}
- folderLocationNotificationConfig: folders/{folder}/locations/{location}/notificationConfigs/{notification_config}
- folderMuteConfig: folders/{folder}/muteConfigs/{mute_config}
- folderSource: folders/{folder}/sources/{source}
- folderSourceFinding: folders/{folder}/sources/{source}/findings/{finding}
- folderSourceFindingExternalsystem: folders/{folder}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}
- folderSourceFindingSecurityMarks: folders/{folder}/sources/{source}/findings/{finding}/securityMarks
- folderSourceLocationFinding: folders/{folder}/sources/{source}/locations/{location}/findings/{finding}
- folderSourceLocationFindingExternalsystem: folders/{folder}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}
- folderSourceLocationFindingSecurityMarks: folders/{folder}/sources/{source}/locations/{location}/findings/{finding}/securityMarks
- location: projects/{project}/locations/{location}
- muteConfig: organizations/{organization}/muteConfigs/{mute_config}
- notificationConfig: organizations/{organization}/locations/{location}/notificationConfigs/{notification_config}
- organization: organizations/{organization}
- organizationAssetSecurityMarks: organizations/{organization}/assets/{asset}/securityMarks
- organizationConstraintName: organizations/{organization}/policies/{constraint_name}
- organizationLocation: organizations/{organization}/locations/{location}
- organizationLocationExport: organizations/{organization}/locations/{location}/bigQueryExports/{export}
- organizationLocationMuteConfig: organizations/{organization}/locations/{location}/muteConfigs/{mute_config}
- organizationLocationNotificationConfig: organizations/{organization}/locations/{location}/notificationConfigs/{notification_config}
- organizationLocationResourceValueConfig: organizations/{organization}/locations/{location}/resourceValueConfigs/{resource_value_config}
- organizationLocationSimluation: organizations/{organization}/locations/{location}/simulations/{simluation}
- organizationLocationSimluationValuedResource: organizations/{organization}/locations/{location}/simulations/{simluation}/valuedResources/{valued_resource}
- organizationMuteConfig: organizations/{organization}/muteConfigs/{mute_config}
- organizationResourceValueConfig: organizations/{organization}/resourceValueConfigs/{resource_value_config}
- organizationSimulation: organizations/{organization}/simulations/{simulation}
- organizationSimulationValuedResource: organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}
- organizationSource: organizations/{organization}/sources/{source}
- organizationSourceFinding: organizations/{organization}/sources/{source}/findings/{finding}
- organizationSourceFindingExternalsystem: organizations/{organization}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}
- organizationSourceFindingSecurityMarks: organizations/{organization}/sources/{source}/findings/{finding}/securityMarks
- organizationSourceLocationFinding: organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}
- organizationSourceLocationFindingExternalsystem: organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}
- organizationSourceLocationFindingSecurityMarks: organizations/{organization}/sources/{source}/locations/{location}/findings/{finding}/securityMarks
- organizationValuedResource: organizations/{organization}/locations/{location}/simulations/{simulation}/valuedResources/{valued_resource}
- policy: organizations/{organization}/policies/{constraint_name}
- project: projects/{project}
- projectAssetSecurityMarks: projects/{project}/assets/{asset}/securityMarks
- projectConstraintName: projects/{project}/policies/{constraint_name}
- projectDlpJob: projects/{project}/dlpJobs/{dlp_job}
- projectLocationDlpJob: projects/{project}/locations/{location}/dlpJobs/{dlp_job}
- projectLocationExport: projects/{project}/locations/{location}/bigQueryExports/{export}
- projectLocationMuteConfig: projects/{project}/locations/{location}/muteConfigs/{mute_config}
- projectLocationNotificationConfig: projects/{project}/locations/{location}/notificationConfigs/{notification_config}
- projectLocationTableProfile: projects/{project}/locations/{location}/tableProfiles/{table_profile}
- projectMuteConfig: projects/{project}/muteConfigs/{mute_config}
- projectSource: projects/{project}/sources/{source}
- projectSourceFinding: projects/{project}/sources/{source}/findings/{finding}
- projectSourceFindingExternalsystem: projects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}
- projectSourceFindingSecurityMarks: projects/{project}/sources/{source}/findings/{finding}/securityMarks
- projectSourceLocationFinding: projects/{project}/sources/{source}/locations/{location}/findings/{finding}
- projectSourceLocationFindingExternalsystem: projects/{project}/sources/{source}/locations/{location}/findings/{finding}/externalSystems/{externalsystem}
- projectSourceLocationFindingSecurityMarks: projects/{project}/sources/{source}/locations/{location}/findings/{finding}/securityMarks
- projectTableProfile: projects/{project}/tableProfiles/{table_profile}
- resourceValueConfig: organizations/{organization}/resourceValueConfigs/{resource_value_config}
- securityMarks: organizations/{organization}/assets/{asset}/securityMarks
- simulation: organizations/{organization}/simulations/{simulation}
- source: organizations/{organization}/sources/{source}
- tableDataProfile: projects/{project}/tableProfiles/{table_profile}
- topic: projects/{project}/topics/{topic}
- valuedResource: organizations/{organization}/simulations/{simulation}/valuedResources/{valued_resource}
The optional $template argument can be supplied to specify a particular pattern,
and must match one of the templates listed above. If no $template argument is
provided, or if the $template argument does not match one of the templates
listed, then parseName will check each of the supported templates, and return
the first match.
Parameters |
Name |
Description |
formattedName |
string
The formatted name string
|
template |
string
Optional name of template to match
|
Returns |
Type |
Description |
array |
An associative array from name component IDs to component values. |