use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class SyncCreateExclusionProjectnameLogexclusion method syncCreateExclusionProjectnameLogexclusion.
public static void syncCreateExclusionProjectnameLogexclusion() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
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 SyncCreateExclusionStringLogexclusion method syncCreateExclusionStringLogexclusion.
public static void syncCreateExclusionStringLogexclusion() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
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 SyncCreateSink method syncCreateSink.
public static void syncCreateSink() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
CreateSinkRequest request = CreateSinkRequest.newBuilder().setParent(ProjectName.of("[PROJECT]").toString()).setSink(LogSink.newBuilder().build()).setUniqueWriterIdentity(true).build();
LogSink response = configClient.createSink(request);
}
}
use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.
the class SyncCreateSinkBillingaccountnameLogsink method syncCreateSinkBillingaccountnameLogsink.
public static void syncCreateSinkBillingaccountnameLogsink() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
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 SyncCreateSinkFoldernameLogsink method syncCreateSinkFoldernameLogsink.
public static void syncCreateSinkFoldernameLogsink() throws Exception {
// It may require modifications to work in your environment.
try (ConfigClient configClient = ConfigClient.create()) {
FolderName parent = FolderName.of("[FOLDER]");
LogSink sink = LogSink.newBuilder().build();
LogSink response = configClient.createSink(parent, sink);
}
}
Aggregations