- 2.61.0 (latest)
- 2.60.0
- 2.59.0
- 2.57.0
- 2.56.0
- 2.55.0
- 2.54.0
- 2.53.0
- 2.52.0
- 2.51.0
- 2.50.0
- 2.49.0
- 2.48.0
- 2.47.0
- 2.45.0
- 2.44.0
- 2.43.0
- 2.42.0
- 2.41.0
- 2.40.0
- 2.39.0
- 2.38.0
- 2.37.0
- 2.36.0
- 2.35.0
- 2.32.0
- 2.31.0
- 2.30.0
- 2.29.0
- 2.28.0
- 2.27.0
- 2.26.0
- 2.25.0
- 2.24.0
- 2.23.0
- 2.22.0
- 2.21.0
- 2.20.0
- 2.19.0
- 2.17.0
- 2.16.0
- 2.15.0
- 2.14.0
- 2.13.0
- 2.12.0
- 2.11.1
- 2.10.0
- 2.9.0
- 2.8.0
- 2.7.1
- 2.6.0
- 2.5.6
- 2.3.2
public class SecurityCenterClient implements BackgroundResource
Service Description: V1 Beta APIs for Security Center service.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
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().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns 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:
SecurityCenterSettings securityCenterSettings =
SecurityCenterSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
SecurityCenterClient securityCenterClient = SecurityCenterClient.create(securityCenterSettings);
To customize the endpoint:
SecurityCenterSettings securityCenterSettings =
SecurityCenterSettings.newBuilder().setEndpoint(myEndpoint).build();
SecurityCenterClient securityCenterClient = SecurityCenterClient.create(securityCenterSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Implements
BackgroundResourceConstructors
SecurityCenterClient(SecurityCenterSettings settings)
protected SecurityCenterClient(SecurityCenterSettings settings)
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.
Name | Description |
settings | SecurityCenterSettings |
SecurityCenterClient(SecurityCenterStub stub)
protected SecurityCenterClient(SecurityCenterStub stub)
Name | Description |
stub | SecurityCenterStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Name | Description |
duration | long |
unit | TimeUnit |
Type | Description |
boolean |
Type | Description |
InterruptedException |
close()
public final void close()
create()
public static final SecurityCenterClient create()
Constructs an instance of SecurityCenterClient with default settings.
Type | Description |
SecurityCenterClient |
Type | Description |
IOException |
create(SecurityCenterSettings settings)
public static final SecurityCenterClient create(SecurityCenterSettings settings)
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.
Name | Description |
settings | SecurityCenterSettings |
Type | Description |
SecurityCenterClient |
Type | Description |
IOException |
create(SecurityCenterStub stub)
public static final SecurityCenterClient create(SecurityCenterStub stub)
Constructs an instance of SecurityCenterClient, using the given stub for making calls. This is for advanced usage - prefer using create(SecurityCenterSettings).
Name | Description |
stub | SecurityCenterStub |
Type | Description |
SecurityCenterClient |
createFinding(CreateFindingRequest request)
public final Finding createFinding(CreateFindingRequest request)
Creates a finding. The corresponding source must exist for finding creation to succeed.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
CreateFindingRequest request =
CreateFindingRequest.newBuilder()
.setParent(SourceName.of("[ORGANIZATION]", "[SOURCE]").toString())
.setFindingId("findingId439150212")
.setFinding(Finding.newBuilder().build())
.build();
Finding response = securityCenterClient.createFinding(request);
}
Name | Description |
request | CreateFindingRequest The request object containing all of the parameters for the API call. |
Type | Description |
Finding |
createFinding(SourceName parent, String findingId, Finding finding)
public final Finding createFinding(SourceName parent, String findingId, Finding finding)
Creates a finding. The corresponding source must exist for finding creation to succeed.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
String findingId = "findingId439150212";
Finding finding = Finding.newBuilder().build();
Finding response = securityCenterClient.createFinding(parent, findingId, finding);
}
Name | Description |
parent | SourceName Required. Resource name of the new finding's parent. Its format should be "organizations/[organization_id]/sources/[source_id]". |
findingId | String Required. Unique identifier provided by the client within the parent scope. It must be alphanumeric and less than or equal to 32 characters and greater than 0 characters in length. |
finding | Finding Required. The Finding being created. The name and security_marks will be ignored as they are both output only fields on this resource. |
Type | Description |
Finding |
createFinding(String parent, String findingId, Finding finding)
public final Finding createFinding(String parent, String findingId, Finding finding)
Creates a finding. The corresponding source must exist for finding creation to succeed.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String parent = SourceName.of("[ORGANIZATION]", "[SOURCE]").toString();
String findingId = "findingId439150212";
Finding finding = Finding.newBuilder().build();
Finding response = securityCenterClient.createFinding(parent, findingId, finding);
}
Name | Description |
parent | String Required. Resource name of the new finding's parent. Its format should be "organizations/[organization_id]/sources/[source_id]". |
findingId | String Required. Unique identifier provided by the client within the parent scope. It must be alphanumeric and less than or equal to 32 characters and greater than 0 characters in length. |
finding | Finding Required. The Finding being created. The name and security_marks will be ignored as they are both output only fields on this resource. |
Type | Description |
Finding |
createFindingCallable()
public final UnaryCallable<CreateFindingRequest,Finding> createFindingCallable()
Creates a finding. The corresponding source must exist for finding creation to succeed.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
CreateFindingRequest request =
CreateFindingRequest.newBuilder()
.setParent(SourceName.of("[ORGANIZATION]", "[SOURCE]").toString())
.setFindingId("findingId439150212")
.setFinding(Finding.newBuilder().build())
.build();
ApiFuture<Finding> future = securityCenterClient.createFindingCallable().futureCall(request);
// Do something.
Finding response = future.get();
}
Type | Description |
UnaryCallable<CreateFindingRequest,Finding> |
createSource(CreateSourceRequest request)
public final Source createSource(CreateSourceRequest request)
Creates a source.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
CreateSourceRequest request =
CreateSourceRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setSource(Source.newBuilder().build())
.build();
Source response = securityCenterClient.createSource(request);
}
Name | Description |
request | CreateSourceRequest The request object containing all of the parameters for the API call. |
Type | Description |
Source |
createSource(OrganizationName parent, Source source)
public final Source createSource(OrganizationName parent, Source source)
Creates a source.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
Source source = Source.newBuilder().build();
Source response = securityCenterClient.createSource(parent, source);
}
Name | Description |
parent | OrganizationName Required. Resource name of the new source's parent. Its format should be "organizations/[organization_id]". |
source | Source Required. The Source being created, only the display_name and description will be used. All other fields will be ignored. |
Type | Description |
Source |
createSource(String parent, Source source)
public final Source createSource(String parent, Source source)
Creates a source.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String parent = OrganizationName.of("[ORGANIZATION]").toString();
Source source = Source.newBuilder().build();
Source response = securityCenterClient.createSource(parent, source);
}
Name | Description |
parent | String Required. Resource name of the new source's parent. Its format should be "organizations/[organization_id]". |
source | Source Required. The Source being created, only the display_name and description will be used. All other fields will be ignored. |
Type | Description |
Source |
createSourceCallable()
public final UnaryCallable<CreateSourceRequest,Source> createSourceCallable()
Creates a source.
Sample code:
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();
}
Type | Description |
UnaryCallable<CreateSourceRequest,Source> |
getIamPolicy(ResourceName resource)
public final Policy getIamPolicy(ResourceName resource)
Gets the access control policy on the specified Source.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ResourceName resource = OrganizationName.of("[ORGANIZATION]");
Policy response = securityCenterClient.getIamPolicy(resource);
}
Name | Description |
resource | com.google.api.resourcenames.ResourceName REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
Type | Description |
com.google.iam.v1.Policy |
getIamPolicy(GetIamPolicyRequest request)
public final Policy getIamPolicy(GetIamPolicyRequest request)
Gets the access control policy on the specified Source.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(OrganizationName.of("[ORGANIZATION]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
Policy response = securityCenterClient.getIamPolicy(request);
}
Name | Description |
request | com.google.iam.v1.GetIamPolicyRequest The request object containing all of the parameters for the API call. |
Type | Description |
com.google.iam.v1.Policy |
getIamPolicy(String resource)
public final Policy getIamPolicy(String resource)
Gets the access control policy on the specified Source.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String resource = OrganizationName.of("[ORGANIZATION]").toString();
Policy response = securityCenterClient.getIamPolicy(resource);
}
Name | Description |
resource | String REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
Type | Description |
com.google.iam.v1.Policy |
getIamPolicyCallable()
public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()
Gets the access control policy on the specified Source.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(OrganizationName.of("[ORGANIZATION]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
ApiFuture<Policy> future = securityCenterClient.getIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
Type | Description |
UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> |
getOperationsClient()
public final OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
Type | Description |
OperationsClient |
getOrganizationSettings(GetOrganizationSettingsRequest request)
public final OrganizationSettings getOrganizationSettings(GetOrganizationSettingsRequest request)
Gets the settings for an organization.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GetOrganizationSettingsRequest request =
GetOrganizationSettingsRequest.newBuilder()
.setName(OrganizationSettingsName.of("[ORGANIZATION]").toString())
.build();
OrganizationSettings response = securityCenterClient.getOrganizationSettings(request);
}
Name | Description |
request | GetOrganizationSettingsRequest The request object containing all of the parameters for the API call. |
Type | Description |
OrganizationSettings |
getOrganizationSettings(OrganizationSettingsName name)
public final OrganizationSettings getOrganizationSettings(OrganizationSettingsName name)
Gets the settings for an organization.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationSettingsName name = OrganizationSettingsName.of("[ORGANIZATION]");
OrganizationSettings response = securityCenterClient.getOrganizationSettings(name);
}
Name | Description |
name | OrganizationSettingsName Required. Name of the organization to get organization settings for. Its format is "organizations/[organization_id]/organizationSettings". |
Type | Description |
OrganizationSettings |
getOrganizationSettings(String name)
public final OrganizationSettings getOrganizationSettings(String name)
Gets the settings for an organization.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String name = OrganizationSettingsName.of("[ORGANIZATION]").toString();
OrganizationSettings response = securityCenterClient.getOrganizationSettings(name);
}
Name | Description |
name | String Required. Name of the organization to get organization settings for. Its format is "organizations/[organization_id]/organizationSettings". |
Type | Description |
OrganizationSettings |
getOrganizationSettingsCallable()
public final UnaryCallable<GetOrganizationSettingsRequest,OrganizationSettings> getOrganizationSettingsCallable()
Gets the settings for an organization.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GetOrganizationSettingsRequest request =
GetOrganizationSettingsRequest.newBuilder()
.setName(OrganizationSettingsName.of("[ORGANIZATION]").toString())
.build();
ApiFuture
Type | Description |
UnaryCallable<GetOrganizationSettingsRequest,OrganizationSettings> |
getSettings()
public final SecurityCenterSettings getSettings()
Type | Description |
SecurityCenterSettings |
getSource(GetSourceRequest request)
public final Source getSource(GetSourceRequest request)
Gets a source.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GetSourceRequest request =
GetSourceRequest.newBuilder()
.setName(SourceName.of("[ORGANIZATION]", "[SOURCE]").toString())
.build();
Source response = securityCenterClient.getSource(request);
}
Name | Description |
request | GetSourceRequest The request object containing all of the parameters for the API call. |
Type | Description |
Source |
getSource(SourceName name)
public final Source getSource(SourceName name)
Gets a source.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
SourceName name = SourceName.of("[ORGANIZATION]", "[SOURCE]");
Source response = securityCenterClient.getSource(name);
}
Name | Description |
name | SourceName Required. Relative resource name of the source. Its format is "organizations/[organization_id]/source/[source_id]". |
Type | Description |
Source |
getSource(String name)
public final Source getSource(String name)
Gets a source.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String name = SourceName.of("[ORGANIZATION]", "[SOURCE]").toString();
Source response = securityCenterClient.getSource(name);
}
Name | Description |
name | String Required. Relative resource name of the source. Its format is "organizations/[organization_id]/source/[source_id]". |
Type | Description |
Source |
getSourceCallable()
public final UnaryCallable<GetSourceRequest,Source> getSourceCallable()
Gets a source.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GetSourceRequest request =
GetSourceRequest.newBuilder()
.setName(SourceName.of("[ORGANIZATION]", "[SOURCE]").toString())
.build();
ApiFuture<Source> future = securityCenterClient.getSourceCallable().futureCall(request);
// Do something.
Source response = future.get();
}
Type | Description |
UnaryCallable<GetSourceRequest,Source> |
getStub()
public SecurityCenterStub getStub()
Type | Description |
SecurityCenterStub |
groupAssets(GroupAssetsRequest request)
public final SecurityCenterClient.GroupAssetsPagedResponse groupAssets(GroupAssetsRequest request)
Filters an organization's assets and groups them by their specified properties.
Sample code:
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);
}
}
Name | Description |
request | GroupAssetsRequest The request object containing all of the parameters for the API call. |
Type | Description |
SecurityCenterClient.GroupAssetsPagedResponse |
groupAssetsCallable()
public final UnaryCallable<GroupAssetsRequest,GroupAssetsResponse> groupAssetsCallable()
Filters an organization's assets and groups them by their specified properties.
Sample code:
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.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<GroupAssetsRequest,GroupAssetsResponse> |
groupAssetsPagedCallable()
public final UnaryCallable<GroupAssetsRequest,SecurityCenterClient.GroupAssetsPagedResponse> groupAssetsPagedCallable()
Filters an organization's assets and groups them by their specified properties.
Sample code:
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
Type | Description |
UnaryCallable<GroupAssetsRequest,GroupAssetsPagedResponse> |
groupFindings(GroupFindingsRequest request)
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:
/v1beta1/organizations/{organization_id}/sources/-/findings
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GroupFindingsRequest request =
GroupFindingsRequest.newBuilder()
.setParent(SourceName.of("[ORGANIZATION]", "[SOURCE]").toString())
.setFilter("filter-1274492040")
.setGroupBy("groupBy293428022")
.setReadTime(Timestamp.newBuilder().build())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
for (GroupResult element : securityCenterClient.groupFindings(request).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
request | GroupFindingsRequest The request object containing all of the parameters for the API call. |
Type | Description |
SecurityCenterClient.GroupFindingsPagedResponse |
groupFindings(SourceName parent, String groupBy)
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:
/v1beta1/organizations/{organization_id}/sources/-/findings
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
String groupBy = "groupBy293428022";
for (GroupResult element : securityCenterClient.groupFindings(parent, groupBy).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | SourceName Required. Name of the source to groupBy. Its format is
"organizations/[organization_id]/sources/[source_id]". To groupBy across all sources
provide a source_id of |
groupBy | String Required. Expression that defines what assets fields to use for grouping
(including The following fields are supported:
|
Type | Description |
SecurityCenterClient.GroupFindingsPagedResponse |
groupFindings(String parent, String groupBy)
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:
/v1beta1/organizations/{organization_id}/sources/-/findings
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String parent = SourceName.of("[ORGANIZATION]", "[SOURCE]").toString();
String groupBy = "groupBy293428022";
for (GroupResult element : securityCenterClient.groupFindings(parent, groupBy).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | String Required. Name of the source to groupBy. Its format is
"organizations/[organization_id]/sources/[source_id]". To groupBy across all sources
provide a source_id of |
groupBy | String Required. Expression that defines what assets fields to use for grouping
(including The following fields are supported:
|
Type | Description |
SecurityCenterClient.GroupFindingsPagedResponse |
groupFindingsCallable()
public final UnaryCallable<GroupFindingsRequest,GroupFindingsResponse> 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:
/v1beta1/organizations/{organization_id}/sources/-/findings
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GroupFindingsRequest request =
GroupFindingsRequest.newBuilder()
.setParent(SourceName.of("[ORGANIZATION]", "[SOURCE]").toString())
.setFilter("filter-1274492040")
.setGroupBy("groupBy293428022")
.setReadTime(Timestamp.newBuilder().build())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
while (true) {
GroupFindingsResponse response = securityCenterClient.groupFindingsCallable().call(request);
for (GroupResult element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<GroupFindingsRequest,GroupFindingsResponse> |
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:
/v1beta1/organizations/{organization_id}/sources/-/findings
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
GroupFindingsRequest request =
GroupFindingsRequest.newBuilder()
.setParent(SourceName.of("[ORGANIZATION]", "[SOURCE]").toString())
.setFilter("filter-1274492040")
.setGroupBy("groupBy293428022")
.setReadTime(Timestamp.newBuilder().build())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture
Type | Description |
UnaryCallable<GroupFindingsRequest,GroupFindingsPagedResponse> |
isShutdown()
public boolean isShutdown()
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Type | Description |
boolean |
listAssets(ListAssetsRequest request)
public final SecurityCenterClient.ListAssetsPagedResponse listAssets(ListAssetsRequest request)
Lists an organization's assets.
Sample code:
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);
}
}
Name | Description |
request | ListAssetsRequest The request object containing all of the parameters for the API call. |
Type | Description |
SecurityCenterClient.ListAssetsPagedResponse |
listAssetsCallable()
public final UnaryCallable<ListAssetsRequest,ListAssetsResponse> listAssetsCallable()
Lists an organization's assets.
Sample code:
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.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListAssetsRequest,ListAssetsResponse> |
listAssetsPagedCallable()
public final UnaryCallable<ListAssetsRequest,SecurityCenterClient.ListAssetsPagedResponse> listAssetsPagedCallable()
Lists an organization's assets.
Sample code:
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
Type | Description |
UnaryCallable<ListAssetsRequest,ListAssetsPagedResponse> |
listFindings(ListFindingsRequest request)
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:
/v1beta1/organizations/{organization_id}/sources/-/findings
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ListFindingsRequest request =
ListFindingsRequest.newBuilder()
.setParent(SourceName.of("[ORGANIZATION]", "[SOURCE]").toString())
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setReadTime(Timestamp.newBuilder().build())
.setFieldMask(FieldMask.newBuilder().build())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
for (Finding element : securityCenterClient.listFindings(request).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
request | ListFindingsRequest The request object containing all of the parameters for the API call. |
Type | Description |
SecurityCenterClient.ListFindingsPagedResponse |
listFindingsCallable()
public final UnaryCallable<ListFindingsRequest,ListFindingsResponse> listFindingsCallable()
Lists an organization or source's findings.
To list across all sources provide a -
as the source id. Example:
/v1beta1/organizations/{organization_id}/sources/-/findings
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ListFindingsRequest request =
ListFindingsRequest.newBuilder()
.setParent(SourceName.of("[ORGANIZATION]", "[SOURCE]").toString())
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setReadTime(Timestamp.newBuilder().build())
.setFieldMask(FieldMask.newBuilder().build())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
while (true) {
ListFindingsResponse response = securityCenterClient.listFindingsCallable().call(request);
for (Finding element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListFindingsRequest,ListFindingsResponse> |
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:
/v1beta1/organizations/{organization_id}/sources/-/findings
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ListFindingsRequest request =
ListFindingsRequest.newBuilder()
.setParent(SourceName.of("[ORGANIZATION]", "[SOURCE]").toString())
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setReadTime(Timestamp.newBuilder().build())
.setFieldMask(FieldMask.newBuilder().build())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture<Finding> future =
securityCenterClient.listFindingsPagedCallable().futureCall(request);
// Do something.
for (Finding element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Type | Description |
UnaryCallable<ListFindingsRequest,ListFindingsPagedResponse> |
listSources(ListSourcesRequest request)
public final SecurityCenterClient.ListSourcesPagedResponse listSources(ListSourcesRequest request)
Lists all sources belonging to an organization.
Sample code:
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);
}
}
Name | Description |
request | ListSourcesRequest The request object containing all of the parameters for the API call. |
Type | Description |
SecurityCenterClient.ListSourcesPagedResponse |
listSources(OrganizationName parent)
public final SecurityCenterClient.ListSourcesPagedResponse listSources(OrganizationName parent)
Lists all sources belonging to an organization.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
for (Source element : securityCenterClient.listSources(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | OrganizationName Required. Resource name of the parent of sources to list. Its format should be "organizations/[organization_id]". |
Type | Description |
SecurityCenterClient.ListSourcesPagedResponse |
listSources(String parent)
public final SecurityCenterClient.ListSourcesPagedResponse listSources(String parent)
Lists all sources belonging to an organization.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String parent = OrganizationName.of("[ORGANIZATION]").toString();
for (Source element : securityCenterClient.listSources(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | String Required. Resource name of the parent of sources to list. Its format should be "organizations/[organization_id]". |
Type | Description |
SecurityCenterClient.ListSourcesPagedResponse |
listSourcesCallable()
public final UnaryCallable<ListSourcesRequest,ListSourcesResponse> listSourcesCallable()
Lists all sources belonging to an organization.
Sample code:
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.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListSourcesRequest,ListSourcesResponse> |
listSourcesPagedCallable()
public final UnaryCallable<ListSourcesRequest,SecurityCenterClient.ListSourcesPagedResponse> listSourcesPagedCallable()
Lists all sources belonging to an organization.
Sample code:
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);
}
}
Type | Description |
UnaryCallable<ListSourcesRequest,ListSourcesPagedResponse> |
runAssetDiscoveryAsync(OrganizationName parent)
public final OperationFuture<Empty,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:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
securityCenterClient.runAssetDiscoveryAsync(parent).get();
}
Name | Description |
parent | OrganizationName Required. Name of the organization to run asset discovery for. Its format is "organizations/[organization_id]". |
Type | Description |
OperationFuture<Empty,Empty> |
runAssetDiscoveryAsync(RunAssetDiscoveryRequest request)
public final OperationFuture<Empty,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:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
RunAssetDiscoveryRequest request =
RunAssetDiscoveryRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.build();
securityCenterClient.runAssetDiscoveryAsync(request).get();
}
Name | Description |
request | RunAssetDiscoveryRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Empty,Empty> |
runAssetDiscoveryAsync(String parent)
public final OperationFuture<Empty,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:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String parent = OrganizationName.of("[ORGANIZATION]").toString();
securityCenterClient.runAssetDiscoveryAsync(parent).get();
}
Name | Description |
parent | String Required. Name of the organization to run asset discovery for. Its format is "organizations/[organization_id]". |
Type | Description |
OperationFuture<Empty,Empty> |
runAssetDiscoveryCallable()
public final UnaryCallable<RunAssetDiscoveryRequest,Operation> 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:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
RunAssetDiscoveryRequest request =
RunAssetDiscoveryRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.build();
ApiFuture<Operation> future =
securityCenterClient.runAssetDiscoveryCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
UnaryCallable<RunAssetDiscoveryRequest,Operation> |
runAssetDiscoveryOperationCallable()
public final OperationCallable<RunAssetDiscoveryRequest,Empty,Empty> runAssetDiscoveryOperationCallable()
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:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
RunAssetDiscoveryRequest request =
RunAssetDiscoveryRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.build();
OperationFuture
Type | Description |
OperationCallable<RunAssetDiscoveryRequest,Empty,Empty> |
setFindingState(FindingName name, Finding.State state, Timestamp startTime)
public final Finding setFindingState(FindingName name, Finding.State state, Timestamp startTime)
Updates the state of a finding.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
FindingName name = FindingName.of("[ORGANIZATION]", "[SOURCE]", "[FINDING]");
Finding.State state = Finding.State.forNumber(0);
Timestamp startTime = Timestamp.newBuilder().build();
Finding response = securityCenterClient.setFindingState(name, state, startTime);
}
Name | Description |
name | FindingName 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 | Finding.State Required. The desired State of the finding. |
startTime | Timestamp Required. The time at which the updated state takes effect. |
Type | Description |
Finding |
setFindingState(SetFindingStateRequest request)
public final Finding setFindingState(SetFindingStateRequest request)
Updates the state of a finding.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
SetFindingStateRequest request =
SetFindingStateRequest.newBuilder()
.setName(FindingName.of("[ORGANIZATION]", "[SOURCE]", "[FINDING]").toString())
.setStartTime(Timestamp.newBuilder().build())
.build();
Finding response = securityCenterClient.setFindingState(request);
}
Name | Description |
request | SetFindingStateRequest The request object containing all of the parameters for the API call. |
Type | Description |
Finding |
setFindingState(String name, Finding.State state, Timestamp startTime)
public final Finding setFindingState(String name, Finding.State state, Timestamp startTime)
Updates the state of a finding.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String name = FindingName.of("[ORGANIZATION]", "[SOURCE]", "[FINDING]").toString();
Finding.State state = Finding.State.forNumber(0);
Timestamp startTime = Timestamp.newBuilder().build();
Finding response = securityCenterClient.setFindingState(name, state, startTime);
}
Name | Description |
name | String 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 | Finding.State Required. The desired State of the finding. |
startTime | Timestamp Required. The time at which the updated state takes effect. |
Type | Description |
Finding |
setFindingStateCallable()
public final UnaryCallable<SetFindingStateRequest,Finding> setFindingStateCallable()
Updates the state of a finding.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
SetFindingStateRequest request =
SetFindingStateRequest.newBuilder()
.setName(FindingName.of("[ORGANIZATION]", "[SOURCE]", "[FINDING]").toString())
.setStartTime(Timestamp.newBuilder().build())
.build();
ApiFuture<Finding> future =
securityCenterClient.setFindingStateCallable().futureCall(request);
// Do something.
Finding response = future.get();
}
Type | Description |
UnaryCallable<SetFindingStateRequest,Finding> |
setIamPolicy(ResourceName resource, Policy policy)
public final Policy setIamPolicy(ResourceName resource, Policy policy)
Sets the access control policy on the specified Source.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ResourceName resource = OrganizationName.of("[ORGANIZATION]");
Policy policy = Policy.newBuilder().build();
Policy response = securityCenterClient.setIamPolicy(resource, policy);
}
Name | Description |
resource | com.google.api.resourcenames.ResourceName REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
policy | com.google.iam.v1.Policy REQUIRED: The complete policy to be applied to the |
Type | Description |
com.google.iam.v1.Policy |
setIamPolicy(SetIamPolicyRequest request)
public final Policy setIamPolicy(SetIamPolicyRequest request)
Sets the access control policy on the specified Source.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(OrganizationName.of("[ORGANIZATION]").toString())
.setPolicy(Policy.newBuilder().build())
.build();
Policy response = securityCenterClient.setIamPolicy(request);
}
Name | Description |
request | com.google.iam.v1.SetIamPolicyRequest The request object containing all of the parameters for the API call. |
Type | Description |
com.google.iam.v1.Policy |
setIamPolicy(String resource, Policy policy)
public final Policy setIamPolicy(String resource, Policy policy)
Sets the access control policy on the specified Source.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String resource = OrganizationName.of("[ORGANIZATION]").toString();
Policy policy = Policy.newBuilder().build();
Policy response = securityCenterClient.setIamPolicy(resource, policy);
}
Name | Description |
resource | String REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
policy | com.google.iam.v1.Policy REQUIRED: The complete policy to be applied to the |
Type | Description |
com.google.iam.v1.Policy |
setIamPolicyCallable()
public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()
Sets the access control policy on the specified Source.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(OrganizationName.of("[ORGANIZATION]").toString())
.setPolicy(Policy.newBuilder().build())
.build();
ApiFuture<Policy> future = securityCenterClient.setIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
Type | Description |
UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()
testIamPermissions(ResourceName resource, List<String> permissions)
public final TestIamPermissionsResponse testIamPermissions(ResourceName resource, List<String> permissions)
Returns the permissions that a caller has on the specified source.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
ResourceName resource = OrganizationName.of("[ORGANIZATION]");
List<String> permissions = new ArrayList<>();
TestIamPermissionsResponse response =
securityCenterClient.testIamPermissions(resource, permissions);
}
Name | Description |
resource | com.google.api.resourcenames.ResourceName REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
permissions | List<String> The set of permissions to check for the |
Type | Description |
com.google.iam.v1.TestIamPermissionsResponse |
testIamPermissions(TestIamPermissionsRequest request)
public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)
Returns the permissions that a caller has on the specified source.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(OrganizationName.of("[ORGANIZATION]").toString())
.addAllPermissions(new ArrayList<String>())
.build();
TestIamPermissionsResponse response = securityCenterClient.testIamPermissions(request);
}
Name | Description |
request | com.google.iam.v1.TestIamPermissionsRequest The request object containing all of the parameters for the API call. |
Type | Description |
com.google.iam.v1.TestIamPermissionsResponse |
testIamPermissions(String resource, List<String> permissions)
public final TestIamPermissionsResponse testIamPermissions(String resource, List<String> permissions)
Returns the permissions that a caller has on the specified source.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
String resource = OrganizationName.of("[ORGANIZATION]").toString();
List<String> permissions = new ArrayList<>();
TestIamPermissionsResponse response =
securityCenterClient.testIamPermissions(resource, permissions);
}
Name | Description |
resource | String REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
permissions | List<String> The set of permissions to check for the |
Type | Description |
com.google.iam.v1.TestIamPermissionsResponse |
testIamPermissionsCallable()
public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()
Returns the permissions that a caller has on the specified source.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(OrganizationName.of("[ORGANIZATION]").toString())
.addAllPermissions(new ArrayList<String>())
.build();
ApiFuture
Type | Description |
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> |
updateFinding(Finding finding)
public final Finding updateFinding(Finding finding)
Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
Finding finding = Finding.newBuilder().build();
Finding response = securityCenterClient.updateFinding(finding);
}
Name | Description |
finding | 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 alphanumeric and less than or equal to 32 characters and greater than 0 characters in length. |
Type | Description |
Finding |
updateFinding(UpdateFindingRequest request)
public final Finding updateFinding(UpdateFindingRequest request)
Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
UpdateFindingRequest request =
UpdateFindingRequest.newBuilder()
.setFinding(Finding.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Finding response = securityCenterClient.updateFinding(request);
}
Name | Description |
request | UpdateFindingRequest The request object containing all of the parameters for the API call. |
Type | Description |
Finding |
updateFindingCallable()
public final UnaryCallable<UpdateFindingRequest,Finding> updateFindingCallable()
Creates or updates a finding. The corresponding source must exist for a finding creation to succeed.
Sample code:
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();
}
Type | Description |
UnaryCallable<UpdateFindingRequest,Finding> |
updateOrganizationSettings(OrganizationSettings organizationSettings)
public final OrganizationSettings updateOrganizationSettings(OrganizationSettings organizationSettings)
Updates an organization's settings.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationSettings organizationSettings = OrganizationSettings.newBuilder().build();
OrganizationSettings response =
securityCenterClient.updateOrganizationSettings(organizationSettings);
}
Name | Description |
organizationSettings | OrganizationSettings Required. The organization settings resource to update. |
Type | Description |
OrganizationSettings |
updateOrganizationSettings(UpdateOrganizationSettingsRequest request)
public final OrganizationSettings updateOrganizationSettings(UpdateOrganizationSettingsRequest request)
Updates an organization's settings.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
UpdateOrganizationSettingsRequest request =
UpdateOrganizationSettingsRequest.newBuilder()
.setOrganizationSettings(OrganizationSettings.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
OrganizationSettings response = securityCenterClient.updateOrganizationSettings(request);
}
Name | Description |
request | UpdateOrganizationSettingsRequest The request object containing all of the parameters for the API call. |
Type | Description |
OrganizationSettings |
updateOrganizationSettingsCallable()
public final UnaryCallable<UpdateOrganizationSettingsRequest,OrganizationSettings> updateOrganizationSettingsCallable()
Updates an organization's settings.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
UpdateOrganizationSettingsRequest request =
UpdateOrganizationSettingsRequest.newBuilder()
.setOrganizationSettings(OrganizationSettings.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture
Type | Description |
UnaryCallable<UpdateOrganizationSettingsRequest,OrganizationSettings> |
updateSecurityMarks(SecurityMarks securityMarks)
public final SecurityMarks updateSecurityMarks(SecurityMarks securityMarks)
Updates security marks.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
SecurityMarks securityMarks = SecurityMarks.newBuilder().build();
SecurityMarks response = securityCenterClient.updateSecurityMarks(securityMarks);
}
Name | Description |
securityMarks | SecurityMarks Required. The security marks resource to update. |
Type | Description |
SecurityMarks |
updateSecurityMarks(UpdateSecurityMarksRequest request)
public final SecurityMarks updateSecurityMarks(UpdateSecurityMarksRequest request)
Updates security marks.
Sample code:
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);
}
Name | Description |
request | UpdateSecurityMarksRequest The request object containing all of the parameters for the API call. |
Type | Description |
SecurityMarks |
updateSecurityMarksCallable()
public final UnaryCallable<UpdateSecurityMarksRequest,SecurityMarks> updateSecurityMarksCallable()
Updates security marks.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
UpdateSecurityMarksRequest request =
UpdateSecurityMarksRequest.newBuilder()
.setSecurityMarks(SecurityMarks.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setStartTime(Timestamp.newBuilder().build())
.build();
ApiFuture
Type | Description |
UnaryCallable<UpdateSecurityMarksRequest,SecurityMarks> |
updateSource(Source source)
public final Source updateSource(Source source)
Updates a source.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
Source source = Source.newBuilder().build();
Source response = securityCenterClient.updateSource(source);
}
Name | Description |
source | Source Required. The source resource to update. |
Type | Description |
Source |
updateSource(UpdateSourceRequest request)
public final Source updateSource(UpdateSourceRequest request)
Updates a source.
Sample code:
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
UpdateSourceRequest request =
UpdateSourceRequest.newBuilder()
.setSource(Source.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Source response = securityCenterClient.updateSource(request);
}
Name | Description |
request | UpdateSourceRequest The request object containing all of the parameters for the API call. |
Type | Description |
Source |
updateSourceCallable()
public final UnaryCallable<UpdateSourceRequest,Source> updateSourceCallable()
Updates a source.
Sample code:
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();
}
Type | Description |
UnaryCallable<UpdateSourceRequest,Source> |