use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class SyncDeleteView method syncDeleteView.
public static void syncDeleteView() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
DeleteViewRequest request = DeleteViewRequest.newBuilder().setName(LogViewName.ofProjectLocationBucketViewName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]").toString()).build();
configClient.deleteView(request);
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class AsyncGetCmekSettings method asyncGetCmekSettings.
public static void asyncGetCmekSettings() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
GetCmekSettingsRequest request = GetCmekSettingsRequest.newBuilder().setName(CmekSettingsName.ofProjectName("[PROJECT]").toString()).build();
ApiFuture<CmekSettings> future = configClient.getCmekSettingsCallable().futureCall(request);
// Do something.
CmekSettings response = future.get();
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class AsyncGetExclusion method asyncGetExclusion.
public static void asyncGetExclusion() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
GetExclusionRequest request = GetExclusionRequest.newBuilder().setName(LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()).build();
ApiFuture<LogExclusion> future = configClient.getExclusionCallable().futureCall(request);
// Do something.
LogExclusion response = future.get();
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class AsyncCreateBucket method asyncCreateBucket.
public static void asyncCreateBucket() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
CreateBucketRequest request = CreateBucketRequest.newBuilder().setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()).setBucketId("bucketId-1603305307").setBucket(LogBucket.newBuilder().build()).build();
ApiFuture<LogBucket> future = configClient.createBucketCallable().futureCall(request);
// Do something.
LogBucket response = future.get();
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class SyncCreateBucket method syncCreateBucket.
public static void syncCreateBucket() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
CreateBucketRequest request = CreateBucketRequest.newBuilder().setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()).setBucketId("bucketId-1603305307").setBucket(LogBucket.newBuilder().build()).build();
LogBucket response = configClient.createBucket(request);
}
}
Aggregations