Class ObservabilityClient (0.3.0)

GitHub RepositoryProduct 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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   ScopeName name = ScopeName.of("[PROJECT]", "[LOCATION]", "[SCOPE]");
   Scope response = observabilityClient.getScope(name);
 }
 

Note: close() needs to be called on the ObservabilityClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

Methods
Method Description Method Variants

GetScope

Gets details of a single Scope.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getScope(GetScopeRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getScope(ScopeName name)

  • getScope(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getScopeCallable()

UpdateScope

Updates the parameters of a single Scope.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateScope(UpdateScopeRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateScope(Scope scope, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateScopeCallable()

GetBucket

Get bucket resource.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getBucket(GetBucketRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getBucket(BucketName name)

  • getBucket(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getBucketCallable()

ListBuckets

List buckets of a project in a particular location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listBuckets(ListBucketsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listBuckets(LocationName parent)

  • listBuckets(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listBucketsPagedCallable()

  • listBucketsCallable()

CreateBucket

Create a new bucket.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createBucketAsync(CreateBucketRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createBucketAsync(LocationName parent, Bucket bucket, String bucketId)

  • createBucketAsync(String parent, Bucket bucket, String bucketId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createBucketOperationCallable()

  • createBucketCallable()

UpdateBucket

Update a bucket.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateBucketAsync(UpdateBucketRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • updateBucketAsync(Bucket bucket, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateBucketOperationCallable()

  • updateBucketCallable()

GetDataset

Get a dataset.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getDataset(GetDatasetRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getDataset(DatasetName name)

  • getDataset(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getDatasetCallable()

ListDatasets

List datasets of a bucket.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listDatasets(ListDatasetsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listDatasets(BucketName parent)

  • listDatasets(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listDatasetsPagedCallable()

  • listDatasetsCallable()

GetView

Get a view.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getView(GetViewRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getView(ViewName name)

  • getView(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getViewCallable()

ListViews

List views of a dataset.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listViews(ListViewsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listViews(DatasetName parent)

  • listViews(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listViewsPagedCallable()

  • listViewsCallable()

GetLink

Get a link.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getLink(GetLinkRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getLink(LinkName name)

  • getLink(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getLinkCallable()

ListLinks

List links of a dataset.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listLinks(ListLinksRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listLinks(DatasetName parent)

  • listLinks(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listLinksPagedCallable()

  • listLinksCallable()

CreateLink

Create a new link.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createLinkAsync(CreateLinkRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createLinkAsync(DatasetName parent, Link link, String linkId)

  • createLinkAsync(String parent, Link link, String linkId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createLinkOperationCallable()

  • createLinkCallable()

UpdateLink

Update a link.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateLinkAsync(UpdateLinkRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • updateLinkAsync(Link link, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateLinkOperationCallable()

  • updateLinkCallable()

DeleteLink

Delete a link.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteLinkAsync(DeleteLinkRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteLinkAsync(LinkName name)

  • deleteLinkAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteLinkOperationCallable()

  • deleteLinkCallable()

GetTraceScope

Get TraceScope resource.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getTraceScope(GetTraceScopeRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getTraceScope(TraceScopeName name)

  • getTraceScope(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getTraceScopeCallable()

ListTraceScopes

List TraceScopes of a project in a particular location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listTraceScopes(ListTraceScopesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listTraceScopes(LocationName parent)

  • listTraceScopes(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listTraceScopesPagedCallable()

  • listTraceScopesCallable()

CreateTraceScope

Create a new TraceScope.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createTraceScope(CreateTraceScopeRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createTraceScope(LocationName parent, TraceScope traceScope, String traceScopeId)

  • createTraceScope(String parent, TraceScope traceScope, String traceScopeId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createTraceScopeCallable()

UpdateTraceScope

Update a TraceScope.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateTraceScope(UpdateTraceScopeRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updateTraceScope(TraceScope traceScope, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateTraceScopeCallable()

DeleteTraceScope

Delete a TraceScope.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteTraceScope(DeleteTraceScopeRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deleteTraceScope(TraceScopeName name)

  • deleteTraceScope(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteTraceScopeCallable()

GetSettings

Get Settings

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getSettings(GetSettingsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getSettings(SettingsName name)

  • getSettings(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getSettingsCallable()

UpdateSettings

Update Settings

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateSettingsAsync(UpdateSettingsRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • updateSettingsAsync(Settings settings, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateSettingsOperationCallable()

  • updateSettingsCallable()

ListLocations

Lists information about the supported locations for this service.

This method lists locations based on the resource scope provided inthe ListLocationsRequest.name field: ***Global locations**: If name is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If name follows the formatprojects/{project}, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.

For gRPC and client library implementations, the resource name ispassed as the name field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listLocations(ListLocationsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getLocation(GetLocationRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getLocationCallable()

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 ObservabilitySettings 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
 ObservabilitySettings observabilitySettings =
     ObservabilitySettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 ObservabilityClient observabilityClient = ObservabilityClient.create(observabilitySettings);
 

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
 ObservabilitySettings observabilitySettings =
     ObservabilitySettings.newBuilder().setEndpoint(myEndpoint).build();
 ObservabilityClient observabilityClient = ObservabilityClient.create(observabilitySettings);
 

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
 ObservabilitySettings observabilitySettings =
     ObservabilitySettings.newHttpJsonBuilder().build();
 ObservabilityClient observabilityClient = ObservabilityClient.create(observabilitySettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > ObservabilityClient

Static Methods

create()

public static final ObservabilityClient create()

Constructs an instance of ObservabilityClient with default settings.

Returns
Type Description
ObservabilityClient
Exceptions
Type Description
IOException

create(ObservabilitySettings settings)

public static final ObservabilityClient create(ObservabilitySettings settings)

Constructs an instance of ObservabilityClient, 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 ObservabilitySettings
Returns
Type Description
ObservabilityClient
Exceptions
Type Description
IOException

create(ObservabilityStub stub)

public static final ObservabilityClient create(ObservabilityStub stub)

Constructs an instance of ObservabilityClient, using the given stub for making calls. This is for advanced usage - prefer using create(ObservabilitySettings).

Parameter
Name Description
stub ObservabilityStub
Returns
Type Description
ObservabilityClient

Constructors

ObservabilityClient(ObservabilitySettings settings)

protected ObservabilityClient(ObservabilitySettings settings)

Constructs an instance of ObservabilityClient, 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 ObservabilitySettings

ObservabilityClient(ObservabilityStub stub)

protected ObservabilityClient(ObservabilityStub stub)
Parameter
Name Description
stub ObservabilityStub

Methods

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()

createBucketAsync(@Nullable LocationName parent, Bucket bucket, String bucketId)

public final OperationFuture<Bucket,OperationMetadata> createBucketAsync(@Nullable LocationName parent, Bucket bucket, String bucketId)

Create a new bucket.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   Bucket bucket = Bucket.newBuilder().build();
   String bucketId = "bucketId-1603305307";
   Bucket response = observabilityClient.createBucketAsync(parent, bucket, bucketId).get();
 }
 
Parameters
Name Description
parent @org.jspecify.annotations.Nullable com.google.cloud.observability.v1.LocationName

Required. Name of the project and location for the bucket. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]

bucket Bucket

Required. Bucket to create.

bucketId String

Required. Id of the bucket to create.

Returns
Type Description
OperationFuture<Bucket,OperationMetadata>

createBucketAsync(CreateBucketRequest request)

public final OperationFuture<Bucket,OperationMetadata> createBucketAsync(CreateBucketRequest request)

Create a new bucket.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   CreateBucketRequest request =
       CreateBucketRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setBucketId("bucketId-1603305307")
           .setBucket(Bucket.newBuilder().build())
           .build();
   Bucket response = observabilityClient.createBucketAsync(request).get();
 }
 
Parameter
Name Description
request CreateBucketRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Bucket,OperationMetadata>

createBucketAsync(String parent, Bucket bucket, String bucketId)

public final OperationFuture<Bucket,OperationMetadata> createBucketAsync(String parent, Bucket bucket, String bucketId)

Create a new bucket.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   Bucket bucket = Bucket.newBuilder().build();
   String bucketId = "bucketId-1603305307";
   Bucket response = observabilityClient.createBucketAsync(parent, bucket, bucketId).get();
 }
 
Parameters
Name Description
parent String

Required. Name of the project and location for the bucket. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]

bucket Bucket

Required. Bucket to create.

bucketId String

Required. Id of the bucket to create.

Returns
Type Description
OperationFuture<Bucket,OperationMetadata>

createBucketCallable()

public final UnaryCallable<CreateBucketRequest,Operation> createBucketCallable()

Create a new bucket.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   CreateBucketRequest request =
       CreateBucketRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setBucketId("bucketId-1603305307")
           .setBucket(Bucket.newBuilder().build())
           .build();
   ApiFuture<Operation> future = observabilityClient.createBucketCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateBucketRequest,Operation>

createBucketOperationCallable()

public final OperationCallable<CreateBucketRequest,Bucket,OperationMetadata> createBucketOperationCallable()

Create a new bucket.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   CreateBucketRequest request =
       CreateBucketRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setBucketId("bucketId-1603305307")
           .setBucket(Bucket.newBuilder().build())
           .build();
   OperationFuture<Bucket, OperationMetadata> future =
       observabilityClient.createBucketOperationCallable().futureCall(request);
   // Do something.
   Bucket response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateBucketRequest,Bucket,OperationMetadata>
public final OperationFuture<Link,OperationMetadata> createLinkAsync(@Nullable DatasetName parent, Link link, String linkId)

Create a new link.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]");
   Link link = Link.newBuilder().build();
   String linkId = "linkId-1102667083";
   Link response = observabilityClient.createLinkAsync(parent, link, linkId).get();
 }
 
Parameters
Name Description
parent @org.jspecify.annotations.Nullable com.google.cloud.observability.v1.DatasetName

Required. Name of the containing dataset for this link. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]

link Link

Required. Link to create.

linkId String

Required. Id of the link to create.

Returns
Type Description
OperationFuture<Link,OperationMetadata>

createLinkAsync(CreateLinkRequest request)

public final OperationFuture<Link,OperationMetadata> createLinkAsync(CreateLinkRequest request)

Create a new link.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   CreateLinkRequest request =
       CreateLinkRequest.newBuilder()
           .setParent(
               DatasetName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]").toString())
           .setLinkId("linkId-1102667083")
           .setLink(Link.newBuilder().build())
           .build();
   Link response = observabilityClient.createLinkAsync(request).get();
 }
 
Parameter
Name Description
request CreateLinkRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Link,OperationMetadata>
public final OperationFuture<Link,OperationMetadata> createLinkAsync(String parent, Link link, String linkId)

Create a new link.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   String parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]").toString();
   Link link = Link.newBuilder().build();
   String linkId = "linkId-1102667083";
   Link response = observabilityClient.createLinkAsync(parent, link, linkId).get();
 }
 
Parameters
Name Description
parent String

Required. Name of the containing dataset for this link. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]

link Link

Required. Link to create.

linkId String

Required. Id of the link to create.

Returns
Type Description
OperationFuture<Link,OperationMetadata>

createLinkCallable()

public final UnaryCallable<CreateLinkRequest,Operation> createLinkCallable()

Create a new link.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   CreateLinkRequest request =
       CreateLinkRequest.newBuilder()
           .setParent(
               DatasetName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]").toString())
           .setLinkId("linkId-1102667083")
           .setLink(Link.newBuilder().build())
           .build();
   ApiFuture<Operation> future = observabilityClient.createLinkCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateLinkRequest,Operation>

createLinkOperationCallable()

public final OperationCallable<CreateLinkRequest,Link,OperationMetadata> createLinkOperationCallable()

Create a new link.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   CreateLinkRequest request =
       CreateLinkRequest.newBuilder()
           .setParent(
               DatasetName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]").toString())
           .setLinkId("linkId-1102667083")
           .setLink(Link.newBuilder().build())
           .build();
   OperationFuture<Link, OperationMetadata> future =
       observabilityClient.createLinkOperationCallable().futureCall(request);
   // Do something.
   Link response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateLinkRequest,Link,OperationMetadata>

createTraceScope(@Nullable LocationName parent, TraceScope traceScope, String traceScopeId)

public final TraceScope createTraceScope(@Nullable LocationName parent, TraceScope traceScope, String traceScopeId)

Create a new TraceScope.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   TraceScope traceScope = TraceScope.newBuilder().build();
   String traceScopeId = "traceScopeId-2107793014";
   TraceScope response = observabilityClient.createTraceScope(parent, traceScope, traceScopeId);
 }
 
Parameters
Name Description
parent @org.jspecify.annotations.Nullable com.google.cloud.observability.v1.LocationName

Required. The full resource name of the location where the trace scope should be created

projects/[PROJECT_ID]/locations/[LOCATION_ID]

For example:

projects/my-project/locations/global

traceScope TraceScope

Required. The new trace scope.

traceScopeId String

Required. A client-assigned identifier for the trace scope.

Returns
Type Description
TraceScope

createTraceScope(CreateTraceScopeRequest request)

public final TraceScope createTraceScope(CreateTraceScopeRequest request)

Create a new TraceScope.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   CreateTraceScopeRequest request =
       CreateTraceScopeRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setTraceScopeId("traceScopeId-2107793014")
           .setTraceScope(TraceScope.newBuilder().build())
           .build();
   TraceScope response = observabilityClient.createTraceScope(request);
 }
 
Parameter
Name Description
request CreateTraceScopeRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
TraceScope

createTraceScope(String parent, TraceScope traceScope, String traceScopeId)

public final TraceScope createTraceScope(String parent, TraceScope traceScope, String traceScopeId)

Create a new TraceScope.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   TraceScope traceScope = TraceScope.newBuilder().build();
   String traceScopeId = "traceScopeId-2107793014";
   TraceScope response = observabilityClient.createTraceScope(parent, traceScope, traceScopeId);
 }
 
Parameters
Name Description
parent String

Required. The full resource name of the location where the trace scope should be created

projects/[PROJECT_ID]/locations/[LOCATION_ID]

For example:

projects/my-project/locations/global

traceScope TraceScope

Required. The new trace scope.

traceScopeId String

Required. A client-assigned identifier for the trace scope.

Returns
Type Description
TraceScope

createTraceScopeCallable()

public final UnaryCallable<CreateTraceScopeRequest,TraceScope> createTraceScopeCallable()

Create a new TraceScope.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   CreateTraceScopeRequest request =
       CreateTraceScopeRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setTraceScopeId("traceScopeId-2107793014")
           .setTraceScope(TraceScope.newBuilder().build())
           .build();
   ApiFuture<TraceScope> future =
       observabilityClient.createTraceScopeCallable().futureCall(request);
   // Do something.
   TraceScope response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateTraceScopeRequest,TraceScope>

deleteLinkAsync(@Nullable LinkName name)

public final OperationFuture<Empty,OperationMetadata> deleteLinkAsync(@Nullable LinkName name)

Delete a link.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   LinkName name = LinkName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]", "[LINK]");
   observabilityClient.deleteLinkAsync(name).get();
 }
 
Parameter
Name Description
name @org.jspecify.annotations.Nullable com.google.cloud.observability.v1.LinkName

Required. Name of the link to delete. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]/links/[LINK_ID]

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteLinkAsync(DeleteLinkRequest request)

public final OperationFuture<Empty,OperationMetadata> deleteLinkAsync(DeleteLinkRequest request)

Delete a link.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   DeleteLinkRequest request =
       DeleteLinkRequest.newBuilder()
           .setName(
               LinkName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]", "[LINK]")
                   .toString())
           .build();
   observabilityClient.deleteLinkAsync(request).get();
 }
 
Parameter
Name Description
request DeleteLinkRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteLinkAsync(String name)

public final OperationFuture<Empty,OperationMetadata> deleteLinkAsync(String name)

Delete a link.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   String name =
       LinkName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]", "[LINK]").toString();
   observabilityClient.deleteLinkAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. Name of the link to delete. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]/links/[LINK_ID]

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteLinkCallable()

public final UnaryCallable<DeleteLinkRequest,Operation> deleteLinkCallable()

Delete a link.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   DeleteLinkRequest request =
       DeleteLinkRequest.newBuilder()
           .setName(
               LinkName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]", "[LINK]")
                   .toString())
           .build();
   ApiFuture<Operation> future = observabilityClient.deleteLinkCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteLinkRequest,Operation>

deleteLinkOperationCallable()

public final OperationCallable<DeleteLinkRequest,Empty,OperationMetadata> deleteLinkOperationCallable()

Delete a link.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   DeleteLinkRequest request =
       DeleteLinkRequest.newBuilder()
           .setName(
               LinkName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]", "[LINK]")
                   .toString())
           .build();
   OperationFuture<Empty, OperationMetadata> future =
       observabilityClient.deleteLinkOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
OperationCallable<DeleteLinkRequest,Empty,OperationMetadata>

deleteTraceScope(@Nullable TraceScopeName name)

public final void deleteTraceScope(@Nullable TraceScopeName name)

Delete a TraceScope.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   TraceScopeName name = TraceScopeName.of("[PROJECT]", "[LOCATION]", "[TRACE_SCOPE]");
   observabilityClient.deleteTraceScope(name);
 }
 
Parameter
Name Description
name @org.jspecify.annotations.Nullable com.google.cloud.observability.v1.TraceScopeName

Required. The full resource name of the trace scope to delete:

projects/[PROJECT_ID]/locations/[LOCATION_ID]/traceScopes/[TRACE_SCOPE_ID]

For example:

projects/my-project/locations/global/traceScopes/my-trace-scope

deleteTraceScope(DeleteTraceScopeRequest request)

public final void deleteTraceScope(DeleteTraceScopeRequest request)

Delete a TraceScope.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   DeleteTraceScopeRequest request =
       DeleteTraceScopeRequest.newBuilder()
           .setName(TraceScopeName.of("[PROJECT]", "[LOCATION]", "[TRACE_SCOPE]").toString())
           .build();
   observabilityClient.deleteTraceScope(request);
 }
 
Parameter
Name Description
request DeleteTraceScopeRequest

The request object containing all of the parameters for the API call.

deleteTraceScope(String name)

public final void deleteTraceScope(String name)

Delete a TraceScope.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   String name = TraceScopeName.of("[PROJECT]", "[LOCATION]", "[TRACE_SCOPE]").toString();
   observabilityClient.deleteTraceScope(name);
 }
 
Parameter
Name Description
name String

Required. The full resource name of the trace scope to delete:

projects/[PROJECT_ID]/locations/[LOCATION_ID]/traceScopes/[TRACE_SCOPE_ID]

For example:

projects/my-project/locations/global/traceScopes/my-trace-scope

deleteTraceScopeCallable()

public final UnaryCallable<DeleteTraceScopeRequest,Empty> deleteTraceScopeCallable()

Delete a TraceScope.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   DeleteTraceScopeRequest request =
       DeleteTraceScopeRequest.newBuilder()
           .setName(TraceScopeName.of("[PROJECT]", "[LOCATION]", "[TRACE_SCOPE]").toString())
           .build();
   ApiFuture<Empty> future = observabilityClient.deleteTraceScopeCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteTraceScopeRequest,Empty>

getBucket(@Nullable BucketName name)

public final Bucket getBucket(@Nullable BucketName name)

Get bucket resource.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   BucketName name = BucketName.of("[PROJECT]", "[LOCATION]", "[BUCKET]");
   Bucket response = observabilityClient.getBucket(name);
 }
 
Parameter
Name Description
name @org.jspecify.annotations.Nullable com.google.cloud.observability.v1.BucketName

Required. Name of the bucket to retrieve. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]

Returns
Type Description
Bucket

getBucket(GetBucketRequest request)

public final Bucket getBucket(GetBucketRequest request)

Get bucket resource.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   GetBucketRequest request =
       GetBucketRequest.newBuilder()
           .setName(BucketName.of("[PROJECT]", "[LOCATION]", "[BUCKET]").toString())
           .build();
   Bucket response = observabilityClient.getBucket(request);
 }
 
Parameter
Name Description
request GetBucketRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Bucket

getBucket(String name)

public final Bucket getBucket(String name)

Get bucket resource.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   String name = BucketName.of("[PROJECT]", "[LOCATION]", "[BUCKET]").toString();
   Bucket response = observabilityClient.getBucket(name);
 }
 
Parameter
Name Description
name String

Required. Name of the bucket to retrieve. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]

Returns
Type Description
Bucket

getBucketCallable()

public final UnaryCallable<GetBucketRequest,Bucket> getBucketCallable()

Get bucket resource.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   GetBucketRequest request =
       GetBucketRequest.newBuilder()
           .setName(BucketName.of("[PROJECT]", "[LOCATION]", "[BUCKET]").toString())
           .build();
   ApiFuture<Bucket> future = observabilityClient.getBucketCallable().futureCall(request);
   // Do something.
   Bucket response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetBucketRequest,Bucket>

getDataset(@Nullable DatasetName name)

public final Dataset getDataset(@Nullable DatasetName name)

Get a dataset.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   DatasetName name = DatasetName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]");
   Dataset response = observabilityClient.getDataset(name);
 }
 
Parameter
Name Description
name @org.jspecify.annotations.Nullable com.google.cloud.observability.v1.DatasetName

Required. Name of the dataset to retrieve. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]

Returns
Type Description
Dataset

getDataset(GetDatasetRequest request)

public final Dataset getDataset(GetDatasetRequest request)

Get a dataset.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   GetDatasetRequest request =
       GetDatasetRequest.newBuilder()
           .setName(
               DatasetName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]").toString())
           .build();
   Dataset response = observabilityClient.getDataset(request);
 }
 
Parameter
Name Description
request GetDatasetRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Dataset

getDataset(String name)

public final Dataset getDataset(String name)

Get a dataset.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   String name = DatasetName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]").toString();
   Dataset response = observabilityClient.getDataset(name);
 }
 
Parameter
Name Description
name String

Required. Name of the dataset to retrieve. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]

Returns
Type Description
Dataset

getDatasetCallable()

public final UnaryCallable<GetDatasetRequest,Dataset> getDatasetCallable()

Get a dataset.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   GetDatasetRequest request =
       GetDatasetRequest.newBuilder()
           .setName(
               DatasetName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]").toString())
           .build();
   ApiFuture<Dataset> future = observabilityClient.getDatasetCallable().futureCall(request);
   // Do something.
   Dataset response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetDatasetRequest,Dataset>

getHttpJsonOperationsClient()

public final OperationsClient getHttpJsonOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
Type Description
OperationsClient
public final Link getLink(@Nullable LinkName name)

Get a link.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   LinkName name = LinkName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]", "[LINK]");
   Link response = observabilityClient.getLink(name);
 }
 
Parameter
Name Description
name @org.jspecify.annotations.Nullable com.google.cloud.observability.v1.LinkName

Required. Name of the link to retrieve. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]/links/[LINK_ID]

Returns
Type Description
Link
public final Link getLink(GetLinkRequest request)

Get a link.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   GetLinkRequest request =
       GetLinkRequest.newBuilder()
           .setName(
               LinkName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]", "[LINK]")
                   .toString())
           .build();
   Link response = observabilityClient.getLink(request);
 }
 
Parameter
Name Description
request GetLinkRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Link
public final Link getLink(String name)

Get a link.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   String name =
       LinkName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]", "[LINK]").toString();
   Link response = observabilityClient.getLink(name);
 }
 
