public class ConfigClient implements BackgroundResource
Service Description: Service for configuring sinks used to route log entries.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
try (ConfigClient configClient = ConfigClient.create()) {
GetBucketRequest request =
GetBucketRequest.newBuilder()
.setName(
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
.toString())
.build();
LogBucket response = configClient.getBucket(request);
}
Note: close() needs to be called on the ConfigClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of ConfigSettings to create(). For example:
To customize credentials:
ConfigSettings configSettings =
ConfigSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ConfigClient configClient = ConfigClient.create(configSettings);
To customize the endpoint:
ConfigSettings configSettings = ConfigSettings.newBuilder().setEndpoint(myEndpoint).build();
ConfigClient configClient = ConfigClient.create(configSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Implements
BackgroundResourceConstructors
ConfigClient(ConfigSettings settings)
protected ConfigClient(ConfigSettings settings)
Constructs an instance of ConfigClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
Name | Description |
settings | ConfigSettings |
ConfigClient(ConfigServiceV2Stub stub)
protected ConfigClient(ConfigServiceV2Stub stub)
Name | Description |
stub | ConfigServiceV2Stub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Name | Description |
duration | long |
unit | TimeUnit |
Type | Description |
boolean |
Type | Description |
InterruptedException |
close()
public final void close()
create()
public static final ConfigClient create()
Constructs an instance of ConfigClient with default settings.
Type | Description |
ConfigClient |
Type | Description |
IOException |
create(ConfigSettings settings)
public static final ConfigClient create(ConfigSettings settings)
Constructs an instance of ConfigClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
Name | Description |
settings | ConfigSettings |
Type | Description |
ConfigClient |
Type | Description |
IOException |
create(ConfigServiceV2Stub stub)
public static final ConfigClient create(ConfigServiceV2Stub stub)
Constructs an instance of ConfigClient, using the given stub for making calls. This is for advanced usage - prefer using create(ConfigSettings).
Name | Description |
stub | ConfigServiceV2Stub |
Type | Description |
ConfigClient |
createBucket(CreateBucketRequest request)
public final LogBucket createBucket(CreateBucketRequest request)
Creates a bucket that can be used to store log entries. Once a bucket has been created, the region cannot be changed.
Sample code:
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);
}
Name | Description |
request | CreateBucketRequest The request object containing all of the parameters for the API call. |
Type | Description |
LogBucket |
createBucketCallable()
public final UnaryCallable<CreateBucketRequest,LogBucket> createBucketCallable()
Creates a bucket that can be used to store log entries. Once a bucket has been created, the region cannot be changed.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
CreateBucketRequest request =
CreateBucketRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setBucketId("bucketId-1603305307")
.setBucket(LogBucket.newBuilder().build())
.build();
ApiFuture
Type | Description |
UnaryCallable<CreateBucketRequest,LogBucket> |
createExclusion(BillingAccountName parent, LogExclusion exclusion)
public final LogExclusion createExclusion(BillingAccountName parent, LogExclusion exclusion)
Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
LogExclusion exclusion = LogExclusion.newBuilder().build();
LogExclusion response = configClient.createExclusion(parent, exclusion);
}
Name | Description |
parent | BillingAccountName Required. The parent resource in which to create the exclusion: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: |
exclusion | LogExclusion Required. The new exclusion, whose |
Type | Description |
LogExclusion |
createExclusion(CreateExclusionRequest request)
public final LogExclusion createExclusion(CreateExclusionRequest request)
Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
CreateExclusionRequest request =
CreateExclusionRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setExclusion(LogExclusion.newBuilder().build())
.build();
LogExclusion response = configClient.createExclusion(request);
}
Name | Description |
request | CreateExclusionRequest The request object containing all of the parameters for the API call. |
Type | Description |
LogExclusion |
createExclusion(FolderName parent, LogExclusion exclusion)
public final LogExclusion createExclusion(FolderName parent, LogExclusion exclusion)
Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
FolderName parent = FolderName.of("[FOLDER]");
LogExclusion exclusion = LogExclusion.newBuilder().build();
LogExclusion response = configClient.createExclusion(parent, exclusion);
}
Name | Description |
parent | FolderName Required. The parent resource in which to create the exclusion: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: |
exclusion | LogExclusion Required. The new exclusion, whose |
Type | Description |
LogExclusion |
createExclusion(OrganizationName parent, LogExclusion exclusion)
public final LogExclusion createExclusion(OrganizationName parent, LogExclusion exclusion)
Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
LogExclusion exclusion = LogExclusion.newBuilder().build();
LogExclusion response = configClient.createExclusion(parent, exclusion);
}
Name | Description |
parent | OrganizationName Required. The parent resource in which to create the exclusion: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: |
exclusion | LogExclusion Required. The new exclusion, whose |
Type | Description |
LogExclusion |
createExclusion(ProjectName parent, LogExclusion exclusion)
public final LogExclusion createExclusion(ProjectName parent, LogExclusion exclusion)
Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
LogExclusion exclusion = LogExclusion.newBuilder().build();
LogExclusion response = configClient.createExclusion(parent, exclusion);
}
Name | Description |
parent | ProjectName Required. The parent resource in which to create the exclusion: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: |
exclusion | LogExclusion Required. The new exclusion, whose |
Type | Description |
LogExclusion |
createExclusion(String parent, LogExclusion exclusion)
public final LogExclusion createExclusion(String parent, LogExclusion exclusion)
Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
LogExclusion exclusion = LogExclusion.newBuilder().build();
LogExclusion response = configClient.createExclusion(parent, exclusion);
}
Name | Description |
parent | String Required. The parent resource in which to create the exclusion: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: |
exclusion | LogExclusion Required. The new exclusion, whose |
Type | Description |
LogExclusion |
createExclusionCallable()
public final UnaryCallable<CreateExclusionRequest,LogExclusion> createExclusionCallable()
Creates a new exclusion in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
CreateExclusionRequest request =
CreateExclusionRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setExclusion(LogExclusion.newBuilder().build())
.build();
ApiFuture
Type | Description |
UnaryCallable<CreateExclusionRequest,LogExclusion> |
createSink(BillingAccountName parent, LogSink sink)
public final LogSink createSink(BillingAccountName parent, LogSink sink)
Creates a sink that exports specified log entries to a destination. The export of
newly-ingested log entries begins immediately, unless the sink's writer_identity
is not
permitted to write to the destination. A sink can export log entries only from the resource
owning the sink.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
LogSink sink = LogSink.newBuilder().build();
LogSink response = configClient.createSink(parent, sink);
}
Name | Description |
parent | BillingAccountName Required. The resource in which to create the sink: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: |
sink | LogSink Required. The new sink, whose |
Type | Description |
LogSink |
createSink(CreateSinkRequest request)
public final LogSink createSink(CreateSinkRequest request)
Creates a sink that exports specified log entries to a destination. The export of
newly-ingested log entries begins immediately, unless the sink's writer_identity
is not
permitted to write to the destination. A sink can export log entries only from the resource
owning the sink.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
CreateSinkRequest request =
CreateSinkRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setSink(LogSink.newBuilder().build())
.setUniqueWriterIdentity(true)
.build();
LogSink response = configClient.createSink(request);
}
Name | Description |
request | CreateSinkRequest The request object containing all of the parameters for the API call. |
Type | Description |
LogSink |
createSink(FolderName parent, LogSink sink)
public final LogSink createSink(FolderName parent, LogSink sink)
Creates a sink that exports specified log entries to a destination. The export of
newly-ingested log entries begins immediately, unless the sink's writer_identity
is not
permitted to write to the destination. A sink can export log entries only from the resource
owning the sink.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
FolderName parent = FolderName.of("[FOLDER]");
LogSink sink = LogSink.newBuilder().build();
LogSink response = configClient.createSink(parent, sink);
}
Name | Description |
parent | FolderName Required. The resource in which to create the sink: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: |
sink | LogSink Required. The new sink, whose |
Type | Description |
LogSink |
createSink(OrganizationName parent, LogSink sink)
public final LogSink createSink(OrganizationName parent, LogSink sink)
Creates a sink that exports specified log entries to a destination. The export of
newly-ingested log entries begins immediately, unless the sink's writer_identity
is not
permitted to write to the destination. A sink can export log entries only from the resource
owning the sink.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
LogSink sink = LogSink.newBuilder().build();
LogSink response = configClient.createSink(parent, sink);
}
Name | Description |
parent | OrganizationName Required. The resource in which to create the sink: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: |
sink | LogSink Required. The new sink, whose |
Type | Description |
LogSink |
createSink(ProjectName parent, LogSink sink)
public final LogSink createSink(ProjectName parent, LogSink sink)
Creates a sink that exports specified log entries to a destination. The export of
newly-ingested log entries begins immediately, unless the sink's writer_identity
is not
permitted to write to the destination. A sink can export log entries only from the resource
owning the sink.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
LogSink sink = LogSink.newBuilder().build();
LogSink response = configClient.createSink(parent, sink);
}
Name | Description |
parent | ProjectName Required. The resource in which to create the sink: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: |
sink | LogSink Required. The new sink, whose |
Type | Description |
LogSink |
createSink(String parent, LogSink sink)
public final LogSink createSink(String parent, LogSink sink)
Creates a sink that exports specified log entries to a destination. The export of
newly-ingested log entries begins immediately, unless the sink's writer_identity
is not
permitted to write to the destination. A sink can export log entries only from the resource
owning the sink.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
LogSink sink = LogSink.newBuilder().build();
LogSink response = configClient.createSink(parent, sink);
}
Name | Description |
parent | String Required. The resource in which to create the sink: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: |
sink | LogSink Required. The new sink, whose |
Type | Description |
LogSink |
createSinkCallable()
public final UnaryCallable<CreateSinkRequest,LogSink> createSinkCallable()
Creates a sink that exports specified log entries to a destination. The export of
newly-ingested log entries begins immediately, unless the sink's writer_identity
is not
permitted to write to the destination. A sink can export log entries only from the resource
owning the sink.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
CreateSinkRequest request =
CreateSinkRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setSink(LogSink.newBuilder().build())
.setUniqueWriterIdentity(true)
.build();
ApiFuture
Type | Description |
UnaryCallable<CreateSinkRequest,LogSink> |
createView(CreateViewRequest request)
public final LogView createView(CreateViewRequest request)
Creates a view over logs in a bucket. A bucket may contain a maximum of 50 views.
Sample code:
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);
}
Name | Description |
request | CreateViewRequest The request object containing all of the parameters for the API call. |
Type | Description |
LogView |
createViewCallable()
public final UnaryCallable<CreateViewRequest,LogView> createViewCallable()
Creates a view over logs in a bucket. A bucket may contain a maximum of 50 views.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
CreateViewRequest request =
CreateViewRequest.newBuilder()
.setParent("parent-995424086")
.setViewId("viewId-816632160")
.setView(LogView.newBuilder().build())
.build();
ApiFuture
Type | Description |
UnaryCallable<CreateViewRequest,LogView> |
deleteBucket(DeleteBucketRequest request)
public final void deleteBucket(DeleteBucketRequest request)
Deletes a bucket. Moves the bucket to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all logs in the bucket will be permanently deleted.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
DeleteBucketRequest request =
DeleteBucketRequest.newBuilder()
.setName(
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
.toString())
.build();
configClient.deleteBucket(request);
}
Name | Description |
request | DeleteBucketRequest The request object containing all of the parameters for the API call. |
deleteBucketCallable()
public final UnaryCallable<DeleteBucketRequest,Empty> deleteBucketCallable()
Deletes a bucket. Moves the bucket to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all logs in the bucket will be permanently deleted.
Sample code:
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();
}
Type | Description |
UnaryCallable<DeleteBucketRequest,Empty> |
deleteExclusion(DeleteExclusionRequest request)
public final void deleteExclusion(DeleteExclusionRequest request)
Deletes an exclusion.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
DeleteExclusionRequest request =
DeleteExclusionRequest.newBuilder()
.setName(
LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString())
.build();
configClient.deleteExclusion(request);
}
Name | Description |
request | DeleteExclusionRequest The request object containing all of the parameters for the API call. |
deleteExclusion(LogExclusionName name)
public final void deleteExclusion(LogExclusionName name)
Deletes an exclusion.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
configClient.deleteExclusion(name);
}
Name | Description |
name | LogExclusionName Required. The resource name of an existing exclusion to delete: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: |
deleteExclusion(String name)
public final void deleteExclusion(String name)
Deletes an exclusion.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
String name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString();
configClient.deleteExclusion(name);
}
Name | Description |
name | String Required. The resource name of an existing exclusion to delete: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: |
deleteExclusionCallable()
public final UnaryCallable<DeleteExclusionRequest,Empty> deleteExclusionCallable()
Deletes an exclusion.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
DeleteExclusionRequest request =
DeleteExclusionRequest.newBuilder()
.setName(
LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString())
.build();
ApiFuture<Empty> future = configClient.deleteExclusionCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
UnaryCallable<DeleteExclusionRequest,Empty> |
deleteSink(DeleteSinkRequest request)
public final void deleteSink(DeleteSinkRequest request)
Deletes a sink. If the sink has a unique writer_identity
, then that service account is also
deleted.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
DeleteSinkRequest request =
DeleteSinkRequest.newBuilder()
.setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString())
.build();
configClient.deleteSink(request);
}
Name | Description |
request | DeleteSinkRequest The request object containing all of the parameters for the API call. |
deleteSink(LogSinkName sinkName)
public final void deleteSink(LogSinkName sinkName)
Deletes a sink. If the sink has a unique writer_identity
, then that service account is also
deleted.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
configClient.deleteSink(sinkName);
}
Name | Description |
sinkName | LogSinkName Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: |
deleteSink(String sinkName)
public final void deleteSink(String sinkName)
Deletes a sink. If the sink has a unique writer_identity
, then that service account is also
deleted.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString();
configClient.deleteSink(sinkName);
}
Name | Description |
sinkName | String Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: |
deleteSinkCallable()
public final UnaryCallable<DeleteSinkRequest,Empty> deleteSinkCallable()
Deletes a sink. If the sink has a unique writer_identity
, then that service account is also
deleted.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
DeleteSinkRequest request =
DeleteSinkRequest.newBuilder()
.setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString())
.build();
ApiFuture<Empty> future = configClient.deleteSinkCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
UnaryCallable<DeleteSinkRequest,Empty> |
deleteView(DeleteViewRequest request)
public final void deleteView(DeleteViewRequest request)
Deletes a view from a bucket.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
DeleteViewRequest request =
DeleteViewRequest.newBuilder()
.setName(
LogViewName.ofProjectLocationBucketViewName(
"[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]")
.toString())
.build();
configClient.deleteView(request);
}
Name | Description |
request | DeleteViewRequest The request object containing all of the parameters for the API call. |
deleteViewCallable()
public final UnaryCallable<DeleteViewRequest,Empty> deleteViewCallable()
Deletes a view from a bucket.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
DeleteViewRequest request =
DeleteViewRequest.newBuilder()
.setName(
LogViewName.ofProjectLocationBucketViewName(
"[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]")
.toString())
.build();
ApiFuture<Empty> future = configClient.deleteViewCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
UnaryCallable<DeleteViewRequest,Empty> |
getBucket(GetBucketRequest request)
public final LogBucket getBucket(GetBucketRequest request)
Gets a bucket.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
GetBucketRequest request =
GetBucketRequest.newBuilder()
.setName(
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
.toString())
.build();
LogBucket response = configClient.getBucket(request);
}
Name | Description |
request | GetBucketRequest The request object containing all of the parameters for the API call. |
Type | Description |
LogBucket |
getBucketCallable()
public final UnaryCallable<GetBucketRequest,LogBucket> getBucketCallable()
Gets a bucket.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
GetBucketRequest request =
GetBucketRequest.newBuilder()
.setName(
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
.toString())
.build();
ApiFuture
Type | Description |
UnaryCallable<GetBucketRequest,LogBucket> |
getCmekSettings(GetCmekSettingsRequest request)
public final CmekSettings getCmekSettings(GetCmekSettingsRequest request)
Gets the Logs Router CMEK settings for the given resource.
Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.
See Enabling CMEK for Logs Router for more information.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
GetCmekSettingsRequest request =
GetCmekSettingsRequest.newBuilder()
.setName(CmekSettingsName.ofProjectName("[PROJECT]").toString())
.build();
CmekSettings response = configClient.getCmekSettings(request);
}
Name | Description |
request | GetCmekSettingsRequest The request object containing all of the parameters for the API call. |
Type | Description |
CmekSettings |
getCmekSettingsCallable()
public final UnaryCallable<GetCmekSettingsRequest,CmekSettings> getCmekSettingsCallable()
Gets the Logs Router CMEK settings for the given resource.
Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.
See Enabling CMEK for Logs Router for more information.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
GetCmekSettingsRequest request =
GetCmekSettingsRequest.newBuilder()
.setName(CmekSettingsName.ofProjectName("[PROJECT]").toString())
.build();
ApiFuture
Type | Description |
UnaryCallable<GetCmekSettingsRequest,CmekSettings> |
getExclusion(GetExclusionRequest request)
public final LogExclusion getExclusion(GetExclusionRequest request)
Gets the description of an exclusion.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
GetExclusionRequest request =
GetExclusionRequest.newBuilder()
.setName(
LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString())
.build();
LogExclusion response = configClient.getExclusion(request);
}
Name | Description |
request | GetExclusionRequest The request object containing all of the parameters for the API call. |
Type | Description |
LogExclusion |
getExclusion(LogExclusionName name)
public final LogExclusion getExclusion(LogExclusionName name)
Gets the description of an exclusion.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
LogExclusion response = configClient.getExclusion(name);
}
Name | Description |
name | LogExclusionName Required. The resource name of an existing exclusion: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: |
Type | Description |
LogExclusion |
getExclusion(String name)
public final LogExclusion getExclusion(String name)
Gets the description of an exclusion.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
String name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString();
LogExclusion response = configClient.getExclusion(name);
}
Name | Description |
name | String Required. The resource name of an existing exclusion: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: |
Type | Description |
LogExclusion |
getExclusionCallable()
public final UnaryCallable<GetExclusionRequest,LogExclusion> getExclusionCallable()
Gets the description of an exclusion.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
GetExclusionRequest request =
GetExclusionRequest.newBuilder()
.setName(
LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString())
.build();
ApiFuture
Type | Description |
UnaryCallable<GetExclusionRequest,LogExclusion> |
getSettings()
public final ConfigSettings getSettings()
Type | Description |
ConfigSettings |
getSink(GetSinkRequest request)
public final LogSink getSink(GetSinkRequest request)
Gets a sink.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
GetSinkRequest request =
GetSinkRequest.newBuilder()
.setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString())
.build();
LogSink response = configClient.getSink(request);
}
Name | Description |
request | GetSinkRequest The request object containing all of the parameters for the API call. |
Type | Description |
LogSink |
getSink(LogSinkName sinkName)
public final LogSink getSink(LogSinkName sinkName)
Gets a sink.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
LogSink response = configClient.getSink(sinkName);
}
Name | Description |
sinkName | LogSinkName Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: |
Type | Description |
LogSink |
getSink(String sinkName)
public final LogSink getSink(String sinkName)
Gets a sink.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString();
LogSink response = configClient.getSink(sinkName);
}
Name | Description |
sinkName | String Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: |
Type | Description |
LogSink |
getSinkCallable()
public final UnaryCallable<GetSinkRequest,LogSink> getSinkCallable()
Gets a sink.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
GetSinkRequest request =
GetSinkRequest.newBuilder()
.setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString())
.build();
ApiFuture
Type | Description |
UnaryCallable<GetSinkRequest,LogSink> |
getStub()
public ConfigServiceV2Stub getStub()
Type | Description |
ConfigServiceV2Stub |
getView(GetViewRequest request)
public final LogView getView(GetViewRequest request)
Gets a view.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
GetViewRequest request =
GetViewRequest.newBuilder()
.setName(
LogViewName.ofProjectLocationBucketViewName(
"[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]")
.toString())
.build();
LogView response = configClient.getView(request);
}
Name | Description |
request | GetViewRequest The request object containing all of the parameters for the API call. |
Type | Description |
LogView |
getViewCallable()
public final UnaryCallable<GetViewRequest,LogView> getViewCallable()
Gets a view.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
GetViewRequest request =
GetViewRequest.newBuilder()
.setName(
LogViewName.ofProjectLocationBucketViewName(
"[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]")
.toString())
.build();
ApiFuture
Type | Description |
UnaryCallable<GetViewRequest,LogView> |
isShutdown()
public boolean isShutdown()
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Type | Description |
boolean |
listBuckets(BillingAccountLocationName parent)
public final ConfigClient.ListBucketsPagedResponse listBuckets(BillingAccountLocationName parent)
Lists buckets.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
BillingAccountLocationName parent =
BillingAccountLocationName.of("[BILLING_ACCOUNT]", "[LOCATION]");
for (LogBucket element : configClient.listBuckets(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | BillingAccountLocationName Required. The parent resource whose buckets are to be listed: "projects/[PROJECT_ID]/locations/[LOCATION_ID]" "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations portion of the resource must be specified, but supplying the
character |
Type | Description |
ConfigClient.ListBucketsPagedResponse |
listBuckets(FolderLocationName parent)
public final ConfigClient.ListBucketsPagedResponse listBuckets(FolderLocationName parent)
Lists buckets.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
FolderLocationName parent = FolderLocationName.of("[FOLDER]", "[LOCATION]");
for (LogBucket element : configClient.listBuckets(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | FolderLocationName Required. The parent resource whose buckets are to be listed: "projects/[PROJECT_ID]/locations/[LOCATION_ID]" "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations portion of the resource must be specified, but supplying the
character |
Type | Description |
ConfigClient.ListBucketsPagedResponse |
listBuckets(ListBucketsRequest request)
public final ConfigClient.ListBucketsPagedResponse listBuckets(ListBucketsRequest request)
Lists buckets.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
ListBucketsRequest request =
ListBucketsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
for (LogBucket element : configClient.listBuckets(request).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
request | ListBucketsRequest The request object containing all of the parameters for the API call. |
Type | Description |
ConfigClient.ListBucketsPagedResponse |
listBuckets(LocationName parent)
public final ConfigClient.ListBucketsPagedResponse listBuckets(LocationName parent)
Lists buckets.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (LogBucket element : configClient.listBuckets(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | LocationName Required. The parent resource whose buckets are to be listed: "projects/[PROJECT_ID]/locations/[LOCATION_ID]" "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations portion of the resource must be specified, but supplying the
character |
Type | Description |
ConfigClient.ListBucketsPagedResponse |
listBuckets(OrganizationLocationName parent)
public final ConfigClient.ListBucketsPagedResponse listBuckets(OrganizationLocationName parent)
Lists buckets.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
for (LogBucket element : configClient.listBuckets(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | OrganizationLocationName Required. The parent resource whose buckets are to be listed: "projects/[PROJECT_ID]/locations/[LOCATION_ID]" "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations portion of the resource must be specified, but supplying the
character |
Type | Description |
ConfigClient.ListBucketsPagedResponse |
listBuckets(String parent)
public final ConfigClient.ListBucketsPagedResponse listBuckets(String parent)
Lists buckets.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (LogBucket element : configClient.listBuckets(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | String Required. The parent resource whose buckets are to be listed: "projects/[PROJECT_ID]/locations/[LOCATION_ID]" "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations portion of the resource must be specified, but supplying the
character |
Type | Description |
ConfigClient.ListBucketsPagedResponse |
listBucketsCallable()
public final UnaryCallable<ListBucketsRequest,ListBucketsResponse> listBucketsCallable()
Lists buckets.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
ListBucketsRequest request =
ListBucketsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
while (true) {
ListBucketsResponse response = configClient.listBucketsCallable().call(request);
for (LogBucket element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListBucketsRequest,ListBucketsResponse> |
listBucketsPagedCallable()
public final UnaryCallable<ListBucketsRequest,ConfigClient.ListBucketsPagedResponse> listBucketsPagedCallable()
Lists buckets.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
ListBucketsRequest request =
ListBucketsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture
Type | Description |
UnaryCallable<ListBucketsRequest,ListBucketsPagedResponse> |
listExclusions(BillingAccountName parent)
public final ConfigClient.ListExclusionsPagedResponse listExclusions(BillingAccountName parent)
Lists all the exclusions in a parent resource.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | BillingAccountName Required. The parent resource whose exclusions are to be listed. "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" |
Type | Description |
ConfigClient.ListExclusionsPagedResponse |
listExclusions(FolderName parent)
public final ConfigClient.ListExclusionsPagedResponse listExclusions(FolderName parent)
Lists all the exclusions in a parent resource.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
FolderName parent = FolderName.of("[FOLDER]");
for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | FolderName Required. The parent resource whose exclusions are to be listed. "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" |
Type | Description |
ConfigClient.ListExclusionsPagedResponse |
listExclusions(ListExclusionsRequest request)
public final ConfigClient.ListExclusionsPagedResponse listExclusions(ListExclusionsRequest request)
Lists all the exclusions in a parent resource.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
ListExclusionsRequest request =
ListExclusionsRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
for (LogExclusion element : configClient.listExclusions(request).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
request | ListExclusionsRequest The request object containing all of the parameters for the API call. |
Type | Description |
ConfigClient.ListExclusionsPagedResponse |
listExclusions(OrganizationName parent)
public final ConfigClient.ListExclusionsPagedResponse listExclusions(OrganizationName parent)
Lists all the exclusions in a parent resource.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | OrganizationName Required. The parent resource whose exclusions are to be listed. "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" |
Type | Description |
ConfigClient.ListExclusionsPagedResponse |
listExclusions(ProjectName parent)
public final ConfigClient.ListExclusionsPagedResponse listExclusions(ProjectName parent)
Lists all the exclusions in a parent resource.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | ProjectName Required. The parent resource whose exclusions are to be listed. "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" |
Type | Description |
ConfigClient.ListExclusionsPagedResponse |
listExclusions(String parent)
public final ConfigClient.ListExclusionsPagedResponse listExclusions(String parent)
Lists all the exclusions in a parent resource.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | String Required. The parent resource whose exclusions are to be listed. "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" |
Type | Description |
ConfigClient.ListExclusionsPagedResponse |
listExclusionsCallable()
public final UnaryCallable<ListExclusionsRequest,ListExclusionsResponse> listExclusionsCallable()
Lists all the exclusions in a parent resource.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
ListExclusionsRequest request =
ListExclusionsRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
while (true) {
ListExclusionsResponse response = configClient.listExclusionsCallable().call(request);
for (LogExclusion element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListExclusionsRequest,ListExclusionsResponse> |
listExclusionsPagedCallable()
public final UnaryCallable<ListExclusionsRequest,ConfigClient.ListExclusionsPagedResponse> listExclusionsPagedCallable()
Lists all the exclusions in a parent resource.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
ListExclusionsRequest request =
ListExclusionsRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture
Type | Description |
UnaryCallable<ListExclusionsRequest,ListExclusionsPagedResponse> |
listSinks(BillingAccountName parent)
public final ConfigClient.ListSinksPagedResponse listSinks(BillingAccountName parent)
Lists sinks.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
for (LogSink element : configClient.listSinks(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | BillingAccountName Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" |
Type | Description |
ConfigClient.ListSinksPagedResponse |
listSinks(FolderName parent)
public final ConfigClient.ListSinksPagedResponse listSinks(FolderName parent)
Lists sinks.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
FolderName parent = FolderName.of("[FOLDER]");
for (LogSink element : configClient.listSinks(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | FolderName Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" |
Type | Description |
ConfigClient.ListSinksPagedResponse |
listSinks(ListSinksRequest request)
public final ConfigClient.ListSinksPagedResponse listSinks(ListSinksRequest request)
Lists sinks.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
ListSinksRequest request =
ListSinksRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
for (LogSink element : configClient.listSinks(request).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
request | ListSinksRequest The request object containing all of the parameters for the API call. |
Type | Description |
ConfigClient.ListSinksPagedResponse |
listSinks(OrganizationName parent)
public final ConfigClient.ListSinksPagedResponse listSinks(OrganizationName parent)
Lists sinks.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
for (LogSink element : configClient.listSinks(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | OrganizationName Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" |
Type | Description |
ConfigClient.ListSinksPagedResponse |
listSinks(ProjectName parent)
public final ConfigClient.ListSinksPagedResponse listSinks(ProjectName parent)
Lists sinks.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
for (LogSink element : configClient.listSinks(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | ProjectName Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" |
Type | Description |
ConfigClient.ListSinksPagedResponse |
listSinks(String parent)
public final ConfigClient.ListSinksPagedResponse listSinks(String parent)
Lists sinks.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
for (LogSink element : configClient.listSinks(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | String Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" |
Type | Description |
ConfigClient.ListSinksPagedResponse |
listSinksCallable()
public final UnaryCallable<ListSinksRequest,ListSinksResponse> listSinksCallable()
Lists sinks.
Sample code:
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;
}
}
}
Type | Description |
UnaryCallable<ListSinksRequest,ListSinksResponse> |
listSinksPagedCallable()
public final UnaryCallable<ListSinksRequest,ConfigClient.ListSinksPagedResponse> listSinksPagedCallable()
Lists sinks.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
ListSinksRequest request =
ListSinksRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture
Type | Description |
UnaryCallable<ListSinksRequest,ListSinksPagedResponse> |
listViews(ListViewsRequest request)
public final ConfigClient.ListViewsPagedResponse listViews(ListViewsRequest request)
Lists views on a bucket.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
ListViewsRequest request =
ListViewsRequest.newBuilder()
.setParent("parent-995424086")
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
for (LogView element : configClient.listViews(request).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
request | ListViewsRequest The request object containing all of the parameters for the API call. |
Type | Description |
ConfigClient.ListViewsPagedResponse |
listViews(String parent)
public final ConfigClient.ListViewsPagedResponse listViews(String parent)
Lists views on a bucket.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
String parent = "parent-995424086";
for (LogView element : configClient.listViews(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | String Required. The bucket whose views are to be listed: "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" |
Type | Description |
ConfigClient.ListViewsPagedResponse |
listViewsCallable()
public final UnaryCallable<ListViewsRequest,ListViewsResponse> listViewsCallable()
Lists views on a bucket.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
ListViewsRequest request =
ListViewsRequest.newBuilder()
.setParent("parent-995424086")
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
while (true) {
ListViewsResponse response = configClient.listViewsCallable().call(request);
for (LogView element : response.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListViewsRequest,ListViewsResponse> |
listViewsPagedCallable()
public final UnaryCallable<ListViewsRequest,ConfigClient.ListViewsPagedResponse> listViewsPagedCallable()
Lists views on a bucket.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
ListViewsRequest request =
ListViewsRequest.newBuilder()
.setParent("parent-995424086")
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture
Type | Description |
UnaryCallable<ListViewsRequest,ListViewsPagedResponse> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()
undeleteBucket(UndeleteBucketRequest request)
public final void undeleteBucket(UndeleteBucketRequest request)
Undeletes a bucket. A bucket that has been deleted may be undeleted within the grace period of 7 days.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
UndeleteBucketRequest request =
UndeleteBucketRequest.newBuilder()
.setName(
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
.toString())
.build();
configClient.undeleteBucket(request);
}
Name | Description |
request | UndeleteBucketRequest The request object containing all of the parameters for the API call. |
undeleteBucketCallable()
public final UnaryCallable<UndeleteBucketRequest,Empty> undeleteBucketCallable()
Undeletes a bucket. A bucket that has been deleted may be undeleted within the grace period of 7 days.
Sample code:
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();
}
Type | Description |
UnaryCallable<UndeleteBucketRequest,Empty> |
updateBucket(UpdateBucketRequest request)
public final LogBucket updateBucket(UpdateBucketRequest request)
Updates a bucket. This method replaces the following fields in the existing bucket with values
from the new bucket: retention_period
If the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.
If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.
A buckets region may not be modified after it is created.
Sample code:
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);
}
Name | Description |
request | UpdateBucketRequest The request object containing all of the parameters for the API call. |
Type | Description |
LogBucket |
updateBucketCallable()
public final UnaryCallable<UpdateBucketRequest,LogBucket> updateBucketCallable()
Updates a bucket. This method replaces the following fields in the existing bucket with values
from the new bucket: retention_period
If the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be returned.
If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be returned.
A buckets region may not be modified after it is created.
Sample code:
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
Type | Description |
UnaryCallable<UpdateBucketRequest,LogBucket> |
updateCmekSettings(UpdateCmekSettingsRequest request)
public final CmekSettings updateCmekSettings(UpdateCmekSettingsRequest request)
Updates the Logs Router CMEK settings for the given resource.
Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.
UpdateCmekSettings will fail if 1)
kms_key_name
is invalid, or 2) the associated service account does not have the required
roles/cloudkms.cryptoKeyEncrypterDecrypter
role assigned for the key, or 3) access to the key
is disabled.
See Enabling CMEK for Logs Router for more information.
Sample code:
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);
}
Name | Description |
request | UpdateCmekSettingsRequest The request object containing all of the parameters for the API call. |
Type | Description |
CmekSettings |
updateCmekSettingsCallable()
public final UnaryCallable<UpdateCmekSettingsRequest,CmekSettings> updateCmekSettingsCallable()
Updates the Logs Router CMEK settings for the given resource.
Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once configured, it applies to all projects and folders in the GCP organization.
UpdateCmekSettings will fail if 1)
kms_key_name
is invalid, or 2) the associated service account does not have the required
roles/cloudkms.cryptoKeyEncrypterDecrypter
role assigned for the key, or 3) access to the key
is disabled.
See Enabling CMEK for Logs Router for more information.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
UpdateCmekSettingsRequest request =
UpdateCmekSettingsRequest.newBuilder()
.setName("name3373707")
.setCmekSettings(CmekSettings.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture
Type | Description |
UnaryCallable<UpdateCmekSettingsRequest,CmekSettings> |
updateExclusion(LogExclusionName name, LogExclusion exclusion, FieldMask updateMask)
public final LogExclusion updateExclusion(LogExclusionName name, LogExclusion exclusion, FieldMask updateMask)
Changes one or more properties of an existing exclusion.
Sample code:
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);
}
Name | Description |
name | LogExclusionName Required. The resource name of the exclusion to update: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: |
exclusion | LogExclusion Required. New values for the existing exclusion. Only the fields specified in
|
updateMask | FieldMask Required. A non-empty list of fields to change in the existing exclusion. New
values for the fields are taken from the corresponding fields in the
LogExclusion included in this request. Fields not
mentioned in For example, to change the filter and description of an exclusion, specify an
|
Type | Description |
LogExclusion |
updateExclusion(UpdateExclusionRequest request)
public final LogExclusion updateExclusion(UpdateExclusionRequest request)
Changes one or more properties of an existing exclusion.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
UpdateExclusionRequest request =
UpdateExclusionRequest.newBuilder()
.setName(
LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString())
.setExclusion(LogExclusion.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
LogExclusion response = configClient.updateExclusion(request);
}
Name | Description |
request | UpdateExclusionRequest The request object containing all of the parameters for the API call. |
Type | Description |
LogExclusion |
updateExclusion(String name, LogExclusion exclusion, FieldMask updateMask)
public final LogExclusion updateExclusion(String name, LogExclusion exclusion, FieldMask updateMask)
Changes one or more properties of an existing exclusion.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
String name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString();
LogExclusion exclusion = LogExclusion.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
LogExclusion response = configClient.updateExclusion(name, exclusion, updateMask);
}
Name | Description |
name | String Required. The resource name of the exclusion to update: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: |
exclusion | LogExclusion Required. New values for the existing exclusion. Only the fields specified in
|
updateMask | FieldMask Required. A non-empty list of fields to change in the existing exclusion. New
values for the fields are taken from the corresponding fields in the
LogExclusion included in this request. Fields not
mentioned in For example, to change the filter and description of an exclusion, specify an
|
Type | Description |
LogExclusion |
updateExclusionCallable()
public final UnaryCallable<UpdateExclusionRequest,LogExclusion> updateExclusionCallable()
Changes one or more properties of an existing exclusion.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
UpdateExclusionRequest request =
UpdateExclusionRequest.newBuilder()
.setName(
LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString())
.setExclusion(LogExclusion.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture
Type | Description |
UnaryCallable<UpdateExclusionRequest,LogExclusion> |
updateSink(LogSinkName sinkName, LogSink sink)
public final LogSink updateSink(LogSinkName sinkName, LogSink sink)
Updates a sink. This method replaces the following fields in the existing sink with values from
the new sink: destination
, and filter
.
The updated sink might also have a new writer_identity
; see the unique_writer_identity
field.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
LogSink sink = LogSink.newBuilder().build();
LogSink response = configClient.updateSink(sinkName, sink);
}
Name | Description |
sinkName | LogSinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: |
sink | LogSink Required. The updated sink, whose name is the same identifier that appears as part
of |
Type | Description |
LogSink |
updateSink(LogSinkName sinkName, LogSink sink, FieldMask updateMask)
public final LogSink updateSink(LogSinkName sinkName, LogSink sink, FieldMask updateMask)
Updates a sink. This method replaces the following fields in the existing sink with values from
the new sink: destination
, and filter
.
The updated sink might also have a new writer_identity
; see the unique_writer_identity
field.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
LogSink sink = LogSink.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
LogSink response = configClient.updateSink(sinkName, sink, updateMask);
}
Name | Description |
sinkName | LogSinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: |
sink | LogSink Required. The updated sink, whose name is the same identifier that appears as part
of |
updateMask | FieldMask Optional. Field mask that specifies the fields in An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error. For a detailed Example: |
Type | Description |
LogSink |
updateSink(UpdateSinkRequest request)
public final LogSink updateSink(UpdateSinkRequest request)
Updates a sink. This method replaces the following fields in the existing sink with values from
the new sink: destination
, and filter
.
The updated sink might also have a new writer_identity
; see the unique_writer_identity
field.
Sample code:
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();
LogSink response = configClient.updateSink(request);
}
Name | Description |
request | UpdateSinkRequest The request object containing all of the parameters for the API call. |
Type | Description |
LogSink |
updateSink(String sinkName, LogSink sink)
public final LogSink updateSink(String sinkName, LogSink sink)
Updates a sink. This method replaces the following fields in the existing sink with values from
the new sink: destination
, and filter
.
The updated sink might also have a new writer_identity
; see the unique_writer_identity
field.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString();
LogSink sink = LogSink.newBuilder().build();
LogSink response = configClient.updateSink(sinkName, sink);
}
Name | Description |
sinkName | String Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: |
sink | LogSink Required. The updated sink, whose name is the same identifier that appears as part
of |
Type | Description |
LogSink |
updateSink(String sinkName, LogSink sink, FieldMask updateMask)
public final LogSink updateSink(String sinkName, LogSink sink, FieldMask updateMask)
Updates a sink. This method replaces the following fields in the existing sink with values from
the new sink: destination
, and filter
.
The updated sink might also have a new writer_identity
; see the unique_writer_identity
field.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString();
LogSink sink = LogSink.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
LogSink response = configClient.updateSink(sinkName, sink, updateMask);
}
Name | Description |
sinkName | String Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: |
sink | LogSink Required. The updated sink, whose name is the same identifier that appears as part
of |
updateMask | FieldMask Optional. Field mask that specifies the fields in An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error. For a detailed Example: |
Type | Description |
LogSink |
updateSinkCallable()
public final UnaryCallable<UpdateSinkRequest,LogSink> updateSinkCallable()
Updates a sink. This method replaces the following fields in the existing sink with values from
the new sink: destination
, and filter
.
The updated sink might also have a new writer_identity
; see the unique_writer_identity
field.
Sample code:
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
Type | Description |
UnaryCallable<UpdateSinkRequest,LogSink> |
updateView(UpdateViewRequest request)
public final LogView updateView(UpdateViewRequest request)
Updates a view. This method replaces the following fields in the existing view with values from
the new view: filter
.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
UpdateViewRequest request =
UpdateViewRequest.newBuilder()
.setName("name3373707")
.setView(LogView.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
LogView response = configClient.updateView(request);
}
Name | Description |
request | UpdateViewRequest The request object containing all of the parameters for the API call. |
Type | Description |
LogView |
updateViewCallable()
public final UnaryCallable<UpdateViewRequest,LogView> updateViewCallable()
Updates a view. This method replaces the following fields in the existing view with values from
the new view: filter
.
Sample code:
try (ConfigClient configClient = ConfigClient.create()) {
UpdateViewRequest request =
UpdateViewRequest.newBuilder()
.setName("name3373707")
.setView(LogView.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture
Type | Description |
UnaryCallable<UpdateViewRequest,LogView> |