use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class SyncCreateSinkOrganizationnameLogsink method syncCreateSinkOrganizationnameLogsink.
public static void syncCreateSinkOrganizationnameLogsink() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
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 SyncDeleteSink method syncDeleteSink.
public static void syncDeleteSink() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
DeleteSinkRequest request = DeleteSinkRequest.newBuilder().setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()).build();
configClient.deleteSink(request);
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class SyncDeleteSinkLogsinkname method syncDeleteSinkLogsinkname.
public static void syncDeleteSinkLogsinkname() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
configClient.deleteSink(sinkName);
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class SyncDeleteSinkString method syncDeleteSinkString.
public static void syncDeleteSinkString() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString();
configClient.deleteSink(sinkName);
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class AsyncGetBucket method asyncGetBucket.
public static void asyncGetBucket() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
GetBucketRequest request = GetBucketRequest.newBuilder().setName(LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]").toString()).build();
ApiFuture<LogBucket> future = configClient.getBucketCallable().futureCall(request);
// Do something.
LogBucket response = future.get();
}
}
Aggregations