Parameter
Name Description
name String

Required. Name of the link to retrieve. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]/links/[LINK_ID]

Returns
Type Description
Link

getLinkCallable()

public final UnaryCallable<GetLinkRequest,Link> getLinkCallable()

Get a link.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   GetLinkRequest request =
       GetLinkRequest.newBuilder()
           .setName(
               LinkName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]", "[LINK]")
                   .toString())
           .build();
   ApiFuture<Link> future = observabilityClient.getLinkCallable().futureCall(request);
   // Do something.
   Link response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetLinkRequest,Link>

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   Location response = observabilityClient.getLocation(request);
 }
 
Parameter
Name Description
request com.google.cloud.location.GetLocationRequest

The 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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Location> future = observabilityClient.getLocationCallable().futureCall(request);
   // Do something.
   Location response = future.get();
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>

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.

Returns
Type Description
OperationsClient

getScope(@Nullable ScopeName name)

public final Scope getScope(@Nullable ScopeName name)

Gets details of a single 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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   ScopeName name = ScopeName.of("[PROJECT]", "[LOCATION]", "[SCOPE]");
   Scope response = observabilityClient.getScope(name);
 }
 
Parameter
Name Description
name @org.jspecify.annotations.Nullable com.google.cloud.observability.v1.ScopeName

