use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class SyncCreateSinkStringLogsink method syncCreateSinkStringLogsink.
public static void syncCreateSinkStringLogsink() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
LogSink sink = LogSink.newBuilder().build();
LogSink response = configClient.createSink(parent, sink);
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class SyncDeleteBucket method syncDeleteBucket.
public static void syncDeleteBucket() 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();
configClient.deleteBucket(request);
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class AsyncDeleteExclusion method asyncDeleteExclusion.
public static void asyncDeleteExclusion() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
DeleteExclusionRequest request = DeleteExclusionRequest.newBuilder().setName(LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()).build();
ApiFuture<Empty> future = configClient.deleteExclusionCallable().futureCall(request);
// Do something.
future.get();
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class SyncGetExclusionString method syncGetExclusionString.
public static void syncGetExclusionString() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
String name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString();
LogExclusion response = configClient.getExclusion(name);
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class SyncGetSink method syncGetSink.
public static void syncGetSink() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
GetSinkRequest request = GetSinkRequest.newBuilder().setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()).build();
LogSink response = configClient.getSink(request);
}
}
Aggregations