Class SecurityCenterClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
Source source = Source.newBuilder().build();
Source response = securityCenterClient.createSource(parent, source);
}
Note: close() needs to be called on the SecurityCenterClient 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 |
|---|---|---|
CreateSource |
Creates a source. |
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.
|
CreateFinding |
Creates a finding. The corresponding source must exist for finding creation to succeed. |
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.
|
CreateNotificationConfig |
Creates a notification config. |
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.
|
DeleteNotificationConfig |
Deletes a notification config. |
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.
|
GetIamPolicy |
Gets the access control policy on the specified Source. |
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.
|
GetNotificationConfig |
Gets a notification config. |
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.
|
GetOrganizationSettings |
Gets the settings for an organization. |
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.
|
GetSource |
Gets a source. |
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.
|
GroupAssets |
Filters an organization's assets and groups them by their specified properties. |
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.
|
GroupFindings |
Filters an organization or source's findings and groups them by their specified properties. To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings |
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.
|
ListAssets |
Lists an organization's assets. |
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.
|
ListFindings |
Lists an organization or source's findings. To list across all sources provide a `-` as the source id. Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings |
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.
|
ListNotificationConfigs |
Lists notification configs. |
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.
|
ListSources |
Lists all sources belonging to an organization. |
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.
|
RunAssetDiscovery |
Runs asset discovery. The discovery is tracked with a long-running operation. This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetFindingState |
Updates the state of a finding. |
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.
|
SetIamPolicy |
Sets the access control policy on the specified Source. |
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.
|
TestIamPermissions |
Returns the permissions that a caller has on the specified source. |
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.
|
UpdateFinding |
Creates or updates a finding. The corresponding source must exist for a finding creation to succeed. |
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.
|
UpdateNotificationConfig |
Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter |
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.
|
UpdateOrganizationSettings |
Updates an organization's 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.
|
UpdateSource |
Updates a source. |
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.
|
UpdateSecurityMarks |
Updates security marks. |
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 SecurityCenterSettings 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
SecurityCenterSettings securityCenterSettings =
SecurityCenterSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
SecurityCenterClient securityCenterClient = SecurityCenterClient.create(securityCenterSettings);
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
SecurityCenterSettings securityCenterSettings =
SecurityCenterSettings.newBuilder().setEndpoint(myEndpoint).build();
SecurityCenterClient securityCenterClient = SecurityCenterClient.create(securityCenterSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// 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
SecurityCenterSettings securityCenterSettings =
SecurityCenterSettings.newHttpJsonBuilder().build();
SecurityCenterClient securityCenterClient = SecurityCenterClient.create(securityCenterSettings);
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 classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSecurityCenterClient(SecurityCenterSettings settings) Constructs an instance of SecurityCenterClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final SecurityCenterClientcreate()Constructs an instance of SecurityCenterClient with default settings.static final SecurityCenterClientcreate(SecurityCenterSettings settings) Constructs an instance of SecurityCenterClient, using the given settings.static final SecurityCenterClientcreate(SecurityCenterStub stub) Constructs an instance of SecurityCenterClient, using the given stub for making calls.final FindingcreateFinding(CreateFindingRequest request) Creates a finding.final FindingcreateFinding(SourceName parent, Finding finding, String findingId) Creates a finding.final FindingcreateFinding(SourceName parent, String findingId, Finding finding) Creates a finding.final FindingcreateFinding(String parent, Finding finding, String findingId) Creates a finding.final FindingcreateFinding(String parent, String findingId, Finding finding) Creates a finding.Creates a finding.final NotificationConfigCreates a notification config.final NotificationConfigcreateNotificationConfig(OrganizationName parent, NotificationConfig notificationConfig) Creates a notification config.final NotificationConfigcreateNotificationConfig(OrganizationName parent, String configId, NotificationConfig notificationConfig) Creates a notification config.final NotificationConfigcreateNotificationConfig(String parent, NotificationConfig notificationConfig) Creates a notification config.final NotificationConfigcreateNotificationConfig(String parent, String configId, NotificationConfig notificationConfig) Creates a notification config.Creates a notification config.final SourcecreateSource(CreateSourceRequest request) Creates a source.final SourcecreateSource(OrganizationName parent, Source source) Creates a source.final SourcecreateSource(String parent, Source source) Creates a source.Creates a source.final voidDeletes a notification config.final voidDeletes a notification config.final voidDeletes a notification config.final UnaryCallable<DeleteNotificationConfigRequest,com.google.protobuf.Empty> Deletes a notification config.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final PolicygetIamPolicy(ResourceName resource) Gets the access control policy on the specified Source.final PolicygetIamPolicy(GetIamPolicyRequest request) Gets the access control policy on the specified Source.final PolicygetIamPolicy(String resource) Gets the access control policy on the specified Source.Gets the access control policy on the specified Source.final NotificationConfigGets a notification config.final NotificationConfigGets a notification config.final NotificationConfiggetNotificationConfig(String name) Gets a notification config.Gets a notification config.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final OrganizationSettingsGets the settings for an organization.final OrganizationSettingsGets the settings for an organization.final OrganizationSettingsGets the settings for an organization.Gets the settings for an organization.final SecurityCenterSettingsfinal SourcegetSource(GetSourceRequest request) Gets a source.final SourcegetSource(SourceName name) Gets a source.final SourceGets a source.final UnaryCallable<GetSourceRequest,Source> Gets a source.getStub()groupAssets(GroupAssetsRequest request) Filters an organization's assets and groups them by their specified properties.Filters an organization's assets and groups them by their specified properties.Filters an organization's assets and groups them by their specified properties.groupFindings(GroupFindingsRequest request) Filters an organization or source's findings and groups them by their specified properties.groupFindings(SourceName parent, String groupBy) Filters an organization or source's findings and groups them by their specified properties.groupFindings(String parent, String groupBy) Filters an organization or source's findings and groups them by their specified properties.Filters an organization or source's findings and groups them by their specified properties.Filters an organization or source's findings and groups them by their specified properties.booleanbooleanlistAssets(FolderName parent) Lists an organization's assets.listAssets(ListAssetsRequest request) Lists an organization's assets.listAssets(OrganizationName parent) Lists an organization's assets.listAssets(ProjectName parent) Lists an organization's assets.listAssets(String parent) Lists an organization's assets.Lists an organization's assets.Lists an organization's assets.listFindings(ListFindingsRequest request) Lists an organization or source's findings.listFindings(SourceName parent) Lists an organization or source's findings.listFindings(String parent) Lists an organization or source's findings.Lists an organization or source's findings.Lists an organization or source's findings.Lists notification configs.Lists notification configs.listNotificationConfigs(String parent) Lists notification configs.Lists notification configs.final UnaryCallable<ListNotificationConfigsRequest,SecurityCenterClient.ListNotificationConfigsPagedResponse> Lists notification configs.listSources(FolderName parent) Lists all sources belonging to an organization.listSources(ListSourcesRequest request) Lists all sources belonging to an organization.listSources(OrganizationName parent) Lists all sources belonging to an organization.listSources(ProjectName parent) Lists all sources belonging to an organization.listSources(String parent) Lists all sources belonging to an organization.Lists all sources belonging to an organization.Lists all sources belonging to an organization.final OperationFuture<RunAssetDiscoveryResponse,com.google.protobuf.Empty> Runs asset discovery.final OperationFuture<RunAssetDiscoveryResponse,com.google.protobuf.Empty> Runs asset discovery.final OperationFuture<RunAssetDiscoveryResponse,com.google.protobuf.Empty> runAssetDiscoveryAsync(String parent) Runs asset discovery.Runs asset discovery.final OperationCallable<RunAssetDiscoveryRequest,RunAssetDiscoveryResponse, com.google.protobuf.Empty> Runs asset discovery.final FindingsetFindingState(FindingName name, Finding.State state, com.google.protobuf.Timestamp startTime) Updates the state of a finding.final FindingsetFindingState(SetFindingStateRequest request) Updates the state of a finding.final FindingsetFindingState(String name, Finding.State state, com.google.protobuf.Timestamp startTime) Updates the state of a finding.Updates the state of a finding.final PolicysetIamPolicy(ResourceName resource, Policy policy) Sets the access control policy on the specified Source.final PolicysetIamPolicy(SetIamPolicyRequest request) Sets the access control policy on the specified Source.final PolicysetIamPolicy(String resource, Policy policy) Sets the access control policy on the specified Source.Sets the access control policy on the specified Source.voidshutdown()voidtestIamPermissions(ResourceName resource, List<String> permissions) Returns the permissions that a caller has on the specified source.Returns the permissions that a caller has on the specified source.testIamPermissions(String resource, List<String> permissions) Returns the permissions that a caller has on the specified source.Returns the permissions that a caller has on the specified source.final FindingupdateFinding(Finding finding) Creates or updates a finding.final FindingupdateFinding(Finding finding, com.google.protobuf.FieldMask updateMask) Creates or updates a finding.final FindingupdateFinding(UpdateFindingRequest request) Creates or updates a finding.Creates or updates a finding.final NotificationConfigupdateNotificationConfig(NotificationConfig notificationConfig) Updates a notification config.final NotificationConfigupdateNotificationConfig(NotificationConfig notificationConfig, com.google.protobuf.FieldMask updateMask) Updates a notification config.final NotificationConfigUpdates a notification config.Updates a notification config.final OrganizationSettingsupdateOrganizationSettings(OrganizationSettings organizationSettings) Updates an organization's settings.final OrganizationSettingsUpdates an organization's settings.Updates an organization's settings.final SecurityMarksupdateSecurityMarks(SecurityMarks securityMarks) Updates security marks.final SecurityMarksupdateSecurityMarks(SecurityMarks securityMarks, com.google.protobuf.FieldMask updateMask) Updates security marks.final SecurityMarksUpdates security marks.Updates security marks.final SourceupdateSource(Source source) Updates a source.final SourceupdateSource(Source source, com.google.protobuf.FieldMask updateMask) Updates a source.final SourceupdateSource(UpdateSourceRequest request) Updates a source.Updates a source.
-
Constructor Details
-
SecurityCenterClient
Constructs an instance of SecurityCenterClient, 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
-
SecurityCenterClient
-
-
Method Details
-
create
Constructs an instance of SecurityCenterClient with default settings.- Throws:
IOException
-
create
Constructs an instance of SecurityCenterClient, 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
Constructs an instance of SecurityCenterClient, using the given stub for making calls. This is for advanced usage - prefer using create(SecurityCenterSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
getHttpJsonOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
createSource
Creates a source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); Source source = Source.newBuilder().build(); Source response = securityCenterClient.createSource(parent, source); }- Parameters:
parent- Required. Resource name of the new source's parent. Its format should be "organizations/[organization_id]".source- Required. The Source being created, only the display_name and description will be used. All other fields will be ignored.- Throws:
ApiException- if the remote call fails
-
createSource
Creates a source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String parent = OrganizationName.of("[ORGANIZATION]").toString(); Source source = Source.newBuilder().build(); Source response = securityCenterClient.createSource(parent, source); }- Parameters:
parent- Required. Resource name of the new source's parent. Its format should be "organizations/[organization_id]".source- Required. The Source being created, only the display_name and description will be used. All other fields will be ignored.- Throws:
ApiException- if the remote call fails
-
createSource
Creates a source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { CreateSourceRequest request = CreateSourceRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setSource(Source.newBuilder().build()) .build(); Source response = securityCenterClient.createSource(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createSourceCallable
Creates a source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { CreateSourceRequest request = CreateSourceRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setSource(Source.newBuilder().build()) .build(); ApiFuture<Source> future = securityCenterClient.createSourceCallable().futureCall(request); // Do something. Source response = future.get(); } -
createFinding
Creates a finding. The corresponding source must exist for finding creation to succeed.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { SourceName parent = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]"); Finding finding = Finding.newBuilder().build(); String findingId = "findingId439150212"; Finding response = securityCenterClient.createFinding(parent, finding, findingId); }- Parameters:
parent- Required. Resource name of the new finding's parent. Its format should be "organizations/[organization_id]/sources/[source_id]".finding- Required. The Finding being created. The name and security_marks will be ignored as they are both output only fields on this resource.findingId- Required. Unique identifier provided by the client within the parent scope.- Throws:
ApiException- if the remote call fails
-
createFinding
Creates a finding. The corresponding source must exist for finding creation to succeed.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { SourceName parent = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]"); String findingId = "findingId439150212"; Finding finding = Finding.newBuilder().build(); Finding response = securityCenterClient.createFinding(parent, findingId, finding); }- Parameters:
parent- Required. Resource name of the new finding's parent. Its format should be "organizations/[organization_id]/sources/[source_id]".findingId- Required. Unique identifier provided by the client within the parent scope.finding- Required. The Finding being created. The name and security_marks will be ignored as they are both output only fields on this resource.- Throws:
ApiException- if the remote call fails
-
createFinding
Creates a finding. The corresponding source must exist for finding creation to succeed.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String parent = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString(); Finding finding = Finding.newBuilder().build(); String findingId = "findingId439150212"; Finding response = securityCenterClient.createFinding(parent, finding, findingId); }- Parameters:
parent- Required. Resource name of the new finding's parent. Its format should be "organizations/[organization_id]/sources/[source_id]".finding- Required. The Finding being created. The name and security_marks will be ignored as they are both output only fields on this resource.findingId- Required. Unique identifier provided by the client within the parent scope.- Throws:
ApiException- if the remote call fails
-
createFinding
Creates a finding. The corresponding source must exist for finding creation to succeed.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String parent = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString(); String findingId = "findingId439150212"; Finding finding = Finding.newBuilder().build(); Finding response = securityCenterClient.createFinding(parent, findingId, finding); }- Parameters:
parent- Required. Resource name of the new finding's parent. Its format should be "organizations/[organization_id]/sources/[source_id]".findingId- Required. Unique identifier provided by the client within the parent scope.finding- Required. The Finding being created. The name and security_marks will be ignored as they are both output only fields on this resource.- Throws:
ApiException- if the remote call fails
-
createFinding
Creates a finding. The corresponding source must exist for finding creation to succeed.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { CreateFindingRequest request = CreateFindingRequest.newBuilder() .setParent( SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString()) .setFindingId("findingId439150212") .setFinding(Finding.newBuilder().build()) .build(); Finding response = securityCenterClient.createFinding(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createFindingCallable
Creates a finding. The corresponding source must exist for finding creation to succeed.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { CreateFindingRequest request = CreateFindingRequest.newBuilder() .setParent( SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString()) .setFindingId("findingId439150212") .setFinding(Finding.newBuilder().build()) .build(); ApiFuture<Finding> future = securityCenterClient.createFindingCallable().futureCall(request); // Do something. Finding response = future.get(); } -
createNotificationConfig
public final NotificationConfig createNotificationConfig(OrganizationName parent, NotificationConfig notificationConfig) Creates a notification config.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); NotificationConfig notificationConfig = NotificationConfig.newBuilder().build(); NotificationConfig response = securityCenterClient.createNotificationConfig(parent, notificationConfig); }- Parameters:
parent- Required. Resource name of the new notification config's parent. Its format is "organizations/[organization_id]".notificationConfig- Required. The notification config being created. The name and the service account will be ignored as they are both output only fields on this resource.- Throws:
ApiException- if the remote call fails
-
createNotificationConfig
public final NotificationConfig createNotificationConfig(String parent, NotificationConfig notificationConfig) Creates a notification config.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String parent = OrganizationName.of("[ORGANIZATION]").toString(); NotificationConfig notificationConfig = NotificationConfig.newBuilder().build(); NotificationConfig response = securityCenterClient.createNotificationConfig(parent, notificationConfig); }- Parameters:
parent- Required. Resource name of the new notification config's parent. Its format is "organizations/[organization_id]".notificationConfig- Required. The notification config being created. The name and the service account will be ignored as they are both output only fields on this resource.- Throws:
ApiException- if the remote call fails
-
createNotificationConfig
public final NotificationConfig createNotificationConfig(OrganizationName parent, String configId, NotificationConfig notificationConfig) Creates a notification config.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); String configId = "configId-580140035"; NotificationConfig notificationConfig = NotificationConfig.newBuilder().build(); NotificationConfig response = securityCenterClient.createNotificationConfig(parent, configId, notificationConfig); }- Parameters:
parent- Required. Resource name of the new notification config's parent. Its format is "organizations/[organization_id]".configId- Required. Unique identifier provided by the client within the parent scope. It must be between 1 and 128 characters, and contains alphanumeric characters, underscores or hyphens only.notificationConfig- Required. The notification config being created. The name and the service account will be ignored as they are both output only fields on this resource.- Throws:
ApiException- if the remote call fails
-
createNotificationConfig
public final NotificationConfig createNotificationConfig(String parent, String configId, NotificationConfig notificationConfig) Creates a notification config.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String parent = OrganizationName.of("[ORGANIZATION]").toString(); String configId = "configId-580140035"; NotificationConfig notificationConfig = NotificationConfig.newBuilder().build(); NotificationConfig response = securityCenterClient.createNotificationConfig(parent, configId, notificationConfig); }- Parameters:
parent- Required. Resource name of the new notification config's parent. Its format is "organizations/[organization_id]".configId- Required. Unique identifier provided by the client within the parent scope. It must be between 1 and 128 characters, and contains alphanumeric characters, underscores or hyphens only.notificationConfig- Required. The notification config being created. The name and the service account will be ignored as they are both output only fields on this resource.- Throws:
ApiException- if the remote call fails
-
createNotificationConfig
Creates a notification config.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { CreateNotificationConfigRequest request = CreateNotificationConfigRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setConfigId("configId-580140035") .setNotificationConfig(NotificationConfig.newBuilder().build()) .build(); NotificationConfig response = securityCenterClient.createNotificationConfig(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createNotificationConfigCallable
public final UnaryCallable<CreateNotificationConfigRequest,NotificationConfig> createNotificationConfigCallable()Creates a notification config.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { CreateNotificationConfigRequest request = CreateNotificationConfigRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setConfigId("configId-580140035") .setNotificationConfig(NotificationConfig.newBuilder().build()) .build(); ApiFuture<NotificationConfig> future = securityCenterClient.createNotificationConfigCallable().futureCall(request); // Do something. NotificationConfig response = future.get(); } -
deleteNotificationConfig
Deletes a notification config.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { NotificationConfigName name = NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]"); securityCenterClient.deleteNotificationConfig(name); }- Parameters:
name- Required. Name of the notification config to delete. Its format is "organizations/[organization_id]/notificationConfigs/[config_id]".- Throws:
ApiException- if the remote call fails
-
deleteNotificationConfig
Deletes a notification config.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String name = NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]").toString(); securityCenterClient.deleteNotificationConfig(name); }- Parameters:
name- Required. Name of the notification config to delete. Its format is "organizations/[organization_id]/notificationConfigs/[config_id]".- Throws:
ApiException- if the remote call fails
-
deleteNotificationConfig
Deletes a notification config.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { DeleteNotificationConfigRequest request = DeleteNotificationConfigRequest.newBuilder() .setName( NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]").toString()) .build(); securityCenterClient.deleteNotificationConfig(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteNotificationConfigCallable
public final UnaryCallable<DeleteNotificationConfigRequest,com.google.protobuf.Empty> deleteNotificationConfigCallable()Deletes a notification config.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { DeleteNotificationConfigRequest request = DeleteNotificationConfigRequest.newBuilder() .setName( NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]").toString()) .build(); ApiFuture<Empty> future = securityCenterClient.deleteNotificationConfigCallable().futureCall(request); // Do something. future.get(); } -
getIamPolicy
Gets the access control policy on the specified Source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ResourceName resource = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]"); Policy response = securityCenterClient.getIamPolicy(resource); }- Parameters:
resource- REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.- Throws:
ApiException- if the remote call fails
-
getIamPolicy
Gets the access control policy on the specified Source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String resource = FolderName.of("[FOLDER]").toString(); Policy response = securityCenterClient.getIamPolicy(resource); }- Parameters:
resource- REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.- Throws:
ApiException- if the remote call fails
-
getIamPolicy
Gets the access control policy on the specified Source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource( SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); Policy response = securityCenterClient.getIamPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getIamPolicyCallable
Gets the access control policy on the specified Source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource( SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); ApiFuture<Policy> future = securityCenterClient.getIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); } -
getNotificationConfig
Gets a notification config.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { NotificationConfigName name = NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]"); NotificationConfig response = securityCenterClient.getNotificationConfig(name); }- Parameters:
name- Required. Name of the notification config to get. Its format is "organizations/[organization_id]/notificationConfigs/[config_id]".- Throws:
ApiException- if the remote call fails
-
getNotificationConfig
Gets a notification config.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String name = NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]").toString(); NotificationConfig response = securityCenterClient.getNotificationConfig(name); }- Parameters:
name- Required. Name of the notification config to get. Its format is "organizations/[organization_id]/notificationConfigs/[config_id]".- Throws:
ApiException- if the remote call fails
-
getNotificationConfig
Gets a notification config.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { GetNotificationConfigRequest request = GetNotificationConfigRequest.newBuilder() .setName( NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]").toString()) .build(); NotificationConfig response = securityCenterClient.getNotificationConfig(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getNotificationConfigCallable
public final UnaryCallable<GetNotificationConfigRequest,NotificationConfig> getNotificationConfigCallable()Gets a notification config.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { GetNotificationConfigRequest request = GetNotificationConfigRequest.newBuilder() .setName( NotificationConfigName.of("[ORGANIZATION]", "[NOTIFICATION_CONFIG]").toString()) .build(); ApiFuture<NotificationConfig> future = securityCenterClient.getNotificationConfigCallable().futureCall(request); // Do something. NotificationConfig response = future.get(); } -
getOrganizationSettings
Gets the settings for an organization.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { OrganizationSettingsName name = OrganizationSettingsName.of("[ORGANIZATION]"); OrganizationSettings response = securityCenterClient.getOrganizationSettings(name); }- Parameters:
name- Required. Name of the organization to get organization settings for. Its format is "organizations/[organization_id]/organizationSettings".- Throws:
ApiException- if the remote call fails
-
getOrganizationSettings
Gets the settings for an organization.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String name = OrganizationSettingsName.of("[ORGANIZATION]").toString(); OrganizationSettings response = securityCenterClient.getOrganizationSettings(name); }- Parameters:
name- Required. Name of the organization to get organization settings for. Its format is "organizations/[organization_id]/organizationSettings".- Throws:
ApiException- if the remote call fails
-
getOrganizationSettings
Gets the settings for an organization.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { GetOrganizationSettingsRequest request = GetOrganizationSettingsRequest.newBuilder() .setName(OrganizationSettingsName.of("[ORGANIZATION]").toString()) .build(); OrganizationSettings response = securityCenterClient.getOrganizationSettings(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getOrganizationSettingsCallable
public final UnaryCallable<GetOrganizationSettingsRequest,OrganizationSettings> getOrganizationSettingsCallable()Gets the settings for an organization.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { GetOrganizationSettingsRequest request = GetOrganizationSettingsRequest.newBuilder() .setName(OrganizationSettingsName.of("[ORGANIZATION]").toString()) .build(); ApiFuture<OrganizationSettings> future = securityCenterClient.getOrganizationSettingsCallable().futureCall(request); // Do something. OrganizationSettings response = future.get(); } -
getSource
Gets a source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { SourceName name = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]"); Source response = securityCenterClient.getSource(name); }- Parameters:
name- Required. Relative resource name of the source. Its format is "organizations/[organization_id]/source/[source_id]".- Throws:
ApiException- if the remote call fails
-
getSource
Gets a source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String name = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString(); Source response = securityCenterClient.getSource(name); }- Parameters:
name- Required. Relative resource name of the source. Its format is "organizations/[organization_id]/source/[source_id]".- Throws:
ApiException- if the remote call fails
-
getSource
Gets a source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { GetSourceRequest request = GetSourceRequest.newBuilder() .setName(SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString()) .build(); Source response = securityCenterClient.getSource(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getSourceCallable
Gets a source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { GetSourceRequest request = GetSourceRequest.newBuilder() .setName(SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString()) .build(); ApiFuture<Source> future = securityCenterClient.getSourceCallable().futureCall(request); // Do something. Source response = future.get(); } -
groupAssets
Filters an organization's assets and groups them by their specified properties.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { GroupAssetsRequest request = GroupAssetsRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setFilter("filter-1274492040") .setGroupBy("groupBy293428022") .setCompareDuration(Duration.newBuilder().build()) .setReadTime(Timestamp.newBuilder().build()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); for (GroupResult element : securityCenterClient.groupAssets(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
-
groupAssetsPagedCallable
public final UnaryCallable<GroupAssetsRequest,SecurityCenterClient.GroupAssetsPagedResponse> groupAssetsPagedCallable()Filters an organization's assets and groups them by their specified properties.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { GroupAssetsRequest request = GroupAssetsRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setFilter("filter-1274492040") .setGroupBy("groupBy293428022") .setCompareDuration(Duration.newBuilder().build()) .setReadTime(Timestamp.newBuilder().build()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); ApiFuture<GroupResult> future = securityCenterClient.groupAssetsPagedCallable().futureCall(request); // Do something. for (GroupResult element : future.get().iterateAll()) { // doThingsWith(element); } } -
groupAssetsCallable
Filters an organization's assets and groups them by their specified properties.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { GroupAssetsRequest request = GroupAssetsRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setFilter("filter-1274492040") .setGroupBy("groupBy293428022") .setCompareDuration(Duration.newBuilder().build()) .setReadTime(Timestamp.newBuilder().build()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); while (true) { GroupAssetsResponse response = securityCenterClient.groupAssetsCallable().call(request); for (GroupResult element : response.getGroupByResultsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
groupFindings
public final SecurityCenterClient.GroupFindingsPagedResponse groupFindings(SourceName parent, String groupBy) Filters an organization or source's findings and groups them by their specified properties.To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings
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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { SourceName parent = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]"); String groupBy = "groupBy293428022"; for (GroupResult element : securityCenterClient.groupFindings(parent, groupBy).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Name of the source to groupBy. Its format is "organizations/[organization_id]/sources/[source_id]", folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]. To groupBy across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, or projects/{project_id}/sources/-groupBy- Required. Expression that defines what assets fields to use for grouping (including `state_change`). The string value should follow SQL syntax: comma separated list of fields. For example: "parent,resource_name".The following fields are supported:
- resource_name
- category
- state
- parent
- severity
The following fields are supported when compare_duration is set:
- state_change
- Throws:
ApiException- if the remote call fails
-
groupFindings
public final SecurityCenterClient.GroupFindingsPagedResponse groupFindings(String parent, String groupBy) Filters an organization or source's findings and groups them by their specified properties.To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings
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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String parent = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString(); String groupBy = "groupBy293428022"; for (GroupResult element : securityCenterClient.groupFindings(parent, groupBy).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Name of the source to groupBy. Its format is "organizations/[organization_id]/sources/[source_id]", folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]. To groupBy across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/-, or projects/{project_id}/sources/-groupBy- Required. Expression that defines what assets fields to use for grouping (including `state_change`). The string value should follow SQL syntax: comma separated list of fields. For example: "parent,resource_name".The following fields are supported:
- resource_name
- category
- state
- parent
- severity
The following fields are supported when compare_duration is set:
- state_change
- Throws:
ApiException- if the remote call fails
-
groupFindings
public final SecurityCenterClient.GroupFindingsPagedResponse groupFindings(GroupFindingsRequest request) Filters an organization or source's findings and groups them by their specified properties.To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings
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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { GroupFindingsRequest request = GroupFindingsRequest.newBuilder() .setParent( SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString()) .setFilter("filter-1274492040") .setGroupBy("groupBy293428022") .setReadTime(Timestamp.newBuilder().build()) .setCompareDuration(Duration.newBuilder().build()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); for (GroupResult element : securityCenterClient.groupFindings(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
-
groupFindingsPagedCallable
public final UnaryCallable<GroupFindingsRequest,SecurityCenterClient.GroupFindingsPagedResponse> groupFindingsPagedCallable()Filters an organization or source's findings and groups them by their specified properties.To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings
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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { GroupFindingsRequest request = GroupFindingsRequest.newBuilder() .setParent( SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString()) .setFilter("filter-1274492040") .setGroupBy("groupBy293428022") .setReadTime(Timestamp.newBuilder().build()) .setCompareDuration(Duration.newBuilder().build()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); ApiFuture<GroupResult> future = securityCenterClient.groupFindingsPagedCallable().futureCall(request); // Do something. for (GroupResult element : future.get().iterateAll()) { // doThingsWith(element); } } -
groupFindingsCallable
Filters an organization or source's findings and groups them by their specified properties.To group across all sources provide a `-` as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings
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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { GroupFindingsRequest request = GroupFindingsRequest.newBuilder() .setParent( SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString()) .setFilter("filter-1274492040") .setGroupBy("groupBy293428022") .setReadTime(Timestamp.newBuilder().build()) .setCompareDuration(Duration.newBuilder().build()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); while (true) { GroupFindingsResponse response = securityCenterClient.groupFindingsCallable().call(request); for (GroupResult element : response.getGroupByResultsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
listAssets
Lists an organization's assets.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { FolderName parent = FolderName.of("[FOLDER]"); for (ListAssetsResponse.ListAssetsResult element : securityCenterClient.listAssets(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Name of the organization assets should belong to. Its format is "organizations/[organization_id], folders/[folder_id], or projects/[project_id]".- Throws:
ApiException- if the remote call fails
-
listAssets
Lists an organization's assets.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); for (ListAssetsResponse.ListAssetsResult element : securityCenterClient.listAssets(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Name of the organization assets should belong to. Its format is "organizations/[organization_id], folders/[folder_id], or projects/[project_id]".- Throws:
ApiException- if the remote call fails
-
listAssets
Lists an organization's assets.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ProjectName parent = ProjectName.of("[PROJECT]"); for (ListAssetsResponse.ListAssetsResult element : securityCenterClient.listAssets(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Name of the organization assets should belong to. Its format is "organizations/[organization_id], folders/[folder_id], or projects/[project_id]".- Throws:
ApiException- if the remote call fails
-
listAssets
Lists an organization's assets.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String parent = OrganizationName.of("[ORGANIZATION]").toString(); for (ListAssetsResponse.ListAssetsResult element : securityCenterClient.listAssets(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Name of the organization assets should belong to. Its format is "organizations/[organization_id], folders/[folder_id], or projects/[project_id]".- Throws:
ApiException- if the remote call fails
-
listAssets
Lists an organization's assets.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ListAssetsRequest request = ListAssetsRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setReadTime(Timestamp.newBuilder().build()) .setCompareDuration(Duration.newBuilder().build()) .setFieldMask(FieldMask.newBuilder().build()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); for (ListAssetsResponse.ListAssetsResult element : securityCenterClient.listAssets(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
-
listAssetsPagedCallable
public final UnaryCallable<ListAssetsRequest,SecurityCenterClient.ListAssetsPagedResponse> listAssetsPagedCallable()Lists an organization's assets.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ListAssetsRequest request = ListAssetsRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setReadTime(Timestamp.newBuilder().build()) .setCompareDuration(Duration.newBuilder().build()) .setFieldMask(FieldMask.newBuilder().build()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); ApiFuture<ListAssetsResponse.ListAssetsResult> future = securityCenterClient.listAssetsPagedCallable().futureCall(request); // Do something. for (ListAssetsResponse.ListAssetsResult element : future.get().iterateAll()) { // doThingsWith(element); } } -
listAssetsCallable
Lists an organization's assets.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ListAssetsRequest request = ListAssetsRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setReadTime(Timestamp.newBuilder().build()) .setCompareDuration(Duration.newBuilder().build()) .setFieldMask(FieldMask.newBuilder().build()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); while (true) { ListAssetsResponse response = securityCenterClient.listAssetsCallable().call(request); for (ListAssetsResponse.ListAssetsResult element : response.getListAssetsResultsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
listFindings
Lists an organization or source's findings.To list across all sources provide a `-` as the source id. Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings
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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { SourceName parent = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]"); for (ListFindingsResponse.ListFindingsResult element : securityCenterClient.listFindings(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Name of the source the findings belong to. Its format is "organizations/[organization_id]/sources/[source_id], folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]". To list across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or projects/{projects_id}/sources/-- Throws:
ApiException- if the remote call fails
-
listFindings
Lists an organization or source's findings.To list across all sources provide a `-` as the source id. Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings
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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String parent = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString(); for (ListFindingsResponse.ListFindingsResult element : securityCenterClient.listFindings(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Name of the source the findings belong to. Its format is "organizations/[organization_id]/sources/[source_id], folders/[folder_id]/sources/[source_id], or projects/[project_id]/sources/[source_id]". To list across all sources provide a source_id of `-`. For example: organizations/{organization_id}/sources/-, folders/{folder_id}/sources/- or projects/{projects_id}/sources/-- Throws:
ApiException- if the remote call fails
-
listFindings
public final SecurityCenterClient.ListFindingsPagedResponse listFindings(ListFindingsRequest request) Lists an organization or source's findings.To list across all sources provide a `-` as the source id. Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings
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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ListFindingsRequest request = ListFindingsRequest.newBuilder() .setParent( SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString()) .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setReadTime(Timestamp.newBuilder().build()) .setCompareDuration(Duration.newBuilder().build()) .setFieldMask(FieldMask.newBuilder().build()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); for (ListFindingsResponse.ListFindingsResult element : securityCenterClient.listFindings(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
-
listFindingsPagedCallable
public final UnaryCallable<ListFindingsRequest,SecurityCenterClient.ListFindingsPagedResponse> listFindingsPagedCallable()Lists an organization or source's findings.To list across all sources provide a `-` as the source id. Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings
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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ListFindingsRequest request = ListFindingsRequest.newBuilder() .setParent( SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString()) .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setReadTime(Timestamp.newBuilder().build()) .setCompareDuration(Duration.newBuilder().build()) .setFieldMask(FieldMask.newBuilder().build()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); ApiFuture<ListFindingsResponse.ListFindingsResult> future = securityCenterClient.listFindingsPagedCallable().futureCall(request); // Do something. for (ListFindingsResponse.ListFindingsResult element : future.get().iterateAll()) { // doThingsWith(element); } } -
listFindingsCallable
Lists an organization or source's findings.To list across all sources provide a `-` as the source id. Example: /v1p1beta1/organizations/{organization_id}/sources/-/findings
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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ListFindingsRequest request = ListFindingsRequest.newBuilder() .setParent( SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString()) .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setReadTime(Timestamp.newBuilder().build()) .setCompareDuration(Duration.newBuilder().build()) .setFieldMask(FieldMask.newBuilder().build()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); while (true) { ListFindingsResponse response = securityCenterClient.listFindingsCallable().call(request); for (ListFindingsResponse.ListFindingsResult element : response.getListFindingsResultsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
listNotificationConfigs
public final SecurityCenterClient.ListNotificationConfigsPagedResponse listNotificationConfigs(OrganizationName parent) Lists notification configs.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); for (NotificationConfig element : securityCenterClient.listNotificationConfigs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Name of the organization to list notification configs. Its format is "organizations/[organization_id]".- Throws:
ApiException- if the remote call fails
-
listNotificationConfigs
public final SecurityCenterClient.ListNotificationConfigsPagedResponse listNotificationConfigs(String parent) Lists notification configs.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String parent = OrganizationName.of("[ORGANIZATION]").toString(); for (NotificationConfig element : securityCenterClient.listNotificationConfigs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Name of the organization to list notification configs. Its format is "organizations/[organization_id]".- Throws:
ApiException- if the remote call fails
-
listNotificationConfigs
public final SecurityCenterClient.ListNotificationConfigsPagedResponse listNotificationConfigs(ListNotificationConfigsRequest request) Lists notification configs.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ListNotificationConfigsRequest request = ListNotificationConfigsRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); for (NotificationConfig element : securityCenterClient.listNotificationConfigs(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
-
listNotificationConfigsPagedCallable
public final UnaryCallable<ListNotificationConfigsRequest,SecurityCenterClient.ListNotificationConfigsPagedResponse> listNotificationConfigsPagedCallable()Lists notification configs.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ListNotificationConfigsRequest request = ListNotificationConfigsRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); ApiFuture<NotificationConfig> future = securityCenterClient.listNotificationConfigsPagedCallable().futureCall(request); // Do something. for (NotificationConfig element : future.get().iterateAll()) { // doThingsWith(element); } } -
listNotificationConfigsCallable
public final UnaryCallable<ListNotificationConfigsRequest,ListNotificationConfigsResponse> listNotificationConfigsCallable()Lists notification configs.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ListNotificationConfigsRequest request = ListNotificationConfigsRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); while (true) { ListNotificationConfigsResponse response = securityCenterClient.listNotificationConfigsCallable().call(request); for (NotificationConfig element : response.getNotificationConfigsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
listSources
Lists all sources belonging to an organization.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { FolderName parent = FolderName.of("[FOLDER]"); for (Source element : securityCenterClient.listSources(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Resource name of the parent of sources to list. Its format should be "organizations/[organization_id], folders/[folder_id], or projects/[project_id]".- Throws:
ApiException- if the remote call fails
-
listSources
Lists all sources belonging to an organization.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); for (Source element : securityCenterClient.listSources(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Resource name of the parent of sources to list. Its format should be "organizations/[organization_id], folders/[folder_id], or projects/[project_id]".- Throws:
ApiException- if the remote call fails
-
listSources
Lists all sources belonging to an organization.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ProjectName parent = ProjectName.of("[PROJECT]"); for (Source element : securityCenterClient.listSources(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Resource name of the parent of sources to list. Its format should be "organizations/[organization_id], folders/[folder_id], or projects/[project_id]".- Throws:
ApiException- if the remote call fails
-
listSources
Lists all sources belonging to an organization.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String parent = OrganizationName.of("[ORGANIZATION]").toString(); for (Source element : securityCenterClient.listSources(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Resource name of the parent of sources to list. Its format should be "organizations/[organization_id], folders/[folder_id], or projects/[project_id]".- Throws:
ApiException- if the remote call fails
-
listSources
Lists all sources belonging to an organization.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ListSourcesRequest request = ListSourcesRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); for (Source element : securityCenterClient.listSources(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
-
listSourcesPagedCallable
public final UnaryCallable<ListSourcesRequest,SecurityCenterClient.ListSourcesPagedResponse> listSourcesPagedCallable()Lists all sources belonging to an organization.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ListSourcesRequest request = ListSourcesRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); ApiFuture<Source> future = securityCenterClient.listSourcesPagedCallable().futureCall(request); // Do something. for (Source element : future.get().iterateAll()) { // doThingsWith(element); } } -
listSourcesCallable
Lists all sources belonging to an organization.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ListSourcesRequest request = ListSourcesRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .setPageToken("pageToken873572522") .setPageSize(883849137) .build(); while (true) { ListSourcesResponse response = securityCenterClient.listSourcesCallable().call(request); for (Source element : response.getSourcesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
runAssetDiscoveryAsync
public final OperationFuture<RunAssetDiscoveryResponse,com.google.protobuf.Empty> runAssetDiscoveryAsync(OrganizationName parent) Runs asset discovery. The discovery is tracked with a long-running operation.This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.
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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); RunAssetDiscoveryResponse response = securityCenterClient.runAssetDiscoveryAsync(parent).get(); }- Parameters:
parent- Required. Name of the organization to run asset discovery for. Its format is "organizations/[organization_id]".- Throws:
ApiException- if the remote call fails
-
runAssetDiscoveryAsync
public final OperationFuture<RunAssetDiscoveryResponse,com.google.protobuf.Empty> runAssetDiscoveryAsync(String parent) Runs asset discovery. The discovery is tracked with a long-running operation.This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.
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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String parent = OrganizationName.of("[ORGANIZATION]").toString(); RunAssetDiscoveryResponse response = securityCenterClient.runAssetDiscoveryAsync(parent).get(); }- Parameters:
parent- Required. Name of the organization to run asset discovery for. Its format is "organizations/[organization_id]".- Throws:
ApiException- if the remote call fails
-
runAssetDiscoveryAsync
public final OperationFuture<RunAssetDiscoveryResponse,com.google.protobuf.Empty> runAssetDiscoveryAsync(RunAssetDiscoveryRequest request) Runs asset discovery. The discovery is tracked with a long-running operation.This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.
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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { RunAssetDiscoveryRequest request = RunAssetDiscoveryRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .build(); RunAssetDiscoveryResponse response = securityCenterClient.runAssetDiscoveryAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
runAssetDiscoveryOperationCallable
public final OperationCallable<RunAssetDiscoveryRequest,RunAssetDiscoveryResponse, runAssetDiscoveryOperationCallable()com.google.protobuf.Empty> Runs asset discovery. The discovery is tracked with a long-running operation.This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.
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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { RunAssetDiscoveryRequest request = RunAssetDiscoveryRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .build(); OperationFuture<RunAssetDiscoveryResponse, Empty> future = securityCenterClient.runAssetDiscoveryOperationCallable().futureCall(request); // Do something. RunAssetDiscoveryResponse response = future.get(); } -
runAssetDiscoveryCallable
Runs asset discovery. The discovery is tracked with a long-running operation.This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.
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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { RunAssetDiscoveryRequest request = RunAssetDiscoveryRequest.newBuilder() .setParent(OrganizationName.of("[ORGANIZATION]").toString()) .build(); ApiFuture<Operation> future = securityCenterClient.runAssetDiscoveryCallable().futureCall(request); // Do something. Operation response = future.get(); } -
setFindingState
public final Finding setFindingState(FindingName name, Finding.State state, com.google.protobuf.Timestamp startTime) Updates the state of a finding.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { FindingName name = FindingName.ofOrganizationSourceFindingName("[ORGANIZATION]", "[SOURCE]", "[FINDING]"); Finding.State state = Finding.State.forNumber(0); Timestamp startTime = Timestamp.newBuilder().build(); Finding response = securityCenterClient.setFindingState(name, state, startTime); }- Parameters:
name- Required. The relative resource name of the finding. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}".state- Required. The desired State of the finding.startTime- Required. The time at which the updated state takes effect.- Throws:
ApiException- if the remote call fails
-
setFindingState
public final Finding setFindingState(String name, Finding.State state, com.google.protobuf.Timestamp startTime) Updates the state of a finding.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String name = FindingName.ofOrganizationSourceFindingName("[ORGANIZATION]", "[SOURCE]", "[FINDING]") .toString(); Finding.State state = Finding.State.forNumber(0); Timestamp startTime = Timestamp.newBuilder().build(); Finding response = securityCenterClient.setFindingState(name, state, startTime); }- Parameters:
name- Required. The relative resource name of the finding. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}".state- Required. The desired State of the finding.startTime- Required. The time at which the updated state takes effect.- Throws:
ApiException- if the remote call fails
-
setFindingState
Updates the state of a finding.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { SetFindingStateRequest request = SetFindingStateRequest.newBuilder() .setName( FindingName.ofOrganizationSourceFindingName( "[ORGANIZATION]", "[SOURCE]", "[FINDING]") .toString()) .setStartTime(Timestamp.newBuilder().build()) .build(); Finding response = securityCenterClient.setFindingState(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
setFindingStateCallable
Updates the state of a finding.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { SetFindingStateRequest request = SetFindingStateRequest.newBuilder() .setName( FindingName.ofOrganizationSourceFindingName( "[ORGANIZATION]", "[SOURCE]", "[FINDING]") .toString()) .setStartTime(Timestamp.newBuilder().build()) .build(); ApiFuture<Finding> future = securityCenterClient.setFindingStateCallable().futureCall(request); // Do something. Finding response = future.get(); } -
setIamPolicy
Sets the access control policy on the specified Source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ResourceName resource = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]"); Policy policy = Policy.newBuilder().build(); Policy response = securityCenterClient.setIamPolicy(resource, policy); }- Parameters:
resource- REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.policy- REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.- Throws:
ApiException- if the remote call fails
-
setIamPolicy
Sets the access control policy on the specified Source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String resource = FolderName.of("[FOLDER]").toString(); Policy policy = Policy.newBuilder().build(); Policy response = securityCenterClient.setIamPolicy(resource, policy); }- Parameters:
resource- REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.policy- REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.- Throws:
ApiException- if the remote call fails
-
setIamPolicy
Sets the access control policy on the specified Source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource( SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy response = securityCenterClient.setIamPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
setIamPolicyCallable
Sets the access control policy on the specified Source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource( SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Policy> future = securityCenterClient.setIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); } -
testIamPermissions
public final TestIamPermissionsResponse testIamPermissions(ResourceName resource, List<String> permissions) Returns the permissions that a caller has on the specified source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { ResourceName resource = SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]"); List<String> permissions = new ArrayList<>(); TestIamPermissionsResponse response = securityCenterClient.testIamPermissions(resource, permissions); }- Parameters:
resource- REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.permissions- 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).- Throws:
ApiException- if the remote call fails
-
testIamPermissions
public final TestIamPermissionsResponse testIamPermissions(String resource, List<String> permissions) Returns the permissions that a caller has on the specified source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { String resource = FolderName.of("[FOLDER]").toString(); List<String> permissions = new ArrayList<>(); TestIamPermissionsResponse response = securityCenterClient.testIamPermissions(resource, permissions); }- Parameters:
resource- REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.permissions- 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).- Throws:
ApiException- if the remote call fails
-
testIamPermissions
Returns the permissions that a caller has on the specified source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource( SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString()) .addAllPermissions(new ArrayList<String>()) .build(); TestIamPermissionsResponse response = securityCenterClient.testIamPermissions(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
testIamPermissionsCallable
public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()Returns the permissions that a caller has on the specified source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource( SourceName.ofOrganizationSourceName("[ORGANIZATION]", "[SOURCE]").toString()) .addAllPermissions(new ArrayList<String>()) .build(); ApiFuture<TestIamPermissionsResponse> future = securityCenterClient.testIamPermissionsCallable().futureCall(request); // Do something. TestIamPermissionsResponse response = future.get(); } -
updateFinding
Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { Finding finding = Finding.newBuilder().build(); Finding response = securityCenterClient.updateFinding(finding); }- Parameters:
finding- Required. The finding resource to update or create if it does not already exist. parent, security_marks, and update_time will be ignored.In the case of creation, the finding id portion of the name must be alphanumeric and less than or equal to 32 characters and greater than 0 characters in length.
- Throws:
ApiException- if the remote call fails
-
updateFinding
Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { Finding finding = Finding.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Finding response = securityCenterClient.updateFinding(finding, updateMask); }- Parameters:
finding- Required. The finding resource to update or create if it does not already exist. parent, security_marks, and update_time will be ignored.In the case of creation, the finding id portion of the name must be alphanumeric and less than or equal to 32 characters and greater than 0 characters in length.
updateMask- The FieldMask to use when updating the finding resource. This field should not be specified when creating a finding.When updating a finding, an empty mask is treated as updating all mutable fields and replacing source_properties. Individual source_properties can be added/updated by using "source_properties.<property key>" in the field mask.
- Throws:
ApiException- if the remote call fails
-
updateFinding
Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { UpdateFindingRequest request = UpdateFindingRequest.newBuilder() .setFinding(Finding.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Finding response = securityCenterClient.updateFinding(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateFindingCallable
Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { UpdateFindingRequest request = UpdateFindingRequest.newBuilder() .setFinding(Finding.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Finding> future = securityCenterClient.updateFindingCallable().futureCall(request); // Do something. Finding response = future.get(); } -
updateNotificationConfig
Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filterSample 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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { NotificationConfig notificationConfig = NotificationConfig.newBuilder().build(); NotificationConfig response = securityCenterClient.updateNotificationConfig(notificationConfig); }- Parameters:
notificationConfig- Required. The notification config to update.- Throws:
ApiException- if the remote call fails
-
updateNotificationConfig
public final NotificationConfig updateNotificationConfig(NotificationConfig notificationConfig, com.google.protobuf.FieldMask updateMask) Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filterSample 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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { NotificationConfig notificationConfig = NotificationConfig.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); NotificationConfig response = securityCenterClient.updateNotificationConfig(notificationConfig, updateMask); }- Parameters:
notificationConfig- Required. The notification config to update.updateMask- The FieldMask to use when updating the notification config.If empty all mutable fields will be updated.
- Throws:
ApiException- if the remote call fails
-
updateNotificationConfig
Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filterSample 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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { UpdateNotificationConfigRequest request = UpdateNotificationConfigRequest.newBuilder() .setNotificationConfig(NotificationConfig.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); NotificationConfig response = securityCenterClient.updateNotificationConfig(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateNotificationConfigCallable
public final UnaryCallable<UpdateNotificationConfigRequest,NotificationConfig> updateNotificationConfigCallable()Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filterSample 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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { UpdateNotificationConfigRequest request = UpdateNotificationConfigRequest.newBuilder() .setNotificationConfig(NotificationConfig.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<NotificationConfig> future = securityCenterClient.updateNotificationConfigCallable().futureCall(request); // Do something. NotificationConfig response = future.get(); } -
updateOrganizationSettings
public final OrganizationSettings updateOrganizationSettings(OrganizationSettings organizationSettings) Updates an organization's 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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { OrganizationSettings organizationSettings = OrganizationSettings.newBuilder().build(); OrganizationSettings response = securityCenterClient.updateOrganizationSettings(organizationSettings); }- Parameters:
organizationSettings- Required. The organization settings resource to update.- Throws:
ApiException- if the remote call fails
-
updateOrganizationSettings
public final OrganizationSettings updateOrganizationSettings(UpdateOrganizationSettingsRequest request) Updates an organization's 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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { UpdateOrganizationSettingsRequest request = UpdateOrganizationSettingsRequest.newBuilder() .setOrganizationSettings(OrganizationSettings.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); OrganizationSettings response = securityCenterClient.updateOrganizationSettings(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateOrganizationSettingsCallable
public final UnaryCallable<UpdateOrganizationSettingsRequest,OrganizationSettings> updateOrganizationSettingsCallable()Updates an organization's 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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { UpdateOrganizationSettingsRequest request = UpdateOrganizationSettingsRequest.newBuilder() .setOrganizationSettings(OrganizationSettings.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<OrganizationSettings> future = securityCenterClient.updateOrganizationSettingsCallable().futureCall(request); // Do something. OrganizationSettings response = future.get(); } -
updateSource
Updates a source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { Source source = Source.newBuilder().build(); Source response = securityCenterClient.updateSource(source); }- Parameters:
source- Required. The source resource to update.- Throws:
ApiException- if the remote call fails
-
updateSource
Updates a source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { Source source = Source.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Source response = securityCenterClient.updateSource(source, updateMask); }- Parameters:
source- Required. The source resource to update.updateMask- The FieldMask to use when updating the source resource.If empty all mutable fields will be updated.
- Throws:
ApiException- if the remote call fails
-
updateSource
Updates a source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { UpdateSourceRequest request = UpdateSourceRequest.newBuilder() .setSource(Source.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Source response = securityCenterClient.updateSource(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateSourceCallable
Updates a source.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { UpdateSourceRequest request = UpdateSourceRequest.newBuilder() .setSource(Source.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Source> future = securityCenterClient.updateSourceCallable().futureCall(request); // Do something. Source response = future.get(); } -
updateSecurityMarks
Updates security marks.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { SecurityMarks securityMarks = SecurityMarks.newBuilder().build(); SecurityMarks response = securityCenterClient.updateSecurityMarks(securityMarks); }- Parameters:
securityMarks- Required. The security marks resource to update.- Throws:
ApiException- if the remote call fails
-
updateSecurityMarks
public final SecurityMarks updateSecurityMarks(SecurityMarks securityMarks, com.google.protobuf.FieldMask updateMask) Updates security marks.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { SecurityMarks securityMarks = SecurityMarks.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); SecurityMarks response = securityCenterClient.updateSecurityMarks(securityMarks, updateMask); }- Parameters:
securityMarks- Required. The security marks resource to update.updateMask- The FieldMask to use when updating the security marks resource.The field mask must not contain duplicate fields. If empty or set to "marks", all marks will be replaced. Individual marks can be updated using "marks.<mark_key>".
- Throws:
ApiException- if the remote call fails
-
updateSecurityMarks
Updates security marks.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { UpdateSecurityMarksRequest request = UpdateSecurityMarksRequest.newBuilder() .setSecurityMarks(SecurityMarks.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setStartTime(Timestamp.newBuilder().build()) .build(); SecurityMarks response = securityCenterClient.updateSecurityMarks(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateSecurityMarksCallable
Updates security marks.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 (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) { UpdateSecurityMarksRequest request = UpdateSecurityMarksRequest.newBuilder() .setSecurityMarks(SecurityMarks.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setStartTime(Timestamp.newBuilder().build()) .build(); ApiFuture<SecurityMarks> future = securityCenterClient.updateSecurityMarksCallable().futureCall(request); // Do something. SecurityMarks response = future.get(); } -
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
-