Search in sources :

Example 6 with ConfigClient

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

the class AsyncUndeleteBucket method asyncUndeleteBucket.

public static void asyncUndeleteBucket() throws Exception {
    // It may require modifications to work in your environment.
    try (ConfigClient configClient = ConfigClient.create()) {
        UndeleteBucketRequest request = UndeleteBucketRequest.newBuilder().setName(LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]").toString()).build();
        ApiFuture<Empty> future = configClient.undeleteBucketCallable().futureCall(request);
        // Do something.
        future.get();
    }
}
Also used : ConfigClient(com.google.cloud.logging.v2.ConfigClient) Empty(com.google.protobuf.Empty) UndeleteBucketRequest(com.google.logging.v2.UndeleteBucketRequest)

Example 7 with ConfigClient

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

the class AsyncUpdateBucket method asyncUpdateBucket.

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

Example 8 with ConfigClient

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

the class AsyncListSinks method asyncListSinks.

public static void asyncListSinks() throws Exception {
    // It may require modifications to work in your environment.
    try (ConfigClient configClient = ConfigClient.create()) {
        ListSinksRequest request = ListSinksRequest.newBuilder().setParent(ProjectName.of("[PROJECT]").toString()).setPageToken("pageToken873572522").setPageSize(883849137).build();
        ApiFuture<LogSink> future = configClient.listSinksPagedCallable().futureCall(request);
        // Do something.
        for (LogSink element : future.get().iterateAll()) {
        // doThingsWith(element);
        }
    }
}
Also used : LogSink(com.google.logging.v2.LogSink) ConfigClient(com.google.cloud.logging.v2.ConfigClient) ListSinksRequest(com.google.logging.v2.ListSinksRequest)

Example 9 with ConfigClient

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

the class AsyncListSinksPaged method asyncListSinksPaged.

public static void asyncListSinksPaged() throws Exception {
    // It may require modifications to work in your environment.
    try (ConfigClient configClient = ConfigClient.create()) {
        ListSinksRequest request = ListSinksRequest.newBuilder().setParent(ProjectName.of("[PROJECT]").toString()).setPageToken("pageToken873572522").setPageSize(883849137).build();
        while (true) {
            ListSinksResponse response = configClient.listSinksCallable().call(request);
            for (LogSink element : response.getResponsesList()) {
            // doThingsWith(element);
            }
            String nextPageToken = response.getNextPageToken();
            if (!Strings.isNullOrEmpty(nextPageToken)) {
                request = request.toBuilder().setPageToken(nextPageToken).build();
            } else {
                break;
            }
        }
    }
}
Also used : LogSink(com.google.logging.v2.LogSink) ConfigClient(com.google.cloud.logging.v2.ConfigClient) ListSinksResponse(com.google.logging.v2.ListSinksResponse) ListSinksRequest(com.google.logging.v2.ListSinksRequest)

Example 10 with ConfigClient

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

the class AsyncUpdateView method asyncUpdateView.

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

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