| GitHub Repository | Product Reference |
Service Description: Service describing handlers for resources
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
FrameworkComplianceReportName name =
FrameworkComplianceReportName.ofOrganizationLocationFrameworkComplianceReportName(
"[ORGANIZATION]", "[LOCATION]", "[FRAMEWORK_COMPLIANCE_REPORT]");
FrameworkComplianceReport response = monitoringClient.fetchFrameworkComplianceReport(name);
}
Note: close() needs to be called on the MonitoringClient 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 |
|---|---|---|
ListFrameworkComplianceSummaries |
Lists the framework compliance summary for a given scope. |
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.
|
ListFindingSummaries |
Lists the finding summary by category for a given scope. |
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.
|
FetchFrameworkComplianceReport |
Fetches the framework compliance report for a given scope. |
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.
|
ListControlComplianceSummaries |
Lists the control compliance summary for a given scope. |
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.
|
AggregateFrameworkComplianceReport |
Gets the aggregated compliance report over time for a given scope. |
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.
|
ListLocations |
Lists information about the supported locations for this service. |
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.
|
GetLocation |
Gets information about a location. |
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.
|
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 MonitoringSettings 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
MonitoringSettings monitoringSettings =
MonitoringSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
MonitoringClient monitoringClient = MonitoringClient.create(monitoringSettings);
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
MonitoringSettings monitoringSettings =
MonitoringSettings.newBuilder().setEndpoint(myEndpoint).build();
MonitoringClient monitoringClient = MonitoringClient.create(monitoringSettings);
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
MonitoringSettings monitoringSettings = MonitoringSettings.newHttpJsonBuilder().build();
MonitoringClient monitoringClient = MonitoringClient.create(monitoringSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final MonitoringClient create()Constructs an instance of MonitoringClient with default settings.
| Returns | |
|---|---|
| Type | Description |
MonitoringClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(MonitoringSettings settings)
public static final MonitoringClient create(MonitoringSettings settings)Constructs an instance of MonitoringClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
| Parameter | |
|---|---|
| Name | Description |
settings |
MonitoringSettings |
| Returns | |
|---|---|
| Type | Description |
MonitoringClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(MonitoringStub stub)
public static final MonitoringClient create(MonitoringStub stub)Constructs an instance of MonitoringClient, using the given stub for making calls. This is for advanced usage - prefer using create(MonitoringSettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
MonitoringStub |
| Returns | |
|---|---|
| Type | Description |
MonitoringClient |
|
Constructors
MonitoringClient(MonitoringSettings settings)
protected MonitoringClient(MonitoringSettings settings)Constructs an instance of MonitoringClient, 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.
| Parameter | |
|---|---|
| Name | Description |
settings |
MonitoringSettings |
MonitoringClient(MonitoringStub stub)
protected MonitoringClient(MonitoringStub stub)| Parameter | |
|---|---|
| Name | Description |
stub |
MonitoringStub |
Methods
aggregateFrameworkComplianceReport(AggregateFrameworkComplianceReportRequest request)
public final AggregateFrameworkComplianceReportResponse aggregateFrameworkComplianceReport(AggregateFrameworkComplianceReportRequest request)Gets the aggregated compliance report over time for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
AggregateFrameworkComplianceReportRequest request =
AggregateFrameworkComplianceReportRequest.newBuilder()
.setName(
FrameworkComplianceReportName.ofOrganizationLocationFrameworkComplianceReportName(
"[ORGANIZATION]", "[LOCATION]", "[FRAMEWORK_COMPLIANCE_REPORT]")
.toString())
.setInterval(Interval.newBuilder().build())
.setFilter("filter-1274492040")
.build();
AggregateFrameworkComplianceReportResponse response =
monitoringClient.aggregateFrameworkComplianceReport(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
AggregateFrameworkComplianceReportRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
AggregateFrameworkComplianceReportResponse |
|
aggregateFrameworkComplianceReport(FrameworkComplianceReportName name)
public final AggregateFrameworkComplianceReportResponse aggregateFrameworkComplianceReport(FrameworkComplianceReportName name)Gets the aggregated compliance report over time for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
FrameworkComplianceReportName name =
FrameworkComplianceReportName.ofOrganizationLocationFrameworkComplianceReportName(
"[ORGANIZATION]", "[LOCATION]", "[FRAMEWORK_COMPLIANCE_REPORT]");
AggregateFrameworkComplianceReportResponse response =
monitoringClient.aggregateFrameworkComplianceReport(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
FrameworkComplianceReportNameRequired. The name of the aggregated compliance report over time to retrieve. The supported format is:
|
| Returns | |
|---|---|
| Type | Description |
AggregateFrameworkComplianceReportResponse |
|
aggregateFrameworkComplianceReport(String name)
public final AggregateFrameworkComplianceReportResponse aggregateFrameworkComplianceReport(String name)Gets the aggregated compliance report over time for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
String name =
FrameworkComplianceReportName.ofProjectLocationFrameworkComplianceReportName(
"[PROJECT]", "[LOCATION]", "[FRAMEWORK_COMPLIANCE_REPORT]")
.toString();
AggregateFrameworkComplianceReportResponse response =
monitoringClient.aggregateFrameworkComplianceReport(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the aggregated compliance report over time to retrieve. The supported format is:
|
| Returns | |
|---|---|
| Type | Description |
AggregateFrameworkComplianceReportResponse |
|
aggregateFrameworkComplianceReportCallable()
public final UnaryCallable<AggregateFrameworkComplianceReportRequest,AggregateFrameworkComplianceReportResponse> aggregateFrameworkComplianceReportCallable()Gets the aggregated compliance report over time for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
AggregateFrameworkComplianceReportRequest request =
AggregateFrameworkComplianceReportRequest.newBuilder()
.setName(
FrameworkComplianceReportName.ofOrganizationLocationFrameworkComplianceReportName(
"[ORGANIZATION]", "[LOCATION]", "[FRAMEWORK_COMPLIANCE_REPORT]")
.toString())
.setInterval(Interval.newBuilder().build())
.setFilter("filter-1274492040")
.build();
ApiFuture<AggregateFrameworkComplianceReportResponse> future =
monitoringClient.aggregateFrameworkComplianceReportCallable().futureCall(request);
// Do something.
AggregateFrameworkComplianceReportResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<AggregateFrameworkComplianceReportRequest,AggregateFrameworkComplianceReportResponse> |
|
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)| Parameters | |
|---|---|
| Name | Description |
duration |
long |
unit |
TimeUnit |
| Returns | |
|---|---|
| Type | Description |
boolean |
|
| Exceptions | |
|---|---|
| Type | Description |
InterruptedException |
|
close()
public final void close()fetchFrameworkComplianceReport(FetchFrameworkComplianceReportRequest request)
public final FrameworkComplianceReport fetchFrameworkComplianceReport(FetchFrameworkComplianceReportRequest request)Fetches the framework compliance report for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
FetchFrameworkComplianceReportRequest request =
FetchFrameworkComplianceReportRequest.newBuilder()
.setName(
FrameworkComplianceReportName.ofOrganizationLocationFrameworkComplianceReportName(
"[ORGANIZATION]", "[LOCATION]", "[FRAMEWORK_COMPLIANCE_REPORT]")
.toString())
.setEndTime(Timestamp.newBuilder().build())
.build();
FrameworkComplianceReport response = monitoringClient.fetchFrameworkComplianceReport(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
FetchFrameworkComplianceReportRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
FrameworkComplianceReport |
|
fetchFrameworkComplianceReport(FrameworkComplianceReportName name)
public final FrameworkComplianceReport fetchFrameworkComplianceReport(FrameworkComplianceReportName name)Fetches the framework compliance report for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
FrameworkComplianceReportName name =
FrameworkComplianceReportName.ofOrganizationLocationFrameworkComplianceReportName(
"[ORGANIZATION]", "[LOCATION]", "[FRAMEWORK_COMPLIANCE_REPORT]");
FrameworkComplianceReport response = monitoringClient.fetchFrameworkComplianceReport(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
FrameworkComplianceReportNameRequired. The name of the framework compliance report to retrieve. |
| Returns | |
|---|---|
| Type | Description |
FrameworkComplianceReport |
|
fetchFrameworkComplianceReport(String name)
public final FrameworkComplianceReport fetchFrameworkComplianceReport(String name)Fetches the framework compliance report for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
String name =
FrameworkComplianceReportName.ofProjectLocationFrameworkComplianceReportName(
"[PROJECT]", "[LOCATION]", "[FRAMEWORK_COMPLIANCE_REPORT]")
.toString();
FrameworkComplianceReport response = monitoringClient.fetchFrameworkComplianceReport(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the framework compliance report to retrieve. |
| Returns | |
|---|---|
| Type | Description |
FrameworkComplianceReport |
|
fetchFrameworkComplianceReportCallable()
public final UnaryCallable<FetchFrameworkComplianceReportRequest,FrameworkComplianceReport> fetchFrameworkComplianceReportCallable()Fetches the framework compliance report for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
FetchFrameworkComplianceReportRequest request =
FetchFrameworkComplianceReportRequest.newBuilder()
.setName(
FrameworkComplianceReportName.ofOrganizationLocationFrameworkComplianceReportName(
"[ORGANIZATION]", "[LOCATION]", "[FRAMEWORK_COMPLIANCE_REPORT]")
.toString())
.setEndTime(Timestamp.newBuilder().build())
.build();
ApiFuture<FrameworkComplianceReport> future =
monitoringClient.fetchFrameworkComplianceReportCallable().futureCall(request);
// Do something.
FrameworkComplianceReport response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<FetchFrameworkComplianceReportRequest,FrameworkComplianceReport> |
|
getLocation(GetLocationRequest request)
public final Location getLocation(GetLocationRequest request)Gets information about a location.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = monitoringClient.getLocation(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.cloud.location.GetLocationRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
com.google.cloud.location.Location |
|
getLocationCallable()
public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()Gets information about a location.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future = monitoringClient.getLocationCallable().futureCall(request);
// Do something.
Location response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
|
getSettings()
public final MonitoringSettings getSettings()| Returns | |
|---|---|
| Type | Description |
MonitoringSettings |
|
getStub()
public MonitoringStub getStub()| Returns | |
|---|---|
| Type | Description |
MonitoringStub |
|
isShutdown()
public boolean isShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
public boolean isTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
listControlComplianceSummaries(FrameworkComplianceReportName parent)
public final MonitoringClient.ListControlComplianceSummariesPagedResponse listControlComplianceSummaries(FrameworkComplianceReportName parent)Lists the control compliance summary for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
FrameworkComplianceReportName parent =
FrameworkComplianceReportName.ofOrganizationLocationFrameworkComplianceReportName(
"[ORGANIZATION]", "[LOCATION]", "[FRAMEWORK_COMPLIANCE_REPORT]");
for (ControlComplianceSummary element :
monitoringClient.listControlComplianceSummaries(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
FrameworkComplianceReportNameRequired. The parent scope for the framework overview page. |
| Returns | |
|---|---|
| Type | Description |
MonitoringClient.ListControlComplianceSummariesPagedResponse |
|
listControlComplianceSummaries(ListControlComplianceSummariesRequest request)
public final MonitoringClient.ListControlComplianceSummariesPagedResponse listControlComplianceSummaries(ListControlComplianceSummariesRequest request)Lists the control compliance summary for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
ListControlComplianceSummariesRequest request =
ListControlComplianceSummariesRequest.newBuilder()
.setParent(
FrameworkComplianceReportName.ofOrganizationLocationFrameworkComplianceReportName(
"[ORGANIZATION]", "[LOCATION]", "[FRAMEWORK_COMPLIANCE_REPORT]")
.toString())
.setEndTime(Timestamp.newBuilder().build())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
for (ControlComplianceSummary element :
monitoringClient.listControlComplianceSummaries(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListControlComplianceSummariesRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
MonitoringClient.ListControlComplianceSummariesPagedResponse |
|
listControlComplianceSummaries(String parent)
public final MonitoringClient.ListControlComplianceSummariesPagedResponse listControlComplianceSummaries(String parent)Lists the control compliance summary for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
String parent =
FrameworkComplianceReportName.ofProjectLocationFrameworkComplianceReportName(
"[PROJECT]", "[LOCATION]", "[FRAMEWORK_COMPLIANCE_REPORT]")
.toString();
for (ControlComplianceSummary element :
monitoringClient.listControlComplianceSummaries(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent scope for the framework overview page. |
| Returns | |
|---|---|
| Type | Description |
MonitoringClient.ListControlComplianceSummariesPagedResponse |
|
listControlComplianceSummariesCallable()
public final UnaryCallable<ListControlComplianceSummariesRequest,ListControlComplianceSummariesResponse> listControlComplianceSummariesCallable()Lists the control compliance summary for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
ListControlComplianceSummariesRequest request =
ListControlComplianceSummariesRequest.newBuilder()
.setParent(
FrameworkComplianceReportName.ofOrganizationLocationFrameworkComplianceReportName(
"[ORGANIZATION]", "[LOCATION]", "[FRAMEWORK_COMPLIANCE_REPORT]")
.toString())
.setEndTime(Timestamp.newBuilder().build())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
while (true) {
ListControlComplianceSummariesResponse response =
monitoringClient.listControlComplianceSummariesCallable().call(request);
for (ControlComplianceSummary element : response.getControlComplianceSummariesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListControlComplianceSummariesRequest,ListControlComplianceSummariesResponse> |
|
listControlComplianceSummariesPagedCallable()
public final UnaryCallable<ListControlComplianceSummariesRequest,MonitoringClient.ListControlComplianceSummariesPagedResponse> listControlComplianceSummariesPagedCallable()Lists the control compliance summary for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
ListControlComplianceSummariesRequest request =
ListControlComplianceSummariesRequest.newBuilder()
.setParent(
FrameworkComplianceReportName.ofOrganizationLocationFrameworkComplianceReportName(
"[ORGANIZATION]", "[LOCATION]", "[FRAMEWORK_COMPLIANCE_REPORT]")
.toString())
.setEndTime(Timestamp.newBuilder().build())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
ApiFuture<ControlComplianceSummary> future =
monitoringClient.listControlComplianceSummariesPagedCallable().futureCall(request);
// Do something.
for (ControlComplianceSummary element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListControlComplianceSummariesRequest,ListControlComplianceSummariesPagedResponse> |
|
listFindingSummaries(FolderLocationName parent)
public final MonitoringClient.ListFindingSummariesPagedResponse listFindingSummaries(FolderLocationName parent)Lists the finding summary by category for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
FolderLocationName parent = FolderLocationName.of("[FOLDER]", "[LOCATION]");
for (FindingSummary element : monitoringClient.listFindingSummaries(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
FolderLocationNameRequired. The parent scope for the framework overview page. |
| Returns | |
|---|---|
| Type | Description |
MonitoringClient.ListFindingSummariesPagedResponse |
|
listFindingSummaries(ListFindingSummariesRequest request)
public final MonitoringClient.ListFindingSummariesPagedResponse listFindingSummaries(ListFindingSummariesRequest request)Lists the finding summary by category for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
ListFindingSummariesRequest request =
ListFindingSummariesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setEndTime(Timestamp.newBuilder().build())
.build();
for (FindingSummary element : monitoringClient.listFindingSummaries(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListFindingSummariesRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
MonitoringClient.ListFindingSummariesPagedResponse |
|
listFindingSummaries(LocationName parent)
public final MonitoringClient.ListFindingSummariesPagedResponse listFindingSummaries(LocationName parent)Lists the finding summary by category for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (FindingSummary element : monitoringClient.listFindingSummaries(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. The parent scope for the framework overview page. |
| Returns | |
|---|---|
| Type | Description |
MonitoringClient.ListFindingSummariesPagedResponse |
|
listFindingSummaries(OrganizationLocationName parent)
public final MonitoringClient.ListFindingSummariesPagedResponse listFindingSummaries(OrganizationLocationName parent)Lists the finding summary by category for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
for (FindingSummary element : monitoringClient.listFindingSummaries(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
OrganizationLocationNameRequired. The parent scope for the framework overview page. |
| Returns | |
|---|---|
| Type | Description |
MonitoringClient.ListFindingSummariesPagedResponse |
|
listFindingSummaries(String parent)
public final MonitoringClient.ListFindingSummariesPagedResponse listFindingSummaries(String parent)Lists the finding summary by category for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (FindingSummary element : monitoringClient.listFindingSummaries(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent scope for the framework overview page. |
| Returns | |
|---|---|
| Type | Description |
MonitoringClient.ListFindingSummariesPagedResponse |
|
listFindingSummariesCallable()
public final UnaryCallable<ListFindingSummariesRequest,ListFindingSummariesResponse> listFindingSummariesCallable()Lists the finding summary by category for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
ListFindingSummariesRequest request =
ListFindingSummariesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setEndTime(Timestamp.newBuilder().build())
.build();
while (true) {
ListFindingSummariesResponse response =
monitoringClient.listFindingSummariesCallable().call(request);
for (FindingSummary element : response.getFindingSummariesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListFindingSummariesRequest,ListFindingSummariesResponse> |
|
listFindingSummariesPagedCallable()
public final UnaryCallable<ListFindingSummariesRequest,MonitoringClient.ListFindingSummariesPagedResponse> listFindingSummariesPagedCallable()Lists the finding summary by category for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
ListFindingSummariesRequest request =
ListFindingSummariesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setEndTime(Timestamp.newBuilder().build())
.build();
ApiFuture<FindingSummary> future =
monitoringClient.listFindingSummariesPagedCallable().futureCall(request);
// Do something.
for (FindingSummary element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListFindingSummariesRequest,ListFindingSummariesPagedResponse> |
|
listFrameworkComplianceSummaries(FolderLocationName parent)
public final MonitoringClient.ListFrameworkComplianceSummariesPagedResponse listFrameworkComplianceSummaries(FolderLocationName parent)Lists the framework compliance summary for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
FolderLocationName parent = FolderLocationName.of("[FOLDER]", "[LOCATION]");
for (FrameworkComplianceSummary element :
monitoringClient.listFrameworkComplianceSummaries(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
FolderLocationNameRequired. The parent scope for the framework compliance summary. |
| Returns | |
|---|---|
| Type | Description |
MonitoringClient.ListFrameworkComplianceSummariesPagedResponse |
|
listFrameworkComplianceSummaries(ListFrameworkComplianceSummariesRequest request)
public final MonitoringClient.ListFrameworkComplianceSummariesPagedResponse listFrameworkComplianceSummaries(ListFrameworkComplianceSummariesRequest request)Lists the framework compliance summary for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
ListFrameworkComplianceSummariesRequest request =
ListFrameworkComplianceSummariesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
for (FrameworkComplianceSummary element :
monitoringClient.listFrameworkComplianceSummaries(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListFrameworkComplianceSummariesRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
MonitoringClient.ListFrameworkComplianceSummariesPagedResponse |
|
listFrameworkComplianceSummaries(LocationName parent)
public final MonitoringClient.ListFrameworkComplianceSummariesPagedResponse listFrameworkComplianceSummaries(LocationName parent)Lists the framework compliance summary for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (FrameworkComplianceSummary element :
monitoringClient.listFrameworkComplianceSummaries(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. The parent scope for the framework compliance summary. |
| Returns | |
|---|---|
| Type | Description |
MonitoringClient.ListFrameworkComplianceSummariesPagedResponse |
|
listFrameworkComplianceSummaries(OrganizationLocationName parent)
public final MonitoringClient.ListFrameworkComplianceSummariesPagedResponse listFrameworkComplianceSummaries(OrganizationLocationName parent)Lists the framework compliance summary for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
for (FrameworkComplianceSummary element :
monitoringClient.listFrameworkComplianceSummaries(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
OrganizationLocationNameRequired. The parent scope for the framework compliance summary. |
| Returns | |
|---|---|
| Type | Description |
MonitoringClient.ListFrameworkComplianceSummariesPagedResponse |
|
listFrameworkComplianceSummaries(String parent)
public final MonitoringClient.ListFrameworkComplianceSummariesPagedResponse listFrameworkComplianceSummaries(String parent)Lists the framework compliance summary for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (FrameworkComplianceSummary element :
monitoringClient.listFrameworkComplianceSummaries(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent scope for the framework compliance summary. |
| Returns | |
|---|---|
| Type | Description |
MonitoringClient.ListFrameworkComplianceSummariesPagedResponse |
|
listFrameworkComplianceSummariesCallable()
public final UnaryCallable<ListFrameworkComplianceSummariesRequest,ListFrameworkComplianceSummariesResponse> listFrameworkComplianceSummariesCallable()Lists the framework compliance summary for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
ListFrameworkComplianceSummariesRequest request =
ListFrameworkComplianceSummariesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
while (true) {
ListFrameworkComplianceSummariesResponse response =
monitoringClient.listFrameworkComplianceSummariesCallable().call(request);
for (FrameworkComplianceSummary element : response.getFrameworkComplianceSummariesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListFrameworkComplianceSummariesRequest,ListFrameworkComplianceSummariesResponse> |
|
listFrameworkComplianceSummariesPagedCallable()
public final UnaryCallable<ListFrameworkComplianceSummariesRequest,MonitoringClient.ListFrameworkComplianceSummariesPagedResponse> listFrameworkComplianceSummariesPagedCallable()Lists the framework compliance summary for a given scope.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
ListFrameworkComplianceSummariesRequest request =
ListFrameworkComplianceSummariesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
ApiFuture<FrameworkComplianceSummary> future =
monitoringClient.listFrameworkComplianceSummariesPagedCallable().futureCall(request);
// Do something.
for (FrameworkComplianceSummary element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListFrameworkComplianceSummariesRequest,ListFrameworkComplianceSummariesPagedResponse> |
|
listLocations(ListLocationsRequest request)
public final MonitoringClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)Lists information about the supported locations for this service.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : monitoringClient.listLocations(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.cloud.location.ListLocationsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
MonitoringClient.ListLocationsPagedResponse |
|
listLocationsCallable()
public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()Lists information about the supported locations for this service.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response = monitoringClient.listLocationsCallable().call(request);
for (Location element : response.getLocationsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
|
listLocationsPagedCallable()
public final UnaryCallable<ListLocationsRequest,MonitoringClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.
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 (MonitoringClient monitoringClient = MonitoringClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future =
monitoringClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for (Location element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse> |
|
shutdown()
public void shutdown()shutdownNow()
public void shutdownNow()