Required. Name of the resource. The format is:

projects/{project}/locations/{location}/scopes/{scope}

The {location} field must be set to global. The {scope} field must be set to _Default.

Returns
Type Description
Scope

getScope(GetScopeRequest request)

public final Scope getScope(GetScopeRequest request)

Gets details of a single 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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   GetScopeRequest request =
       GetScopeRequest.newBuilder()
           .setName(ScopeName.of("[PROJECT]", "[LOCATION]", "[SCOPE]").toString())
           .build();
   Scope response = observabilityClient.getScope(request);
 }
 
Parameter
Name Description
request GetScopeRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Scope

getScope(String name)

public final Scope getScope(String name)

Gets details of a single 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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   String name = ScopeName.of("[PROJECT]", "[LOCATION]", "[SCOPE]").toString();
   Scope response = observabilityClient.getScope(name);
 }
 
Parameter
Name Description
name String

Required. Name of the resource. The format is:

projects/{project}/locations/{location}/scopes/{scope}

The {location} field must be set to global. The {scope} field must be set to _Default.

Returns
Type Description
Scope

getScopeCallable()

public final UnaryCallable<GetScopeRequest,Scope> getScopeCallable()

Gets details of a single 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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   GetScopeRequest request =
       GetScopeRequest.newBuilder()
           .setName(ScopeName.of("[PROJECT]", "[LOCATION]", "[SCOPE]").toString())
           .build();
   ApiFuture<Scope> future = observabilityClient.getScopeCallable().futureCall(request);
   // Do something.
   Scope response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetScopeRequest,Scope>

