Search in sources :

Example 16 with ConfigClient

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

the class SyncGetView method syncGetView.

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

Example 17 with ConfigClient

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

the class AsyncListBuckets method asyncListBuckets.

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

Example 18 with ConfigClient

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

the class AsyncCreateView method asyncCreateView.

public static void asyncCreateView() throws Exception {
    // It may require modifications to work in your environment.
    try (ConfigClient configClient = ConfigClient.create()) {
        CreateViewRequest request = CreateViewRequest.newBuilder().setParent("parent-995424086").setViewId("viewId-816632160").setView(LogView.newBuilder().build()).build();
        ApiFuture<LogView> future = configClient.createViewCallable().futureCall(request);
        // Do something.
        LogView response = future.get();
    }
}
Also used : ConfigClient(com.google.cloud.logging.v2.ConfigClient) CreateViewRequest(com.google.logging.v2.CreateViewRequest) LogView(com.google.logging.v2.LogView)

Example 19 with ConfigClient

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

the class SyncCreateView method syncCreateView.

public static void syncCreateView() throws Exception {
    // It may require modifications to work in your environment.
    try (ConfigClient configClient = ConfigClient.create()) {
        CreateViewRequest request = CreateViewRequest.newBuilder().setParent("parent-995424086").setViewId("viewId-816632160").setView(LogView.newBuilder().build()).build();
        LogView response = configClient.createView(request);
    }
}
Also used : ConfigClient(com.google.cloud.logging.v2.ConfigClient) CreateViewRequest(com.google.logging.v2.CreateViewRequest) LogView(com.google.logging.v2.LogView)

Example 20 with ConfigClient

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

the class AsyncDeleteBucket method asyncDeleteBucket.

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

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