Search in sources :

Example 1 with ConfigClient

use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.

the class SyncUpdateBucket method syncUpdateBucket.

public static void syncUpdateBucket() throws Exception {
    // It may require modifications to work in your environment.
    try (ConfigClient configClient = ConfigClient.create()) {
        UpdateBucketRequest request = UpdateBucketRequest.newBuilder().setName(LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]").toString()).setBucket(LogBucket.newBuilder().build()).setUpdateMask(FieldMask.newBuilder().build()).build();
        LogBucket response = configClient.updateBucket(request);
    }
}
Also used : UpdateBucketRequest(com.google.logging.v2.UpdateBucketRequest) ConfigClient(com.google.cloud.logging.v2.ConfigClient) LogBucket(com.google.logging.v2.LogBucket)

Example 2 with ConfigClient

use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.

the class AsyncUpdateCmekSettings method asyncUpdateCmekSettings.

public static void asyncUpdateCmekSettings() throws Exception {
    // It may require modifications to work in your environment.
    try (ConfigClient configClient = ConfigClient.create()) {
        UpdateCmekSettingsRequest request = UpdateCmekSettingsRequest.newBuilder().setName("name3373707").setCmekSettings(CmekSettings.newBuilder().build()).setUpdateMask(FieldMask.newBuilder().build()).build();
        ApiFuture<CmekSettings> future = configClient.updateCmekSettingsCallable().futureCall(request);
        // Do something.
        CmekSettings response = future.get();
    }
}
Also used : UpdateCmekSettingsRequest(com.google.logging.v2.UpdateCmekSettingsRequest) ConfigClient(com.google.cloud.logging.v2.ConfigClient) CmekSettings(com.google.logging.v2.CmekSettings)

Example 3 with ConfigClient

use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.

the class SyncUpdateCmekSettings method syncUpdateCmekSettings.

public static void syncUpdateCmekSettings() throws Exception {
    // It may require modifications to work in your environment.
    try (ConfigClient configClient = ConfigClient.create()) {
        UpdateCmekSettingsRequest request = UpdateCmekSettingsRequest.newBuilder().setName("name3373707").setCmekSettings(CmekSettings.newBuilder().build()).setUpdateMask(FieldMask.newBuilder().build()).build();
        CmekSettings response = configClient.updateCmekSettings(request);
    }
}
Also used : UpdateCmekSettingsRequest(com.google.logging.v2.UpdateCmekSettingsRequest) ConfigClient(com.google.cloud.logging.v2.ConfigClient) CmekSettings(com.google.logging.v2.CmekSettings)

Example 4 with ConfigClient

use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.

the class SyncUpdateExclusionLogexclusionnameLogexclusionFieldmask method syncUpdateExclusionLogexclusionnameLogexclusionFieldmask.

public static void syncUpdateExclusionLogexclusionnameLogexclusionFieldmask() throws Exception {
    // It may require modifications to work in your environment.
    try (ConfigClient configClient = ConfigClient.create()) {
        LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
        LogExclusion exclusion = LogExclusion.newBuilder().build();
        FieldMask updateMask = FieldMask.newBuilder().build();
        LogExclusion response = configClient.updateExclusion(name, exclusion, updateMask);
    }
}
Also used : ConfigClient(com.google.cloud.logging.v2.ConfigClient) LogExclusion(com.google.logging.v2.LogExclusion) LogExclusionName(com.google.logging.v2.LogExclusionName) FieldMask(com.google.protobuf.FieldMask)

Example 5 with ConfigClient

use of com.google.cloud.logging.v2.ConfigClient in project gapic-generator-java by googleapis.

the class AsyncUpdateSink method asyncUpdateSink.

public static void asyncUpdateSink() throws Exception {
    // It may require modifications to work in your environment.
    try (ConfigClient configClient = ConfigClient.create()) {
        UpdateSinkRequest request = UpdateSinkRequest.newBuilder().setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()).setSink(LogSink.newBuilder().build()).setUniqueWriterIdentity(true).setUpdateMask(FieldMask.newBuilder().build()).build();
        ApiFuture<LogSink> future = configClient.updateSinkCallable().futureCall(request);
        // Do something.
        LogSink response = future.get();
    }
}
Also used : LogSink(com.google.logging.v2.LogSink) ConfigClient(com.google.cloud.logging.v2.ConfigClient) UpdateSinkRequest(com.google.logging.v2.UpdateSinkRequest)

Aggregations

ConfigClient (com.google.cloud.logging.v2.ConfigClient)69 LogSink (com.google.logging.v2.LogSink)19 LogExclusion (com.google.logging.v2.LogExclusion)17 LogView (com.google.logging.v2.LogView)8 LogBucket (com.google.logging.v2.LogBucket)7 Empty (com.google.protobuf.Empty)5 CmekSettings (com.google.logging.v2.CmekSettings)4 LogSinkName (com.google.logging.v2.LogSinkName)4 FieldMask (com.google.protobuf.FieldMask)4 LogExclusionName (com.google.logging.v2.LogExclusionName)3 BillingAccountName (com.google.logging.v2.BillingAccountName)2 CreateBucketRequest (com.google.logging.v2.CreateBucketRequest)2 CreateExclusionRequest (com.google.logging.v2.CreateExclusionRequest)2 CreateSinkRequest (com.google.logging.v2.CreateSinkRequest)2 CreateViewRequest (com.google.logging.v2.CreateViewRequest)2 DeleteBucketRequest (com.google.logging.v2.DeleteBucketRequest)2 DeleteExclusionRequest (com.google.logging.v2.DeleteExclusionRequest)2 DeleteSinkRequest (com.google.logging.v2.DeleteSinkRequest)2 DeleteViewRequest (com.google.logging.v2.DeleteViewRequest)2 FolderName (com.google.logging.v2.FolderName)2