getSettings()

public final @Nullable ObservabilitySettings getSettings()
Returns
Type Description
@org.jspecify.annotations.Nullable com.google.cloud.observability.v1.ObservabilitySettings

getSettings(@Nullable SettingsName name)

public final Settings getSettings(@Nullable SettingsName name)

Get Settings

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   SettingsName name = SettingsName.ofProjectLocationName("[PROJECT]", "[LOCATION]");
   Settings response = observabilityClient.getSettings(name);
 }
 
Parameter
Name Description
name @org.jspecify.annotations.Nullable com.google.cloud.observability.v1.SettingsName

Required. Name of the settings to retrieve.

Name format:

"projects/[PROJECT_ID]/locations/[LOCATION]/settings" "folders/[FOLDER_ID]/locations/[LOCATION]/settings" "organizations/[ORGANIZATION_ID]/locations/[LOCATION]/settings"

Returns
Type Description
Settings

getSettings(GetSettingsRequest request)

public final Settings getSettings(GetSettingsRequest request)

Get Settings

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   GetSettingsRequest request =
       GetSettingsRequest.newBuilder()
           .setName(SettingsName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString())
           .build();
   Settings response = observabilityClient.getSettings(request);
 }
 
Parameter
Name Description
request GetSettingsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Settings

getSettings(String name)

