use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class SyncGetCmekSettings method syncGetCmekSettings.
public static void syncGetCmekSettings() 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();
CmekSettings response = configClient.getCmekSettings(request);
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class AsyncCreateExclusion method asyncCreateExclusion.
public static void asyncCreateExclusion() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
CreateExclusionRequest request = CreateExclusionRequest.newBuilder().setParent(ProjectName.of("[PROJECT]").toString()).setExclusion(LogExclusion.newBuilder().build()).build();
ApiFuture<LogExclusion> future = configClient.createExclusionCallable().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 SyncCreateExclusion method syncCreateExclusion.
public static void syncCreateExclusion() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
CreateExclusionRequest request = CreateExclusionRequest.newBuilder().setParent(ProjectName.of("[PROJECT]").toString()).setExclusion(LogExclusion.newBuilder().build()).build();
LogExclusion response = configClient.createExclusion(request);
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class SyncCreateExclusionBillingaccountnameLogexclusion method syncCreateExclusionBillingaccountnameLogexclusion.
public static void syncCreateExclusionBillingaccountnameLogexclusion() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
LogExclusion exclusion = LogExclusion.newBuilder().build();
LogExclusion response = configClient.createExclusion(parent, exclusion);
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class SyncCreateExclusionFoldernameLogexclusion method syncCreateExclusionFoldernameLogexclusion.
public static void syncCreateExclusionFoldernameLogexclusion() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
FolderName parent = FolderName.of("[FOLDER]");
LogExclusion exclusion = LogExclusion.newBuilder().build();
LogExclusion response = configClient.createExclusion(parent, exclusion);
}
}
Aggregations