Search in sources :

Example 26 with ConfigClient

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

the class SyncDeleteView method syncDeleteView.

public static void syncDeleteView() throws Exception {
    // It may require modifications to work in your environment.
    try (ConfigClient configClient = ConfigClient.create()) {
        DeleteViewRequest request = DeleteViewRequest.newBuilder().setName(LogViewName.ofProjectLocationBucketViewName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]").toString()).build();
        configClient.deleteView(request);
    }
}
Also used : ConfigClient(com.google.cloud.logging.v2.ConfigClient) DeleteViewRequest(com.google.logging.v2.DeleteViewRequest)

Example 27 with ConfigClient

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

the class AsyncGetCmekSettings method asyncGetCmekSettings.

public static void asyncGetCmekSettings() 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();
        ApiFuture<CmekSettings> future = configClient.getCmekSettingsCallable().futureCall(request);
        // Do something.
        CmekSettings response = future.get();
    }
}
Also used : ConfigClient(com.google.cloud.logging.v2.ConfigClient) CmekSettings(com.google.logging.v2.CmekSettings) GetCmekSettingsRequest(com.google.logging.v2.GetCmekSettingsRequest)

Example 28 with ConfigClient

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

the class AsyncGetExclusion method asyncGetExclusion.

public static void asyncGetExclusion() throws Exception {
    // It may require modifications to work in your environment.
    try (ConfigClient configClient = ConfigClient.create()) {
        GetExclusionRequest request = GetExclusionRequest.newBuilder().setName(LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()).build();
        ApiFuture<LogExclusion> future = configClient.getExclusionCallable().futureCall(request);
        // Do something.
        LogExclusion response = future.get();
    }
}
Also used : ConfigClient(com.google.cloud.logging.v2.ConfigClient) LogExclusion(com.google.logging.v2.LogExclusion) GetExclusionRequest(com.google.logging.v2.GetExclusionRequest)

Example 29 with ConfigClient

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

the class AsyncCreateBucket method asyncCreateBucket.

public static void asyncCreateBucket() throws Exception {
    // It may require modifications to work in your environment.
    try (ConfigClient configClient = ConfigClient.create()) {
        CreateBucketRequest request = CreateBucketRequest.newBuilder().setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()).setBucketId("bucketId-1603305307").setBucket(LogBucket.newBuilder().build()).build();
        ApiFuture<LogBucket> future = configClient.createBucketCallable().futureCall(request);
        // Do something.
        LogBucket response = future.get();
    }
}
Also used : ConfigClient(com.google.cloud.logging.v2.ConfigClient) CreateBucketRequest(com.google.logging.v2.CreateBucketRequest) LogBucket(com.google.logging.v2.LogBucket)

Example 30 with ConfigClient

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

the class SyncCreateBucket method syncCreateBucket.

public static void syncCreateBucket() throws Exception {
    // It may require modifications to work in your environment.
    try (ConfigClient configClient = ConfigClient.create()) {
        CreateBucketRequest request = CreateBucketRequest.newBuilder().setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()).setBucketId("bucketId-1603305307").setBucket(LogBucket.newBuilder().build()).build();
        LogBucket response = configClient.createBucket(request);
    }
}
Also used : ConfigClient(com.google.cloud.logging.v2.ConfigClient) CreateBucketRequest(com.google.logging.v2.CreateBucketRequest) LogBucket(com.google.logging.v2.LogBucket)

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