use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class SyncGetSinkString method syncGetSinkString.
public static void syncGetSinkString() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString();
LogSink response = configClient.getSink(sinkName);
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class AsyncListBucketsPaged method asyncListBucketsPaged.
public static void asyncListBucketsPaged() 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();
while (true) {
ListBucketsResponse response = configClient.listBucketsCallable().call(request);
for (LogBucket element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class AsyncUpdateExclusion method asyncUpdateExclusion.
public static void asyncUpdateExclusion() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
UpdateExclusionRequest request = UpdateExclusionRequest.newBuilder().setName(LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()).setExclusion(LogExclusion.newBuilder().build()).setUpdateMask(FieldMask.newBuilder().build()).build();
ApiFuture<LogExclusion> future = configClient.updateExclusionCallable().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 SyncUpdateExclusion method syncUpdateExclusion.
public static void syncUpdateExclusion() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
UpdateExclusionRequest request = UpdateExclusionRequest.newBuilder().setName(LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()).setExclusion(LogExclusion.newBuilder().build()).setUpdateMask(FieldMask.newBuilder().build()).build();
LogExclusion response = configClient.updateExclusion(request);
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class SyncUpdateExclusionStringLogexclusionFieldmask method syncUpdateExclusionStringLogexclusionFieldmask.
public static void syncUpdateExclusionStringLogexclusionFieldmask() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
String name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString();
LogExclusion exclusion = LogExclusion.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
LogExclusion response = configClient.updateExclusion(name, exclusion, updateMask);
}
}
Aggregations