Class MetricsScopesClient
- java.lang.Object
-
- com.google.monitoring.metricsscope.v1.MetricsScopesClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource
,AutoCloseable
@Generated("by gapic-generator-java") public class MetricsScopesClient extends Object implements com.google.api.gax.core.BackgroundResource
Service Description: Manages Cloud Monitoring Metrics Scopes, and the monitoring of Google Cloud projects and AWS accounts.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 (MetricsScopesClient metricsScopesClient = MetricsScopesClient.create()) { MetricsScopeName name = MetricsScopeName.of("[METRICS_SCOPE]"); MetricsScope response = metricsScopesClient.getMetricsScope(name); }
Note: close() needs to be called on the MetricsScopesClient 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 MetricsScopesSettings 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 MetricsScopesSettings metricsScopesSettings = MetricsScopesSettings.newBuilder() .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) .build(); MetricsScopesClient metricsScopesClient = MetricsScopesClient.create(metricsScopesSettings);
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 MetricsScopesSettings metricsScopesSettings = MetricsScopesSettings.newBuilder().setEndpoint(myEndpoint).build(); MetricsScopesClient metricsScopesClient = MetricsScopesClient.create(metricsScopesSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MetricsScopesClient(MetricsScopesSettings settings)
Constructs an instance of MetricsScopesClient, using the given settings.protected
MetricsScopesClient(MetricsScopesStub stub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
awaitTermination(long duration, TimeUnit unit)
void
close()
static MetricsScopesClient
create()
Constructs an instance of MetricsScopesClient with default settings.static MetricsScopesClient
create(MetricsScopesSettings settings)
Constructs an instance of MetricsScopesClient, using the given settings.static MetricsScopesClient
create(MetricsScopesStub stub)
Constructs an instance of MetricsScopesClient, using the given stub for making calls.com.google.api.gax.longrunning.OperationFuture<MonitoredProject,OperationMetadata>
createMonitoredProjectAsync(CreateMonitoredProjectRequest request)
Adds a `MonitoredProject` with the given project ID to the specified `Metrics Scope`.com.google.api.gax.longrunning.OperationFuture<MonitoredProject,OperationMetadata>
createMonitoredProjectAsync(MetricsScopeName parent, MonitoredProject monitoredProject)
Adds a `MonitoredProject` with the given project ID to the specified `Metrics Scope`.com.google.api.gax.longrunning.OperationFuture<MonitoredProject,OperationMetadata>
createMonitoredProjectAsync(String parent, MonitoredProject monitoredProject)
Adds a `MonitoredProject` with the given project ID to the specified `Metrics Scope`.com.google.api.gax.rpc.UnaryCallable<CreateMonitoredProjectRequest,com.google.longrunning.Operation>
createMonitoredProjectCallable()
Adds a `MonitoredProject` with the given project ID to the specified `Metrics Scope`.com.google.api.gax.rpc.OperationCallable<CreateMonitoredProjectRequest,MonitoredProject,OperationMetadata>
createMonitoredProjectOperationCallable()
Adds a `MonitoredProject` with the given project ID to the specified `Metrics Scope`.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteMonitoredProjectAsync(DeleteMonitoredProjectRequest request)
Deletes a `MonitoredProject` from the specified `Metrics Scope`.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteMonitoredProjectAsync(MonitoredProjectName name)
Deletes a `MonitoredProject` from the specified `Metrics Scope`.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteMonitoredProjectAsync(String name)
Deletes a `MonitoredProject` from the specified `Metrics Scope`.com.google.api.gax.rpc.UnaryCallable<DeleteMonitoredProjectRequest,com.google.longrunning.Operation>
deleteMonitoredProjectCallable()
Deletes a `MonitoredProject` from the specified `Metrics Scope`.com.google.api.gax.rpc.OperationCallable<DeleteMonitoredProjectRequest,com.google.protobuf.Empty,OperationMetadata>
deleteMonitoredProjectOperationCallable()
Deletes a `MonitoredProject` from the specified `Metrics Scope`.MetricsScope
getMetricsScope(GetMetricsScopeRequest request)
Returns a specific `Metrics Scope`.MetricsScope
getMetricsScope(MetricsScopeName name)
Returns a specific `Metrics Scope`.MetricsScope
getMetricsScope(String name)
Returns a specific `Metrics Scope`.com.google.api.gax.rpc.UnaryCallable<GetMetricsScopeRequest,MetricsScope>
getMetricsScopeCallable()
Returns a specific `Metrics Scope`.com.google.longrunning.OperationsClient
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.MetricsScopesSettings
getSettings()
MetricsScopesStub
getStub()
boolean
isShutdown()
boolean
isTerminated()
ListMetricsScopesByMonitoredProjectResponse
listMetricsScopesByMonitoredProject(ListMetricsScopesByMonitoredProjectRequest request)
Returns a list of every `Metrics Scope` that a specific `MonitoredProject` has been added to.com.google.api.gax.rpc.UnaryCallable<ListMetricsScopesByMonitoredProjectRequest,ListMetricsScopesByMonitoredProjectResponse>
listMetricsScopesByMonitoredProjectCallable()
Returns a list of every `Metrics Scope` that a specific `MonitoredProject` has been added to.void
shutdown()
void
shutdownNow()
-
-
-
Constructor Detail
-
MetricsScopesClient
protected MetricsScopesClient(MetricsScopesSettings settings) throws IOException
Constructs an instance of MetricsScopesClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
MetricsScopesClient
protected MetricsScopesClient(MetricsScopesStub stub)
-
-
Method Detail
-
create
public static final MetricsScopesClient create() throws IOException
Constructs an instance of MetricsScopesClient with default settings.- Throws:
IOException
-
create
public static final MetricsScopesClient create(MetricsScopesSettings settings) throws IOException
Constructs an instance of MetricsScopesClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
public static final MetricsScopesClient create(MetricsScopesStub stub)
Constructs an instance of MetricsScopesClient, using the given stub for making calls. This is for advanced usage - prefer using create(MetricsScopesSettings).
-
getSettings
public final MetricsScopesSettings getSettings()
-
getStub
public MetricsScopesStub getStub()
-
getOperationsClient
public final com.google.longrunning.OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
-
getMetricsScope
public final MetricsScope getMetricsScope(MetricsScopeName name)
Returns a specific `Metrics 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 (MetricsScopesClient metricsScopesClient = MetricsScopesClient.create()) { MetricsScopeName name = MetricsScopeName.of("[METRICS_SCOPE]"); MetricsScope response = metricsScopesClient.getMetricsScope(name); }
- Parameters:
name
- Required. The resource name of the `Metrics Scope`. Example: `locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getMetricsScope
public final MetricsScope getMetricsScope(String name)
Returns a specific `Metrics 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 (MetricsScopesClient metricsScopesClient = MetricsScopesClient.create()) { String name = MetricsScopeName.of("[METRICS_SCOPE]").toString(); MetricsScope response = metricsScopesClient.getMetricsScope(name); }
- Parameters:
name
- Required. The resource name of the `Metrics Scope`. Example: `locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getMetricsScope
public final MetricsScope getMetricsScope(GetMetricsScopeRequest request)
Returns a specific `Metrics 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 (MetricsScopesClient metricsScopesClient = MetricsScopesClient.create()) { GetMetricsScopeRequest request = GetMetricsScopeRequest.newBuilder() .setName(MetricsScopeName.of("[METRICS_SCOPE]").toString()) .build(); MetricsScope response = metricsScopesClient.getMetricsScope(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getMetricsScopeCallable
public final com.google.api.gax.rpc.UnaryCallable<GetMetricsScopeRequest,MetricsScope> getMetricsScopeCallable()
Returns a specific `Metrics 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 (MetricsScopesClient metricsScopesClient = MetricsScopesClient.create()) { GetMetricsScopeRequest request = GetMetricsScopeRequest.newBuilder() .setName(MetricsScopeName.of("[METRICS_SCOPE]").toString()) .build(); ApiFuture<MetricsScope> future = metricsScopesClient.getMetricsScopeCallable().futureCall(request); // Do something. MetricsScope response = future.get(); }
-
listMetricsScopesByMonitoredProject
public final ListMetricsScopesByMonitoredProjectResponse listMetricsScopesByMonitoredProject(ListMetricsScopesByMonitoredProjectRequest request)
Returns a list of every `Metrics Scope` that a specific `MonitoredProject` has been added to. The metrics scope representing the specified monitored project will always be the first entry in the response.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 (MetricsScopesClient metricsScopesClient = MetricsScopesClient.create()) { ListMetricsScopesByMonitoredProjectRequest request = ListMetricsScopesByMonitoredProjectRequest.newBuilder() .setMonitoredResourceContainer("monitoredResourceContainer884669850") .build(); ListMetricsScopesByMonitoredProjectResponse response = metricsScopesClient.listMetricsScopesByMonitoredProject(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listMetricsScopesByMonitoredProjectCallable
public final com.google.api.gax.rpc.UnaryCallable<ListMetricsScopesByMonitoredProjectRequest,ListMetricsScopesByMonitoredProjectResponse> listMetricsScopesByMonitoredProjectCallable()
Returns a list of every `Metrics Scope` that a specific `MonitoredProject` has been added to. The metrics scope representing the specified monitored project will always be the first entry in the response.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 (MetricsScopesClient metricsScopesClient = MetricsScopesClient.create()) { ListMetricsScopesByMonitoredProjectRequest request = ListMetricsScopesByMonitoredProjectRequest.newBuilder() .setMonitoredResourceContainer("monitoredResourceContainer884669850") .build(); ApiFuture<ListMetricsScopesByMonitoredProjectResponse> future = metricsScopesClient.listMetricsScopesByMonitoredProjectCallable().futureCall(request); // Do something. ListMetricsScopesByMonitoredProjectResponse response = future.get(); }
-
createMonitoredProjectAsync
public final com.google.api.gax.longrunning.OperationFuture<MonitoredProject,OperationMetadata> createMonitoredProjectAsync(MetricsScopeName parent, MonitoredProject monitoredProject)
Adds a `MonitoredProject` with the given project ID to the specified `Metrics 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 (MetricsScopesClient metricsScopesClient = MetricsScopesClient.create()) { MetricsScopeName parent = MetricsScopeName.of("[METRICS_SCOPE]"); MonitoredProject monitoredProject = MonitoredProject.newBuilder().build(); MonitoredProject response = metricsScopesClient.createMonitoredProjectAsync(parent, monitoredProject).get(); }
- Parameters:
parent
- Required. The resource name of the existing `Metrics Scope` that will monitor this project. Example: `locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}`monitoredProject
- Required. The initial `MonitoredProject` configuration. Specify only the `monitored_project.name` field. All other fields are ignored. The `monitored_project.name` must be in the format: `locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}/projects/{MONITORED_PROJECT_ID_OR_NUMBER}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createMonitoredProjectAsync
public final com.google.api.gax.longrunning.OperationFuture<MonitoredProject,OperationMetadata> createMonitoredProjectAsync(String parent, MonitoredProject monitoredProject)
Adds a `MonitoredProject` with the given project ID to the specified `Metrics 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 (MetricsScopesClient metricsScopesClient = MetricsScopesClient.create()) { String parent = MetricsScopeName.of("[METRICS_SCOPE]").toString(); MonitoredProject monitoredProject = MonitoredProject.newBuilder().build(); MonitoredProject response = metricsScopesClient.createMonitoredProjectAsync(parent, monitoredProject).get(); }
- Parameters:
parent
- Required. The resource name of the existing `Metrics Scope` that will monitor this project. Example: `locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}`monitoredProject
- Required. The initial `MonitoredProject` configuration. Specify only the `monitored_project.name` field. All other fields are ignored. The `monitored_project.name` must be in the format: `locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}/projects/{MONITORED_PROJECT_ID_OR_NUMBER}`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createMonitoredProjectAsync
public final com.google.api.gax.longrunning.OperationFuture<MonitoredProject,OperationMetadata> createMonitoredProjectAsync(CreateMonitoredProjectRequest request)
Adds a `MonitoredProject` with the given project ID to the specified `Metrics 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 (MetricsScopesClient metricsScopesClient = MetricsScopesClient.create()) { CreateMonitoredProjectRequest request = CreateMonitoredProjectRequest.newBuilder() .setParent(MetricsScopeName.of("[METRICS_SCOPE]").toString()) .setMonitoredProject(MonitoredProject.newBuilder().build()) .build(); MonitoredProject response = metricsScopesClient.createMonitoredProjectAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createMonitoredProjectOperationCallable
public final com.google.api.gax.rpc.OperationCallable<CreateMonitoredProjectRequest,MonitoredProject,OperationMetadata> createMonitoredProjectOperationCallable()
Adds a `MonitoredProject` with the given project ID to the specified `Metrics 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 (MetricsScopesClient metricsScopesClient = MetricsScopesClient.create()) { CreateMonitoredProjectRequest request = CreateMonitoredProjectRequest.newBuilder() .setParent(MetricsScopeName.of("[METRICS_SCOPE]").toString()) .setMonitoredProject(MonitoredProject.newBuilder().build()) .build(); OperationFuture<MonitoredProject, OperationMetadata> future = metricsScopesClient.createMonitoredProjectOperationCallable().futureCall(request); // Do something. MonitoredProject response = future.get(); }
-
createMonitoredProjectCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateMonitoredProjectRequest,com.google.longrunning.Operation> createMonitoredProjectCallable()
Adds a `MonitoredProject` with the given project ID to the specified `Metrics 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 (MetricsScopesClient metricsScopesClient = MetricsScopesClient.create()) { CreateMonitoredProjectRequest request = CreateMonitoredProjectRequest.newBuilder() .setParent(MetricsScopeName.of("[METRICS_SCOPE]").toString()) .setMonitoredProject(MonitoredProject.newBuilder().build()) .build(); ApiFuture<Operation> future = metricsScopesClient.createMonitoredProjectCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
deleteMonitoredProjectAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteMonitoredProjectAsync(MonitoredProjectName name)
Deletes a `MonitoredProject` from the specified `Metrics 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 (MetricsScopesClient metricsScopesClient = MetricsScopesClient.create()) { MonitoredProjectName name = MonitoredProjectName.of("[METRICS_SCOPE]", "[PROJECT]"); metricsScopesClient.deleteMonitoredProjectAsync(name).get(); }
- Parameters:
name
- Required. The resource name of the `MonitoredProject`. Example: `locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}/projects/{MONITORED_PROJECT_ID_OR_NUMBER}`Authorization requires the following [Google IAM](https://cloud.google.com/iam) permissions on both the `Metrics Scope` and on the `MonitoredProject`: `monitoring.metricsScopes.link`
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteMonitoredProjectAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteMonitoredProjectAsync(String name)
Deletes a `MonitoredProject` from the specified `Metrics 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 (MetricsScopesClient metricsScopesClient = MetricsScopesClient.create()) { String name = MonitoredProjectName.of("[METRICS_SCOPE]", "[PROJECT]").toString(); metricsScopesClient.deleteMonitoredProjectAsync(name).get(); }
- Parameters:
name
- Required. The resource name of the `MonitoredProject`. Example: `locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}/projects/{MONITORED_PROJECT_ID_OR_NUMBER}`Authorization requires the following [Google IAM](https://cloud.google.com/iam) permissions on both the `Metrics Scope` and on the `MonitoredProject`: `monitoring.metricsScopes.link`
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteMonitoredProjectAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteMonitoredProjectAsync(DeleteMonitoredProjectRequest request)
Deletes a `MonitoredProject` from the specified `Metrics 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 (MetricsScopesClient metricsScopesClient = MetricsScopesClient.create()) { DeleteMonitoredProjectRequest request = DeleteMonitoredProjectRequest.newBuilder() .setName(MonitoredProjectName.of("[METRICS_SCOPE]", "[PROJECT]").toString()) .build(); metricsScopesClient.deleteMonitoredProjectAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteMonitoredProjectOperationCallable
public final com.google.api.gax.rpc.OperationCallable<DeleteMonitoredProjectRequest,com.google.protobuf.Empty,OperationMetadata> deleteMonitoredProjectOperationCallable()
Deletes a `MonitoredProject` from the specified `Metrics 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 (MetricsScopesClient metricsScopesClient = MetricsScopesClient.create()) { DeleteMonitoredProjectRequest request = DeleteMonitoredProjectRequest.newBuilder() .setName(MonitoredProjectName.of("[METRICS_SCOPE]", "[PROJECT]").toString()) .build(); OperationFuture<Empty, OperationMetadata> future = metricsScopesClient.deleteMonitoredProjectOperationCallable().futureCall(request); // Do something. future.get(); }
-
deleteMonitoredProjectCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteMonitoredProjectRequest,com.google.longrunning.Operation> deleteMonitoredProjectCallable()
Deletes a `MonitoredProject` from the specified `Metrics 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 (MetricsScopesClient metricsScopesClient = MetricsScopesClient.create()) { DeleteMonitoredProjectRequest request = DeleteMonitoredProjectRequest.newBuilder() .setName(MonitoredProjectName.of("[METRICS_SCOPE]", "[PROJECT]").toString()) .build(); ApiFuture<Operation> future = metricsScopesClient.deleteMonitoredProjectCallable().futureCall(request); // Do something. future.get(); }
-
close
public final void close()
- Specified by:
close
in interfaceAutoCloseable
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfacecom.google.api.gax.core.BackgroundResource
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNow
in interfacecom.google.api.gax.core.BackgroundResource
-
awaitTermination
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
- Specified by:
awaitTermination
in interfacecom.google.api.gax.core.BackgroundResource
- Throws:
InterruptedException
-
-