public final Settings getSettings(String name)

Get Settings

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   String name = SettingsName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString();
   Settings response = observabilityClient.getSettings(name);
 }
 
Parameter
Name Description
name String

Required. Name of the settings to retrieve.

Name format:

"projects/[PROJECT_ID]/locations/[LOCATION]/settings" "folders/[FOLDER_ID]/locations/[LOCATION]/settings" "organizations/[ORGANIZATION_ID]/locations/[LOCATION]/settings"

Returns
Type Description
Settings

getSettingsCallable()

public final UnaryCallable<GetSettingsRequest,Settings> getSettingsCallable()

Get Settings

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   GetSettingsRequest request =
       GetSettingsRequest.newBuilder()
           .setName(SettingsName.ofProjectLocationName("[PROJECT]", "[LOCATION]").toString())
           .build();
   ApiFuture<Settings> future = observabilityClient.getSettingsCallable().futureCall(request);
   // Do something.
   Settings response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetSettingsRequest,Settings>

getStub()

public ObservabilityStub getStub()
Returns
Type Description
ObservabilityStub

getTraceScope(@Nullable TraceScopeName name)

public final TraceScope getTraceScope(@Nullable TraceScopeName name)

Get TraceScope resource.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   TraceScopeName name = TraceScopeName.of("[PROJECT]", "[LOCATION]", "[TRACE_SCOPE]");
   TraceScope response = observabilityClient.getTraceScope(name);
 }
 
Parameter
Name Description
name @org.jspecify.annotations.Nullable com.google.cloud.observability.v1.TraceScopeName

Required. The resource name of the trace scope:

projects/[PROJECT_ID]/locations/[LOCATION_ID]/traceScopes/[TRACE_SCOPE_ID]

For example:

projects/my-project/locations/global/traceScopes/my-trace-scope

Returns
Type Description
TraceScope

getTraceScope(GetTraceScopeRequest request)

public final TraceScope getTraceScope(GetTraceScopeRequest request)

Get TraceScope resource.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   GetTraceScopeRequest request =
       GetTraceScopeRequest.newBuilder()
           .setName(TraceScopeName.of("[PROJECT]", "[LOCATION]", "[TRACE_SCOPE]").toString())
           .build();
   TraceScope response = observabilityClient.getTraceScope(request);
 }
 
Parameter
Name Description
request GetTraceScopeRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
TraceScope

getTraceScope(String name)

public final TraceScope getTraceScope(String name)

Get TraceScope resource.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   String name = TraceScopeName.of("[PROJECT]", "[LOCATION]", "[TRACE_SCOPE]").toString();
   TraceScope response = observabilityClient.getTraceScope(name);
 }
 
Parameter
Name Description
name String

Required. The resource name of the trace scope:

projects/[PROJECT_ID]/locations/[LOCATION_ID]/traceScopes/[TRACE_SCOPE_ID]

For example:

projects/my-project/locations/global/traceScopes/my-trace-scope

Returns
Type Description
TraceScope

getTraceScopeCallable()

public final UnaryCallable<GetTraceScopeRequest,TraceScope> getTraceScopeCallable()

Get TraceScope resource.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   GetTraceScopeRequest request =
       GetTraceScopeRequest.newBuilder()
           .setName(TraceScopeName.of("[PROJECT]", "[LOCATION]", "[TRACE_SCOPE]").toString())
           .build();
   ApiFuture<TraceScope> future =
       observabilityClient.getTraceScopeCallable().futureCall(request);
   // Do something.
   TraceScope response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetTraceScopeRequest,TraceScope>

getView(@Nullable ViewName name)

public final View getView(@Nullable ViewName name)

Get a view.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   ViewName name = ViewName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]", "[VIEW]");
   View response = observabilityClient.getView(name);
 }
 
Parameter
Name Description
name @org.jspecify.annotations.Nullable com.google.cloud.observability.v1.ViewName

Required. Name of the view to retrieve. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]/views/[VIEW_ID]

Returns
Type Description
View

getView(GetViewRequest request)

public final View getView(GetViewRequest request)

Get a view.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   GetViewRequest request =
       GetViewRequest.newBuilder()
           .setName(
               ViewName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]", "[VIEW]")
                   .toString())
           .build();
   View response = observabilityClient.getView(request);
 }
 
Parameter
Name Description
request GetViewRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
View

getView(String name)

public final View getView(String name)

Get a view.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   String name =
       ViewName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]", "[VIEW]").toString();
   View response = observabilityClient.getView(name);
 }
 
Parameter
Name Description
name String

Required. Name of the view to retrieve. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]/views/[VIEW_ID]

Returns
Type Description
View

getViewCallable()

public final UnaryCallable<GetViewRequest,View> getViewCallable()

Get a view.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   GetViewRequest request =
       GetViewRequest.newBuilder()
           .setName(
               ViewName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]", "[VIEW]")
                   .toString())
           .build();
   ApiFuture<View> future = observabilityClient.getViewCallable().futureCall(request);
   // Do something.
   View response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetViewRequest,View>

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listBuckets(@Nullable LocationName parent)

public final ObservabilityClient.ListBucketsPagedResponse listBuckets(@Nullable LocationName parent)

