Search in sources :

Example 41 with ConfigClient

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

the class SyncCreateSinkOrganizationnameLogsink method syncCreateSinkOrganizationnameLogsink.

public static void syncCreateSinkOrganizationnameLogsink() throws Exception {
    // It may require modifications to work in your environment.
    try (ConfigClient configClient = ConfigClient.create()) {
        OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
        LogSink sink = LogSink.newBuilder().build();
        LogSink response = configClient.createSink(parent, sink);
    }
}
Also used : OrganizationName(com.google.logging.v2.OrganizationName) LogSink(com.google.logging.v2.LogSink) ConfigClient(com.google.cloud.logging.v2.ConfigClient)

Example 42 with ConfigClient

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

the class SyncDeleteSink method syncDeleteSink.

public static void syncDeleteSink() throws Exception {
    // It may require modifications to work in your environment.
    try (ConfigClient configClient = ConfigClient.create()) {
        DeleteSinkRequest request = DeleteSinkRequest.newBuilder().setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()).build();
        configClient.deleteSink(request);
    }
}
Also used : ConfigClient(com.google.cloud.logging.v2.ConfigClient) DeleteSinkRequest(com.google.logging.v2.DeleteSinkRequest)

Example 43 with ConfigClient

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

the class SyncDeleteSinkLogsinkname method syncDeleteSinkLogsinkname.

public static void syncDeleteSinkLogsinkname() throws Exception {
    // It may require modifications to work in your environment.
    try (ConfigClient configClient = ConfigClient.create()) {
        LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
        configClient.deleteSink(sinkName);
    }
}
Also used : LogSinkName(com.google.logging.v2.LogSinkName) ConfigClient(com.google.cloud.logging.v2.ConfigClient)

Example 44 with ConfigClient

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

the class SyncDeleteSinkString method syncDeleteSinkString.

public static void syncDeleteSinkString() throws Exception {
    // It may require modifications to work in your environment.
    try (ConfigClient configClient = ConfigClient.create()) {
        String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString();
        configClient.deleteSink(sinkName);
    }
}
Also used : ConfigClient(com.google.cloud.logging.v2.ConfigClient)

Example 45 with ConfigClient

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

the class AsyncGetBucket method asyncGetBucket.

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

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