Class SecurityCenterSettingsServiceClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
The SecurityCenterSettingsService is a sub-api of `securitycenter.googleapis.com`. The service provides methods to manage Security Center Settings, and Component Settings for GCP organizations, folders, projects, and clusters.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient =
SecurityCenterSettingsServiceClient.create()) {
ServiceAccountName name = ServiceAccountName.of("[ORGANIZATION]");
ServiceAccount response = securityCenterSettingsServiceClient.getServiceAccount(name);
}
Note: close() needs to be called on the SecurityCenterSettingsServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
GetServiceAccount |
Retrieves the organizations service account, if it exists, otherwise it creates the organization service account. This API is idempotent and will only create a service account once. On subsequent calls it will return the previously created service account. SHA, SCC and CTD Infra Automation will use this SA. This SA will not have any permissions when created. The UI will provision this via IAM or the user will using their own internal process. This API only creates SAs on the organization. Folders are not supported and projects will use per-project SAs associated with APIs enabled on a project. This API will be called by the UX onboarding workflow. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetSettings |
Gets the Settings. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateSettings |
Updates the Settings. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ResetSettings |
Reset the organization, folder or project's settings and return the settings of just that resource to the default. Settings are present at the organization, folder, project, and cluster levels. Using Reset on a sub-organization level will remove that resource's override and result in the parent's settings being used (eg: if Reset on a cluster, project settings will be used). Using Reset on organization will remove the override that was set and result in default settings being used. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
BatchGetSettings |
Gets a list of settings. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CalculateEffectiveSettings |
CalculateEffectiveSettings looks up all of the Security Center Settings resources in the GCP resource hierarchy, and calculates the effective settings on that resource by applying the following rules: * Settings provided closer to the target resource take precedence over those further away (e.g. folder will override organization level settings). * Product defaults can be overridden at org, folder, project, and cluster levels. * Detectors will be filtered out if they belong to a billing tier the customer has not configured. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
BatchCalculateEffectiveSettings |
Gets a list of effective settings. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetComponentSettings |
Gets the Component Settings. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateComponentSettings |
Updates the Component Settings. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ResetComponentSettings |
Reset the organization, folder or project's component settings and return the settings to the default. Settings are present at the organization, folder and project levels. Using Reset for a folder or project will remove the override that was set and result in the organization-level settings being used. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CalculateEffectiveComponentSettings |
Gets the Effective Component Settings. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListDetectors |
Retrieves an unordered list of available detectors. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListComponents |
Retrieves an unordered list of available SCC components. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
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 parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of SecurityCenterSettingsServiceSettings to create(). For example:
To customize credentials:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
SecurityCenterSettingsServiceSettings securityCenterSettingsServiceSettings =
SecurityCenterSettingsServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient =
SecurityCenterSettingsServiceClient.create(securityCenterSettingsServiceSettings);
To customize the endpoint:
// This snippet 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 as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
SecurityCenterSettingsServiceSettings securityCenterSettingsServiceSettings =
SecurityCenterSettingsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient =
SecurityCenterSettingsServiceClient.create(securityCenterSettingsServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs an instance of SecurityCenterSettingsServiceClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) Gets a list of effective settings.Gets a list of effective settings.final BatchGetSettingsResponsebatchGetSettings(BatchGetSettingsRequest request) Gets a list of settings.Gets a list of settings.final ComponentSettingsGets the Effective Component Settings.final ComponentSettingsGets the Effective Component Settings.final ComponentSettingsGets the Effective Component Settings.Gets the Effective Component Settings.final SettingsCalculateEffectiveSettings looks up all of the Security Center Settings resources in the GCP resource hierarchy, and calculates the effective settings on that resource by applying the following rules: * Settings provided closer to the target resource take precedence over those further away (e.g. folder will override organization level settings).final SettingsCalculateEffectiveSettings looks up all of the Security Center Settings resources in the GCP resource hierarchy, and calculates the effective settings on that resource by applying the following rules: * Settings provided closer to the target resource take precedence over those further away (e.g. folder will override organization level settings).final SettingsCalculateEffectiveSettings looks up all of the Security Center Settings resources in the GCP resource hierarchy, and calculates the effective settings on that resource by applying the following rules: * Settings provided closer to the target resource take precedence over those further away (e.g. folder will override organization level settings).CalculateEffectiveSettings looks up all of the Security Center Settings resources in the GCP resource hierarchy, and calculates the effective settings on that resource by applying the following rules: * Settings provided closer to the target resource take precedence over those further away (e.g. folder will override organization level settings).final voidclose()static final SecurityCenterSettingsServiceClientcreate()Constructs an instance of SecurityCenterSettingsServiceClient with default settings.static final SecurityCenterSettingsServiceClientcreate(SecurityCenterSettingsServiceSettings settings) Constructs an instance of SecurityCenterSettingsServiceClient, using the given settings.static final SecurityCenterSettingsServiceClientConstructs an instance of SecurityCenterSettingsServiceClient, using the given stub for making calls.final ComponentSettingsGets the Component Settings.final ComponentSettingsGets the Component Settings.final ComponentSettingsgetComponentSettings(String name) Gets the Component Settings.Gets the Component Settings.final ServiceAccountRetrieves the organizations service account, if it exists, otherwise it creates the organization service account.final ServiceAccountRetrieves the organizations service account, if it exists, otherwise it creates the organization service account.final ServiceAccountgetServiceAccount(String name) Retrieves the organizations service account, if it exists, otherwise it creates the organization service account.Retrieves the organizations service account, if it exists, otherwise it creates the organization service account.final SettingsgetSettings(GetSettingsRequest request) Gets the Settings.final SettingsgetSettings(SettingsName name) Gets the Settings.final SettingsgetSettings(String name) Gets the Settings.Gets the Settings.getStub()booleanbooleanlistComponents(ListComponentsRequest request) Retrieves an unordered list of available SCC components.listComponents(OrganizationName parent) Retrieves an unordered list of available SCC components.listComponents(String parent) Retrieves an unordered list of available SCC components.Retrieves an unordered list of available SCC components.final UnaryCallable<ListComponentsRequest,SecurityCenterSettingsServiceClient.ListComponentsPagedResponse> Retrieves an unordered list of available SCC components.listDetectors(ListDetectorsRequest request) Retrieves an unordered list of available detectors.listDetectors(OrganizationName parent) Retrieves an unordered list of available detectors.listDetectors(String parent) Retrieves an unordered list of available detectors.Retrieves an unordered list of available detectors.final UnaryCallable<ListDetectorsRequest,SecurityCenterSettingsServiceClient.ListDetectorsPagedResponse> Retrieves an unordered list of available detectors.final voidReset the organization, folder or project's component settings and return the settings to the default.final UnaryCallable<ResetComponentSettingsRequest,com.google.protobuf.Empty> Reset the organization, folder or project's component settings and return the settings to the default.final voidresetSettings(ResetSettingsRequest request) Reset the organization, folder or project's settings and return the settings of just that resource to the default.final UnaryCallable<ResetSettingsRequest,com.google.protobuf.Empty> Reset the organization, folder or project's settings and return the settings of just that resource to the default.voidshutdown()voidfinal ComponentSettingsupdateComponentSettings(ComponentSettings componentSettings, com.google.protobuf.FieldMask updateMask) Updates the Component Settings.final ComponentSettingsUpdates the Component Settings.Updates the Component Settings.final SettingsupdateSettings(Settings settings, com.google.protobuf.FieldMask updateMask) Updates the Settings.final SettingsupdateSettings(UpdateSettingsRequest request) Updates the Settings.Updates the Settings.
-
Constructor Details
-
SecurityCenterSettingsServiceClient
protected SecurityCenterSettingsServiceClient(SecurityCenterSettingsServiceSettings settings) throws IOException Constructs an instance of SecurityCenterSettingsServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
SecurityCenterSettingsServiceClient
-
-
Method Details
-
create
Constructs an instance of SecurityCenterSettingsServiceClient with default settings.- Throws:
IOException
-
create
public static final SecurityCenterSettingsServiceClient create(SecurityCenterSettingsServiceSettings settings) throws IOException Constructs an instance of SecurityCenterSettingsServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
public static final SecurityCenterSettingsServiceClient create(SecurityCenterSettingsServiceStub stub) Constructs an instance of SecurityCenterSettingsServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(SecurityCenterSettingsServiceSettings). -
getSettings
-
getStub
-
getServiceAccount
Retrieves the organizations service account, if it exists, otherwise it creates the organization service account. This API is idempotent and will only create a service account once. On subsequent calls it will return the previously created service account. SHA, SCC and CTD Infra Automation will use this SA. This SA will not have any permissions when created. The UI will provision this via IAM or the user will using their own internal process. This API only creates SAs on the organization. Folders are not supported and projects will use per-project SAs associated with APIs enabled on a project. This API will be called by the UX onboarding workflow.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { ServiceAccountName name = ServiceAccountName.of("[ORGANIZATION]"); ServiceAccount response = securityCenterSettingsServiceClient.getServiceAccount(name); }- Parameters:
name- Required. The relative resource name of the service account resource. Format: * `organizations/{organization}/serviceAccount`- Throws:
ApiException- if the remote call fails
-
getServiceAccount
Retrieves the organizations service account, if it exists, otherwise it creates the organization service account. This API is idempotent and will only create a service account once. On subsequent calls it will return the previously created service account. SHA, SCC and CTD Infra Automation will use this SA. This SA will not have any permissions when created. The UI will provision this via IAM or the user will using their own internal process. This API only creates SAs on the organization. Folders are not supported and projects will use per-project SAs associated with APIs enabled on a project. This API will be called by the UX onboarding workflow.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { String name = ServiceAccountName.of("[ORGANIZATION]").toString(); ServiceAccount response = securityCenterSettingsServiceClient.getServiceAccount(name); }- Parameters:
name- Required. The relative resource name of the service account resource. Format: * `organizations/{organization}/serviceAccount`- Throws:
ApiException- if the remote call fails
-
getServiceAccount
Retrieves the organizations service account, if it exists, otherwise it creates the organization service account. This API is idempotent and will only create a service account once. On subsequent calls it will return the previously created service account. SHA, SCC and CTD Infra Automation will use this SA. This SA will not have any permissions when created. The UI will provision this via IAM or the user will using their own internal process. This API only creates SAs on the organization. Folders are not supported and projects will use per-project SAs associated with APIs enabled on a project. This API will be called by the UX onboarding workflow.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { GetServiceAccountRequest request = GetServiceAccountRequest.newBuilder() .setName(ServiceAccountName.of("[ORGANIZATION]").toString()) .build(); ServiceAccount response = securityCenterSettingsServiceClient.getServiceAccount(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getServiceAccountCallable
Retrieves the organizations service account, if it exists, otherwise it creates the organization service account. This API is idempotent and will only create a service account once. On subsequent calls it will return the previously created service account. SHA, SCC and CTD Infra Automation will use this SA. This SA will not have any permissions when created. The UI will provision this via IAM or the user will using their own internal process. This API only creates SAs on the organization. Folders are not supported and projects will use per-project SAs associated with APIs enabled on a project. This API will be called by the UX onboarding workflow.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { GetServiceAccountRequest request = GetServiceAccountRequest.newBuilder() .setName(ServiceAccountName.of("[ORGANIZATION]").toString()) .build(); ApiFuture<ServiceAccount> future = securityCenterSettingsServiceClient.getServiceAccountCallable().futureCall(request); // Do something. ServiceAccount response = future.get(); } -
getSettings
Gets the Settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { SettingsName name = SettingsName.ofOrganizationName("[ORGANIZATION]"); Settings response = securityCenterSettingsServiceClient.getSettings(name); }- Parameters:
name- Required. The name of the settings to retrieve. Formats: * `organizations/{organization}/settings` * `folders/{folder}/settings` * `projects/{project}/settings` * `projects/{project}/locations/{location}/clusters/{cluster}/settings` * `projects/{project}/regions/{region}/clusters/{cluster}/settings` * `projects/{project}/zones/{zone}/clusters/{cluster}/settings`- Throws:
ApiException- if the remote call fails
-
getSettings
Gets the Settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { String name = SettingsName.ofOrganizationName("[ORGANIZATION]").toString(); Settings response = securityCenterSettingsServiceClient.getSettings(name); }- Parameters:
name- Required. The name of the settings to retrieve. Formats: * `organizations/{organization}/settings` * `folders/{folder}/settings` * `projects/{project}/settings` * `projects/{project}/locations/{location}/clusters/{cluster}/settings` * `projects/{project}/regions/{region}/clusters/{cluster}/settings` * `projects/{project}/zones/{zone}/clusters/{cluster}/settings`- Throws:
ApiException- if the remote call fails
-
getSettings
Gets the Settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { GetSettingsRequest request = GetSettingsRequest.newBuilder() .setName(SettingsName.ofOrganizationName("[ORGANIZATION]").toString()) .build(); Settings response = securityCenterSettingsServiceClient.getSettings(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getSettingsCallable
Gets the Settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { GetSettingsRequest request = GetSettingsRequest.newBuilder() .setName(SettingsName.ofOrganizationName("[ORGANIZATION]").toString()) .build(); ApiFuture<Settings> future = securityCenterSettingsServiceClient.getSettingsCallable().futureCall(request); // Do something. Settings response = future.get(); } -
updateSettings
Updates the Settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { Settings settings = Settings.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Settings response = securityCenterSettingsServiceClient.updateSettings(settings, updateMask); }- Parameters:
settings- Required. The settings to update.The settings' `name` field is used to identify the settings to be updated. Formats: * `organizations/{organization}/settings` * `folders/{folder}/settings` * `projects/{project}/settings` * `projects/{project}/locations/{location}/clusters/{cluster}/settings` * `projects/{project}/regions/{region}/clusters/{cluster}/settings` * `projects/{project}/zones/{zone}/clusters/{cluster}/settings`
updateMask- The list of fields to be updated on the settings.- Throws:
ApiException- if the remote call fails
-
updateSettings
Updates the Settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { UpdateSettingsRequest request = UpdateSettingsRequest.newBuilder() .setSettings(Settings.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Settings response = securityCenterSettingsServiceClient.updateSettings(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateSettingsCallable
Updates the Settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { UpdateSettingsRequest request = UpdateSettingsRequest.newBuilder() .setSettings(Settings.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Settings> future = securityCenterSettingsServiceClient.updateSettingsCallable().futureCall(request); // Do something. Settings response = future.get(); } -
resetSettings
Reset the organization, folder or project's settings and return the settings of just that resource to the default.Settings are present at the organization, folder, project, and cluster levels. Using Reset on a sub-organization level will remove that resource's override and result in the parent's settings being used (eg: if Reset on a cluster, project settings will be used).
Using Reset on organization will remove the override that was set and result in default settings being used.
Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { ResetSettingsRequest request = ResetSettingsRequest.newBuilder() .setName(SettingsName.ofOrganizationName("[ORGANIZATION]").toString()) .setEtag("etag3123477") .build(); securityCenterSettingsServiceClient.resetSettings(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
resetSettingsCallable
Reset the organization, folder or project's settings and return the settings of just that resource to the default.Settings are present at the organization, folder, project, and cluster levels. Using Reset on a sub-organization level will remove that resource's override and result in the parent's settings being used (eg: if Reset on a cluster, project settings will be used).
Using Reset on organization will remove the override that was set and result in default settings being used.
Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { ResetSettingsRequest request = ResetSettingsRequest.newBuilder() .setName(SettingsName.ofOrganizationName("[ORGANIZATION]").toString()) .setEtag("etag3123477") .build(); ApiFuture<Empty> future = securityCenterSettingsServiceClient.resetSettingsCallable().futureCall(request); // Do something. future.get(); } -
batchGetSettings
Gets a list of settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { BatchGetSettingsRequest request = BatchGetSettingsRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .addAllNames(new ArrayList<String>()) .build(); BatchGetSettingsResponse response = securityCenterSettingsServiceClient.batchGetSettings(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
batchGetSettingsCallable
public final UnaryCallable<BatchGetSettingsRequest,BatchGetSettingsResponse> batchGetSettingsCallable()Gets a list of settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { BatchGetSettingsRequest request = BatchGetSettingsRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .addAllNames(new ArrayList<String>()) .build(); ApiFuture<BatchGetSettingsResponse> future = securityCenterSettingsServiceClient.batchGetSettingsCallable().futureCall(request); // Do something. BatchGetSettingsResponse response = future.get(); } -
calculateEffectiveSettings
CalculateEffectiveSettings looks up all of the Security Center Settings resources in the GCP resource hierarchy, and calculates the effective settings on that resource by applying the following rules: * Settings provided closer to the target resource take precedence over those further away (e.g. folder will override organization level settings). * Product defaults can be overridden at org, folder, project, and cluster levels. * Detectors will be filtered out if they belong to a billing tier the customer has not configured.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { SettingsName name = SettingsName.ofOrganizationName("[ORGANIZATION]"); Settings response = securityCenterSettingsServiceClient.calculateEffectiveSettings(name); }- Parameters:
name- Required. The name of the effective settings to retrieve. Formats: * `organizations/{organization}/effectiveSettings` * `folders/{folder}/effectiveSettings` * `projects/{project}/effectiveSettings` * `projects/{project}/locations/{location}/clusters/{cluster}/effectiveSettings` * `projects/{project}/regions/{region}/clusters/{cluster}/effectiveSettings` * `projects/{project}/zones/{zone}/clusters/{cluster}/effectiveSettings`- Throws:
ApiException- if the remote call fails
-
calculateEffectiveSettings
CalculateEffectiveSettings looks up all of the Security Center Settings resources in the GCP resource hierarchy, and calculates the effective settings on that resource by applying the following rules: * Settings provided closer to the target resource take precedence over those further away (e.g. folder will override organization level settings). * Product defaults can be overridden at org, folder, project, and cluster levels. * Detectors will be filtered out if they belong to a billing tier the customer has not configured.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { String name = SettingsName.ofOrganizationName("[ORGANIZATION]").toString(); Settings response = securityCenterSettingsServiceClient.calculateEffectiveSettings(name); }- Parameters:
name- Required. The name of the effective settings to retrieve. Formats: * `organizations/{organization}/effectiveSettings` * `folders/{folder}/effectiveSettings` * `projects/{project}/effectiveSettings` * `projects/{project}/locations/{location}/clusters/{cluster}/effectiveSettings` * `projects/{project}/regions/{region}/clusters/{cluster}/effectiveSettings` * `projects/{project}/zones/{zone}/clusters/{cluster}/effectiveSettings`- Throws:
ApiException- if the remote call fails
-
calculateEffectiveSettings
CalculateEffectiveSettings looks up all of the Security Center Settings resources in the GCP resource hierarchy, and calculates the effective settings on that resource by applying the following rules: * Settings provided closer to the target resource take precedence over those further away (e.g. folder will override organization level settings). * Product defaults can be overridden at org, folder, project, and cluster levels. * Detectors will be filtered out if they belong to a billing tier the customer has not configured.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { CalculateEffectiveSettingsRequest request = CalculateEffectiveSettingsRequest.newBuilder() .setName(SettingsName.ofOrganizationName("[ORGANIZATION]").toString()) .build(); Settings response = securityCenterSettingsServiceClient.calculateEffectiveSettings(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
calculateEffectiveSettingsCallable
public final UnaryCallable<CalculateEffectiveSettingsRequest,Settings> calculateEffectiveSettingsCallable()CalculateEffectiveSettings looks up all of the Security Center Settings resources in the GCP resource hierarchy, and calculates the effective settings on that resource by applying the following rules: * Settings provided closer to the target resource take precedence over those further away (e.g. folder will override organization level settings). * Product defaults can be overridden at org, folder, project, and cluster levels. * Detectors will be filtered out if they belong to a billing tier the customer has not configured.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { CalculateEffectiveSettingsRequest request = CalculateEffectiveSettingsRequest.newBuilder() .setName(SettingsName.ofOrganizationName("[ORGANIZATION]").toString()) .build(); ApiFuture<Settings> future = securityCenterSettingsServiceClient .calculateEffectiveSettingsCallable() .futureCall(request); // Do something. Settings response = future.get(); } -
batchCalculateEffectiveSettings
public final BatchCalculateEffectiveSettingsResponse batchCalculateEffectiveSettings(BatchCalculateEffectiveSettingsRequest request) Gets a list of effective settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { BatchCalculateEffectiveSettingsRequest request = BatchCalculateEffectiveSettingsRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .addAllRequests(new ArrayList<CalculateEffectiveSettingsRequest>()) .build(); BatchCalculateEffectiveSettingsResponse response = securityCenterSettingsServiceClient.batchCalculateEffectiveSettings(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
batchCalculateEffectiveSettingsCallable
public final UnaryCallable<BatchCalculateEffectiveSettingsRequest,BatchCalculateEffectiveSettingsResponse> batchCalculateEffectiveSettingsCallable()Gets a list of effective settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { BatchCalculateEffectiveSettingsRequest request = BatchCalculateEffectiveSettingsRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .addAllRequests(new ArrayList<CalculateEffectiveSettingsRequest>()) .build(); ApiFuture<BatchCalculateEffectiveSettingsResponse> future = securityCenterSettingsServiceClient .batchCalculateEffectiveSettingsCallable() .futureCall(request); // Do something. BatchCalculateEffectiveSettingsResponse response = future.get(); } -
getComponentSettings
Gets the Component Settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { ComponentSettingsName name = ComponentSettingsName.ofOrganizationComponentName("[ORGANIZATION]", "[COMPONENT]"); ComponentSettings response = securityCenterSettingsServiceClient.getComponentSettings(name); }- Parameters:
name- Required. The component settings to retrieve.Formats: * `organizations/{organization}/components/{component}/settings` * `folders/{folder}/components/{component}/settings` * `projects/{project}/components/{component}/settings` * `projects/{project}/locations/{location}/clusters/{cluster}/components/{component}/settings` * `projects/{project}/regions/{region}/clusters/{cluster}/components/{component}/settings` * `projects/{project}/zones/{zone}/clusters/{cluster}/components/{component}/settings`
- Throws:
ApiException- if the remote call fails
-
getComponentSettings
Gets the Component Settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { String name = ComponentSettingsName.ofOrganizationComponentName("[ORGANIZATION]", "[COMPONENT]") .toString(); ComponentSettings response = securityCenterSettingsServiceClient.getComponentSettings(name); }- Parameters:
name- Required. The component settings to retrieve.Formats: * `organizations/{organization}/components/{component}/settings` * `folders/{folder}/components/{component}/settings` * `projects/{project}/components/{component}/settings` * `projects/{project}/locations/{location}/clusters/{cluster}/components/{component}/settings` * `projects/{project}/regions/{region}/clusters/{cluster}/components/{component}/settings` * `projects/{project}/zones/{zone}/clusters/{cluster}/components/{component}/settings`
- Throws:
ApiException- if the remote call fails
-
getComponentSettings
Gets the Component Settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { GetComponentSettingsRequest request = GetComponentSettingsRequest.newBuilder() .setName( ComponentSettingsName.ofOrganizationComponentName("[ORGANIZATION]", "[COMPONENT]") .toString()) .build(); ComponentSettings response = securityCenterSettingsServiceClient.getComponentSettings(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getComponentSettingsCallable
public final UnaryCallable<GetComponentSettingsRequest,ComponentSettings> getComponentSettingsCallable()Gets the Component Settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { GetComponentSettingsRequest request = GetComponentSettingsRequest.newBuilder() .setName( ComponentSettingsName.ofOrganizationComponentName("[ORGANIZATION]", "[COMPONENT]") .toString()) .build(); ApiFuture<ComponentSettings> future = securityCenterSettingsServiceClient.getComponentSettingsCallable().futureCall(request); // Do something. ComponentSettings response = future.get(); } -
updateComponentSettings
public final ComponentSettings updateComponentSettings(ComponentSettings componentSettings, com.google.protobuf.FieldMask updateMask) Updates the Component Settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { ComponentSettings componentSettings = ComponentSettings.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); ComponentSettings response = securityCenterSettingsServiceClient.updateComponentSettings( componentSettings, updateMask); }- Parameters:
componentSettings- Required. The component settings to update.The component settings' `name` field is used to identify the component settings to be updated. Formats: * `organizations/{organization}/components/{component}/settings` * `folders/{folder}/components/{component}/settings` * `projects/{project}/components/{component}/settings` * `projects/{project}/locations/{location}/clusters/{cluster}/components/{component}/settings` * `projects/{project}/regions/{region}/clusters/{cluster}/components/{component}/settings` * `projects/{project}/zones/{zone}/clusters/{cluster}/components/{component}/settings`
updateMask- The list of fields to be updated on the component settings resource.- Throws:
ApiException- if the remote call fails
-
updateComponentSettings
Updates the Component Settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { UpdateComponentSettingsRequest request = UpdateComponentSettingsRequest.newBuilder() .setComponentSettings(ComponentSettings.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ComponentSettings response = securityCenterSettingsServiceClient.updateComponentSettings(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateComponentSettingsCallable
public final UnaryCallable<UpdateComponentSettingsRequest,ComponentSettings> updateComponentSettingsCallable()Updates the Component Settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { UpdateComponentSettingsRequest request = UpdateComponentSettingsRequest.newBuilder() .setComponentSettings(ComponentSettings.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<ComponentSettings> future = securityCenterSettingsServiceClient.updateComponentSettingsCallable().futureCall(request); // Do something. ComponentSettings response = future.get(); } -
resetComponentSettings
Reset the organization, folder or project's component settings and return the settings to the default. Settings are present at the organization, folder and project levels. Using Reset for a folder or project will remove the override that was set and result in the organization-level settings being used.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { ResetComponentSettingsRequest request = ResetComponentSettingsRequest.newBuilder() .setName( ComponentSettingsName.ofOrganizationComponentName("[ORGANIZATION]", "[COMPONENT]") .toString()) .setEtag("etag3123477") .build(); securityCenterSettingsServiceClient.resetComponentSettings(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
resetComponentSettingsCallable
public final UnaryCallable<ResetComponentSettingsRequest,com.google.protobuf.Empty> resetComponentSettingsCallable()Reset the organization, folder or project's component settings and return the settings to the default. Settings are present at the organization, folder and project levels. Using Reset for a folder or project will remove the override that was set and result in the organization-level settings being used.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { ResetComponentSettingsRequest request = ResetComponentSettingsRequest.newBuilder() .setName( ComponentSettingsName.ofOrganizationComponentName("[ORGANIZATION]", "[COMPONENT]") .toString()) .setEtag("etag3123477") .build(); ApiFuture<Empty> future = securityCenterSettingsServiceClient.resetComponentSettingsCallable().futureCall(request); // Do something. future.get(); } -
calculateEffectiveComponentSettings
Gets the Effective Component Settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { ComponentSettingsName name = ComponentSettingsName.ofOrganizationComponentName("[ORGANIZATION]", "[COMPONENT]"); ComponentSettings response = securityCenterSettingsServiceClient.calculateEffectiveComponentSettings(name); }- Parameters:
name- Required. The effective component settings to retrieve.Formats: * `organizations/{organization}/components/{component}/settings` * `folders/{folder}/components/{component}/settings` * `projects/{project}/components/{component}/settings` * `projects/{project}/locations/{location}/clusters/{cluster}/components/{component}/settings` * `projects/{project}/regions/{region}/clusters/{cluster}/components/{component}/settings` * `projects/{project}/zones/{zone}/clusters/{cluster}/components/{component}/settings`
- Throws:
ApiException- if the remote call fails
-
calculateEffectiveComponentSettings
Gets the Effective Component Settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { String name = ComponentSettingsName.ofOrganizationComponentName("[ORGANIZATION]", "[COMPONENT]") .toString(); ComponentSettings response = securityCenterSettingsServiceClient.calculateEffectiveComponentSettings(name); }- Parameters:
name- Required. The effective component settings to retrieve.Formats: * `organizations/{organization}/components/{component}/settings` * `folders/{folder}/components/{component}/settings` * `projects/{project}/components/{component}/settings` * `projects/{project}/locations/{location}/clusters/{cluster}/components/{component}/settings` * `projects/{project}/regions/{region}/clusters/{cluster}/components/{component}/settings` * `projects/{project}/zones/{zone}/clusters/{cluster}/components/{component}/settings`
- Throws:
ApiException- if the remote call fails
-
calculateEffectiveComponentSettings
public final ComponentSettings calculateEffectiveComponentSettings(CalculateEffectiveComponentSettingsRequest request) Gets the Effective Component Settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { CalculateEffectiveComponentSettingsRequest request = CalculateEffectiveComponentSettingsRequest.newBuilder() .setName( ComponentSettingsName.ofOrganizationComponentName("[ORGANIZATION]", "[COMPONENT]") .toString()) .build(); ComponentSettings response = securityCenterSettingsServiceClient.calculateEffectiveComponentSettings(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
calculateEffectiveComponentSettingsCallable
public final UnaryCallable<CalculateEffectiveComponentSettingsRequest,ComponentSettings> calculateEffectiveComponentSettingsCallable()Gets the Effective Component Settings.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { CalculateEffectiveComponentSettingsRequest request = CalculateEffectiveComponentSettingsRequest.newBuilder() .setName( ComponentSettingsName.ofOrganizationComponentName("[ORGANIZATION]", "[COMPONENT]") .toString()) .build(); ApiFuture<ComponentSettings> future = securityCenterSettingsServiceClient .calculateEffectiveComponentSettingsCallable() .futureCall(request); // Do something. ComponentSettings response = future.get(); } -
listDetectors
public final SecurityCenterSettingsServiceClient.ListDetectorsPagedResponse listDetectors(OrganizationName parent) Retrieves an unordered list of available detectors.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); for (Detector element : securityCenterSettingsServiceClient.listDetectors(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of detectors. Format: * `organizations/{organization}`- Throws:
ApiException- if the remote call fails
-
listDetectors
public final SecurityCenterSettingsServiceClient.ListDetectorsPagedResponse listDetectors(String parent) Retrieves an unordered list of available detectors.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { String parent = OrganizationName.of("[ORGANIZATION]").toString(); for (Detector element : securityCenterSettingsServiceClient.listDetectors(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of detectors. Format: * `organizations/{organization}`- Throws:
ApiException- if the remote call fails
-
listDetectors
public final SecurityCenterSettingsServiceClient.ListDetectorsPagedResponse listDetectors(ListDetectorsRequest request) Retrieves an unordered list of available detectors.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { ListDetectorsRequest request = ListDetectorsRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Detector element : securityCenterSettingsServiceClient.listDetectors(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listDetectorsPagedCallable
public final UnaryCallable<ListDetectorsRequest,SecurityCenterSettingsServiceClient.ListDetectorsPagedResponse> listDetectorsPagedCallable()Retrieves an unordered list of available detectors.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { ListDetectorsRequest request = ListDetectorsRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Detector> future = securityCenterSettingsServiceClient.listDetectorsPagedCallable().futureCall(request); // Do something. for (Detector element : future.get().iterateAll()) { // doThingsWith(element); } } -
listDetectorsCallable
Retrieves an unordered list of available detectors.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { ListDetectorsRequest request = ListDetectorsRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListDetectorsResponse response = securityCenterSettingsServiceClient.listDetectorsCallable().call(request); for (Detector element : response.getDetectorsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
listComponents
public final SecurityCenterSettingsServiceClient.ListComponentsPagedResponse listComponents(OrganizationName parent) Retrieves an unordered list of available SCC components.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); for (String element : securityCenterSettingsServiceClient.listComponents(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of components. Format: * `organizations/{organization}`- Throws:
ApiException- if the remote call fails
-
listComponents
public final SecurityCenterSettingsServiceClient.ListComponentsPagedResponse listComponents(String parent) Retrieves an unordered list of available SCC components.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { String parent = OrganizationName.of("[ORGANIZATION]").toString(); for (String element : securityCenterSettingsServiceClient.listComponents(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent, which owns this collection of components. Format: * `organizations/{organization}`- Throws:
ApiException- if the remote call fails
-
listComponents
public final SecurityCenterSettingsServiceClient.ListComponentsPagedResponse listComponents(ListComponentsRequest request) Retrieves an unordered list of available SCC components.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { ListComponentsRequest request = ListComponentsRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (String element : securityCenterSettingsServiceClient.listComponents(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listComponentsPagedCallable
public final UnaryCallable<ListComponentsRequest,SecurityCenterSettingsServiceClient.ListComponentsPagedResponse> listComponentsPagedCallable()Retrieves an unordered list of available SCC components.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { ListComponentsRequest request = ListComponentsRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<String> future = securityCenterSettingsServiceClient.listComponentsPagedCallable().futureCall(request); // Do something. for (String element : future.get().iterateAll()) { // doThingsWith(element); } } -
listComponentsCallable
Retrieves an unordered list of available SCC components.Sample code:
// This snippet 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 as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (SecurityCenterSettingsServiceClient securityCenterSettingsServiceClient = SecurityCenterSettingsServiceClient.create()) { ListComponentsRequest request = ListComponentsRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListComponentsResponse response = securityCenterSettingsServiceClient.listComponentsCallable().call(request); for (String element : response.getComponentsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-