List buckets of a project in a particular 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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (Bucket element : observabilityClient.listBuckets(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent @org.jspecify.annotations.Nullable com.google.cloud.observability.v1.LocationName

Required. The parent, which owns this collection of buckets. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]

Returns
Type Description
ObservabilityClient.ListBucketsPagedResponse

listBuckets(ListBucketsRequest request)

public final ObservabilityClient.ListBucketsPagedResponse listBuckets(ListBucketsRequest request)

List buckets of a project in a particular 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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   ListBucketsRequest request =
       ListBucketsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setShowDeleted(true)
           .build();
   for (Bucket element : observabilityClient.listBuckets(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListBucketsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
ObservabilityClient.ListBucketsPagedResponse

listBuckets(String parent)

public final ObservabilityClient.ListBucketsPagedResponse listBuckets(String parent)

List buckets of a project in a particular 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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (Bucket element : observabilityClient.listBuckets(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The parent, which owns this collection of buckets. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]

Returns
Type Description
ObservabilityClient.ListBucketsPagedResponse

listBucketsCallable()

public final UnaryCallable<ListBucketsRequest,ListBucketsResponse> listBucketsCallable()

List buckets of a project in a particular 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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   ListBucketsRequest request =
       ListBucketsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setShowDeleted(true)
           .build();
   while (true) {
     ListBucketsResponse response = observabilityClient.listBucketsCallable().call(request);
     for (Bucket element : response.getBucketsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListBucketsRequest,ListBucketsResponse>

listBucketsPagedCallable()

public final UnaryCallable<ListBucketsRequest,ObservabilityClient.ListBucketsPagedResponse> listBucketsPagedCallable()

List buckets of a project in a particular 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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   ListBucketsRequest request =
       ListBucketsRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setShowDeleted(true)
           .build();
   ApiFuture<Bucket> future = observabilityClient.listBucketsPagedCallable().futureCall(request);
   // Do something.
   for (Bucket element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListBucketsRequest,ListBucketsPagedResponse>

listDatasets(@Nullable BucketName parent)

public final ObservabilityClient.ListDatasetsPagedResponse listDatasets(@Nullable BucketName parent)

List datasets of a bucket.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   BucketName parent = BucketName.of("[PROJECT]", "[LOCATION]", "[BUCKET]");
   for (Dataset element : observabilityClient.listDatasets(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent @org.jspecify.annotations.Nullable com.google.cloud.observability.v1.BucketName

Required. The parent bucket that owns this collection of datasets. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]

Returns
Type Description
ObservabilityClient.ListDatasetsPagedResponse

listDatasets(ListDatasetsRequest request)

public final ObservabilityClient.ListDatasetsPagedResponse listDatasets(ListDatasetsRequest request)

List datasets of a bucket.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   ListDatasetsRequest request =
       ListDatasetsRequest.newBuilder()
           .setParent(BucketName.of("[PROJECT]", "[LOCATION]", "[BUCKET]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setShowDeleted(true)
           .build();
   for (Dataset element : observabilityClient.listDatasets(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListDatasetsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
ObservabilityClient.ListDatasetsPagedResponse

listDatasets(String parent)

public final ObservabilityClient.ListDatasetsPagedResponse listDatasets(String parent)

List datasets of a bucket.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   String parent = BucketName.of("[PROJECT]", "[LOCATION]", "[BUCKET]").toString();
   for (Dataset element : observabilityClient.listDatasets(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The parent bucket that owns this collection of datasets. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]

Returns
Type Description
ObservabilityClient.ListDatasetsPagedResponse

listDatasetsCallable()

public final UnaryCallable<ListDatasetsRequest,ListDatasetsResponse> listDatasetsCallable()

List datasets of a bucket.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   ListDatasetsRequest request =
       ListDatasetsRequest.newBuilder()
           .setParent(BucketName.of("[PROJECT]", "[LOCATION]", "[BUCKET]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setShowDeleted(true)
           .build();
   while (true) {
     ListDatasetsResponse response = observabilityClient.listDatasetsCallable().call(request);
     for (Dataset element : response.getDatasetsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListDatasetsRequest,ListDatasetsResponse>

listDatasetsPagedCallable()

public final UnaryCallable<ListDatasetsRequest,ObservabilityClient.ListDatasetsPagedResponse> listDatasetsPagedCallable()

List datasets of a bucket.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   ListDatasetsRequest request =
       ListDatasetsRequest.newBuilder()
           .setParent(BucketName.of("[PROJECT]", "[LOCATION]", "[BUCKET]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setShowDeleted(true)
           .build();
   ApiFuture<Dataset> future =
       observabilityClient.listDatasetsPagedCallable().futureCall(request);
   // Do something.
   for (Dataset element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListDatasetsRequest,ListDatasetsPagedResponse>
public final ObservabilityClient.ListLinksPagedResponse listLinks(@Nullable DatasetName parent)

List links of a dataset.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]");
   for (Link element : observabilityClient.listLinks(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent @org.jspecify.annotations.Nullable com.google.cloud.observability.v1.DatasetName

Required. The parent dataset that owns this collection of links. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]

Returns
Type Description
ObservabilityClient.ListLinksPagedResponse
public final ObservabilityClient.ListLinksPagedResponse listLinks(ListLinksRequest request)

List links of a dataset.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   ListLinksRequest request =
       ListLinksRequest.newBuilder()
           .setParent(
               DatasetName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Link element : observabilityClient.listLinks(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListLinksRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
ObservabilityClient.ListLinksPagedResponse
public final ObservabilityClient.ListLinksPagedResponse listLinks(String parent)

List links of a dataset.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   String parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]").toString();
   for (Link element : observabilityClient.listLinks(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The parent dataset that owns this collection of links. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]

Returns
Type Description
ObservabilityClient.ListLinksPagedResponse

listLinksCallable()

public final UnaryCallable<ListLinksRequest,ListLinksResponse> listLinksCallable()

List links of a dataset.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   ListLinksRequest request =
       ListLinksRequest.newBuilder()
           .setParent(
               DatasetName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListLinksResponse response = observabilityClient.listLinksCallable().call(request);
     for (Link element : response.getLinksList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListLinksRequest,ListLinksResponse>

listLinksPagedCallable()

public final UnaryCallable<ListLinksRequest,ObservabilityClient.ListLinksPagedResponse> listLinksPagedCallable()

List links of a dataset.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   ListLinksRequest request =
       ListLinksRequest.newBuilder()
           .setParent(
               DatasetName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Link> future = observabilityClient.listLinksPagedCallable().futureCall(request);
   // Do something.
   for (Link element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListLinksRequest,ListLinksPagedResponse>

listLocations(ListLocationsRequest request)

public final ObservabilityClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)

Lists information about the supported locations for this service.

This method lists locations based on the resource scope provided inthe ListLocationsRequest.name field: ***Global locations**: If name is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If name follows the formatprojects/{project}, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.

For gRPC and client library implementations, the resource name ispassed as the name field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Location element : observabilityClient.listLocations(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request com.google.cloud.location.ListLocationsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
ObservabilityClient.ListLocationsPagedResponse

listLocationsCallable()

public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()

Lists information about the supported locations for this service.

This method lists locations based on the resource scope provided inthe ListLocationsRequest.name field: ***Global locations**: If name is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If name follows the formatprojects/{project}, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.

For gRPC and client library implementations, the resource name ispassed as the name field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListLocationsResponse response = observabilityClient.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,ObservabilityClient.ListLocationsPagedResponse> listLocationsPagedCallable()

Lists information about the supported locations for this service.

This method lists locations based on the resource scope provided inthe ListLocationsRequest.name field: ***Global locations**: If name is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If name follows the formatprojects/{project}, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.

For gRPC and client library implementations, the resource name ispassed as the name field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Location> future =
       observabilityClient.listLocationsPagedCallable().futureCall(request);
   // Do something.
   for (Location element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse>

listTraceScopes(@Nullable LocationName parent)

public final ObservabilityClient.ListTraceScopesPagedResponse listTraceScopes(@Nullable LocationName parent)

List TraceScopes of a project in a particular 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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (TraceScope element : observabilityClient.listTraceScopes(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent @org.jspecify.annotations.Nullable com.google.cloud.observability.v1.LocationName

Required. The full resource name of the location to look for trace scopes:

projects/[PROJECT_ID]/locations/[LOCATION_ID]

For example:

projects/my-project/locations/global

Returns
Type Description
ObservabilityClient.ListTraceScopesPagedResponse

listTraceScopes(ListTraceScopesRequest request)

public final ObservabilityClient.ListTraceScopesPagedResponse listTraceScopes(ListTraceScopesRequest request)

List TraceScopes of a project in a particular 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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   ListTraceScopesRequest request =
       ListTraceScopesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (TraceScope element : observabilityClient.listTraceScopes(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListTraceScopesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
ObservabilityClient.ListTraceScopesPagedResponse

listTraceScopes(String parent)

public final ObservabilityClient.ListTraceScopesPagedResponse listTraceScopes(String parent)

List TraceScopes of a project in a particular 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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (TraceScope element : observabilityClient.listTraceScopes(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The full resource name of the location to look for trace scopes:

projects/[PROJECT_ID]/locations/[LOCATION_ID]

For example:

projects/my-project/locations/global

Returns
Type Description
ObservabilityClient.ListTraceScopesPagedResponse

listTraceScopesCallable()

public final UnaryCallable<ListTraceScopesRequest,ListTraceScopesResponse> listTraceScopesCallable()

List TraceScopes of a project in a particular 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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   ListTraceScopesRequest request =
       ListTraceScopesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListTraceScopesResponse response =
         observabilityClient.listTraceScopesCallable().call(request);
     for (TraceScope element : response.getTraceScopesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListTraceScopesRequest,ListTraceScopesResponse>

listTraceScopesPagedCallable()

public final UnaryCallable<ListTraceScopesRequest,ObservabilityClient.ListTraceScopesPagedResponse> listTraceScopesPagedCallable()

List TraceScopes of a project in a particular 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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   ListTraceScopesRequest request =
       ListTraceScopesRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<TraceScope> future =
       observabilityClient.listTraceScopesPagedCallable().futureCall(request);
   // Do something.
   for (TraceScope element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListTraceScopesRequest,ListTraceScopesPagedResponse>

listViews(@Nullable DatasetName parent)

public final ObservabilityClient.ListViewsPagedResponse listViews(@Nullable DatasetName parent)

List views of a dataset.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   DatasetName parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]");
   for (View element : observabilityClient.listViews(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent @org.jspecify.annotations.Nullable com.google.cloud.observability.v1.DatasetName

Required. Dataset whose views are to be listed. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]

Returns
Type Description
ObservabilityClient.ListViewsPagedResponse

listViews(ListViewsRequest request)

public final ObservabilityClient.ListViewsPagedResponse listViews(ListViewsRequest request)

List views of a dataset.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   ListViewsRequest request =
       ListViewsRequest.newBuilder()
           .setParent(
               DatasetName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (View element : observabilityClient.listViews(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListViewsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
ObservabilityClient.ListViewsPagedResponse

listViews(String parent)

public final ObservabilityClient.ListViewsPagedResponse listViews(String parent)

List views of a dataset.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   String parent = DatasetName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]").toString();
   for (View element : observabilityClient.listViews(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. Dataset whose views are to be listed. The format is:

projects/[PROJECT_ID]/locations/[LOCATION]/buckets/[BUCKET_ID]/datasets/[DATASET_ID]

Returns
Type Description
ObservabilityClient.ListViewsPagedResponse

listViewsCallable()

public final UnaryCallable<ListViewsRequest,ListViewsResponse> listViewsCallable()

List views of a dataset.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   ListViewsRequest request =
       ListViewsRequest.newBuilder()
           .setParent(
               DatasetName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListViewsResponse response = observabilityClient.listViewsCallable().call(request);
     for (View element : response.getViewsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListViewsRequest,ListViewsResponse>

listViewsPagedCallable()

public final UnaryCallable<ListViewsRequest,ObservabilityClient.ListViewsPagedResponse> listViewsPagedCallable()

List views of a dataset.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   ListViewsRequest request =
       ListViewsRequest.newBuilder()
           .setParent(
               DatasetName.of("[PROJECT]", "[LOCATION]", "[BUCKET]", "[DATASET]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<View> future = observabilityClient.listViewsPagedCallable().futureCall(request);
   // Do something.
   for (View element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListViewsRequest,ListViewsPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateBucketAsync(Bucket bucket, FieldMask updateMask)

public final OperationFuture<Bucket,OperationMetadata> updateBucketAsync(Bucket bucket, FieldMask updateMask)

Update a bucket.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   Bucket bucket = Bucket.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Bucket response = observabilityClient.updateBucketAsync(bucket, updateMask).get();
 }
 
Parameters
Name Description
bucket Bucket

Required. The bucket to update.

The name field of bucket identifies the resource to update.

updateMask FieldMask

Optional. The list of fields to update.

Returns
Type Description
OperationFuture<Bucket,OperationMetadata>

updateBucketAsync(UpdateBucketRequest request)

public final OperationFuture<Bucket,OperationMetadata> updateBucketAsync(UpdateBucketRequest request)

Update a bucket.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   UpdateBucketRequest request =
       UpdateBucketRequest.newBuilder()
           .setBucket(Bucket.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Bucket response = observabilityClient.updateBucketAsync(request).get();
 }
 
Parameter
Name Description
request UpdateBucketRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Bucket,OperationMetadata>

updateBucketCallable()

public final UnaryCallable<UpdateBucketRequest,Operation> updateBucketCallable()

Update a bucket.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   UpdateBucketRequest request =
       UpdateBucketRequest.newBuilder()
           .setBucket(Bucket.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Operation> future = observabilityClient.updateBucketCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateBucketRequest,Operation>

updateBucketOperationCallable()

public final OperationCallable<UpdateBucketRequest,Bucket,OperationMetadata> updateBucketOperationCallable()

Update a bucket.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   UpdateBucketRequest request =
       UpdateBucketRequest.newBuilder()
           .setBucket(Bucket.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   OperationFuture<Bucket, OperationMetadata> future =
       observabilityClient.updateBucketOperationCallable().futureCall(request);
   // Do something.
   Bucket response = future.get();
 }
 
Returns
Type Description
OperationCallable<UpdateBucketRequest,Bucket,OperationMetadata>
public final OperationFuture<Link,OperationMetadata> updateLinkAsync(Link link, FieldMask updateMask)

Update a link.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   Link link = Link.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Link response = observabilityClient.updateLinkAsync(link, updateMask).get();
 }
 
Parameters
Name Description
link Link

Required. Link to update.

The name field of link identifies the resource to update.

updateMask FieldMask

Optional. The list of fields to update.

Returns
Type Description
OperationFuture<Link,OperationMetadata>

updateLinkAsync(UpdateLinkRequest request)

public final OperationFuture<Link,OperationMetadata> updateLinkAsync(UpdateLinkRequest request)

Update a link.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   UpdateLinkRequest request =
       UpdateLinkRequest.newBuilder()
           .setLink(Link.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Link response = observabilityClient.updateLinkAsync(request).get();
 }
 
Parameter
Name Description
request UpdateLinkRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Link,OperationMetadata>

updateLinkCallable()

public final UnaryCallable<UpdateLinkRequest,Operation> updateLinkCallable()

Update a link.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   UpdateLinkRequest request =
       UpdateLinkRequest.newBuilder()
           .setLink(Link.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Operation> future = observabilityClient.updateLinkCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateLinkRequest,Operation>

updateLinkOperationCallable()

public final OperationCallable<UpdateLinkRequest,Link,OperationMetadata> updateLinkOperationCallable()

Update a link.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   UpdateLinkRequest request =
       UpdateLinkRequest.newBuilder()
           .setLink(Link.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   OperationFuture<Link, OperationMetadata> future =
       observabilityClient.updateLinkOperationCallable().futureCall(request);
   // Do something.
   Link response = future.get();
 }
 
Returns
Type Description
OperationCallable<UpdateLinkRequest,Link,OperationMetadata>

updateScope(Scope scope, FieldMask updateMask)

public final Scope updateScope(Scope scope, FieldMask updateMask)

Updates the parameters of a single 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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   Scope scope = Scope.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Scope response = observabilityClient.updateScope(scope, updateMask);
 }
 
Parameters
Name Description
scope Scope

Required. The resource being updated.

updateMask FieldMask

Optional. Field mask is used to specify the fields to be overwritten in the Scope resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field is overwritten when it is in the mask. If the user does not provide a mask, then all fields present in the request are overwritten.

Returns
Type Description
Scope

updateScope(UpdateScopeRequest request)

public final Scope updateScope(UpdateScopeRequest request)

Updates the parameters of a single 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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   UpdateScopeRequest request =
       UpdateScopeRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setScope(Scope.newBuilder().build())
           .build();
   Scope response = observabilityClient.updateScope(request);
 }
 
Parameter
Name Description
request UpdateScopeRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Scope

updateScopeCallable()

public final UnaryCallable<UpdateScopeRequest,Scope> updateScopeCallable()

Updates the parameters of a single 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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   UpdateScopeRequest request =
       UpdateScopeRequest.newBuilder()
           .setUpdateMask(FieldMask.newBuilder().build())
           .setScope(Scope.newBuilder().build())
           .build();
   ApiFuture<Scope> future = observabilityClient.updateScopeCallable().futureCall(request);
   // Do something.
   Scope response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateScopeRequest,Scope>

updateSettingsAsync(Settings settings, FieldMask updateMask)

public final OperationFuture<Settings,OperationMetadata> updateSettingsAsync(Settings settings, FieldMask updateMask)

Update Settings

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   Settings settings = Settings.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Settings response = observabilityClient.updateSettingsAsync(settings, updateMask).get();
 }
 
Parameters
Name Description
settings Settings

Required. The settings to update.

The name field of settings is used to identify the resource to be updated.

updateMask FieldMask

Optional. The field mask specifying which fields of the settings are to be updated.

Returns
Type Description
OperationFuture<Settings,OperationMetadata>

updateSettingsAsync(UpdateSettingsRequest request)

public final OperationFuture<Settings,OperationMetadata> updateSettingsAsync(UpdateSettingsRequest request)

Update Settings

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   UpdateSettingsRequest request =
       UpdateSettingsRequest.newBuilder()
           .setSettings(Settings.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Settings response = observabilityClient.updateSettingsAsync(request).get();
 }
 
Parameter
Name Description
request UpdateSettingsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Settings,OperationMetadata>

updateSettingsCallable()

public final UnaryCallable<UpdateSettingsRequest,Operation> updateSettingsCallable()

Update Settings

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   UpdateSettingsRequest request =
       UpdateSettingsRequest.newBuilder()
           .setSettings(Settings.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       observabilityClient.updateSettingsCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateSettingsRequest,Operation>

updateSettingsOperationCallable()

public final OperationCallable<UpdateSettingsRequest,Settings,OperationMetadata> updateSettingsOperationCallable()

Update Settings

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   UpdateSettingsRequest request =
       UpdateSettingsRequest.newBuilder()
           .setSettings(Settings.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   OperationFuture<Settings, OperationMetadata> future =
       observabilityClient.updateSettingsOperationCallable().futureCall(request);
   // Do something.
   Settings response = future.get();
 }
 
Returns
Type Description
OperationCallable<UpdateSettingsRequest,Settings,OperationMetadata>

updateTraceScope(TraceScope traceScope, FieldMask updateMask)

public final TraceScope updateTraceScope(TraceScope traceScope, FieldMask updateMask)

Update a TraceScope.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   TraceScope traceScope = TraceScope.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   TraceScope response = observabilityClient.updateTraceScope(traceScope, updateMask);
 }
 
Parameters
Name Description
traceScope TraceScope

Required. The updated trace scope.

updateMask FieldMask

Optional. The list of fields to update.

Returns
Type Description
TraceScope

updateTraceScope(UpdateTraceScopeRequest request)

public final TraceScope updateTraceScope(UpdateTraceScopeRequest request)

Update a TraceScope.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   UpdateTraceScopeRequest request =
       UpdateTraceScopeRequest.newBuilder()
           .setTraceScope(TraceScope.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   TraceScope response = observabilityClient.updateTraceScope(request);
 }
 
Parameter
Name Description
request UpdateTraceScopeRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
TraceScope

updateTraceScopeCallable()

public final UnaryCallable<UpdateTraceScopeRequest,TraceScope> updateTraceScopeCallable()

Update a TraceScope.

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 (ObservabilityClient observabilityClient = ObservabilityClient.create()) {
   UpdateTraceScopeRequest request =
       UpdateTraceScopeRequest.newBuilder()
           .setTraceScope(TraceScope.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<TraceScope> future =
       observabilityClient.updateTraceScopeCallable().futureCall(request);
   // Do something.
   TraceScope response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateTraceScopeRequest,TraceScope>