use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class SyncGetView method syncGetView.
public static void syncGetView() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
GetViewRequest request = GetViewRequest.newBuilder().setName(LogViewName.ofProjectLocationBucketViewName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]").toString()).build();
LogView response = configClient.getView(request);
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class AsyncListBuckets method asyncListBuckets.
public static void asyncListBuckets() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
ListBucketsRequest request = ListBucketsRequest.newBuilder().setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()).setPageToken("pageToken873572522").setPageSize(883849137).build();
ApiFuture<LogBucket> future = configClient.listBucketsPagedCallable().futureCall(request);
// Do something.
for (LogBucket element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class AsyncCreateView method asyncCreateView.
public static void asyncCreateView() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
CreateViewRequest request = CreateViewRequest.newBuilder().setParent("parent-995424086").setViewId("viewId-816632160").setView(LogView.newBuilder().build()).build();
ApiFuture<LogView> future = configClient.createViewCallable().futureCall(request);
// Do something.
LogView response = future.get();
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class SyncCreateView method syncCreateView.
public static void syncCreateView() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
CreateViewRequest request = CreateViewRequest.newBuilder().setParent("parent-995424086").setViewId("viewId-816632160").setView(LogView.newBuilder().build()).build();
LogView response = configClient.createView(request);
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class AsyncDeleteBucket method asyncDeleteBucket.
public static void asyncDeleteBucket() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
DeleteBucketRequest request = DeleteBucketRequest.newBuilder().setName(LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]").toString()).build();
ApiFuture<Empty> future = configClient.deleteBucketCallable().futureCall(request);
// Do something.
future.get();
}
}
Aggregations