@Generated(value="by gapic-generator-java") public class ConfigClient extends Object implements com.google.api.gax.core.BackgroundResource
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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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:
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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
ConfigSettings configSettings =
ConfigSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ConfigClient configClient = ConfigClient.create(configSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
ConfigClient.ListBucketsFixedSizeCollection |
static class |
ConfigClient.ListBucketsPage |
static class |
ConfigClient.ListBucketsPagedResponse |
static class |
ConfigClient.ListExclusionsFixedSizeCollection |
static class |
ConfigClient.ListExclusionsPage |
static class |
ConfigClient.ListExclusionsPagedResponse |
static class |
ConfigClient.ListLinksFixedSizeCollection |
static class |
ConfigClient.ListLinksPage |
static class |
ConfigClient.ListLinksPagedResponse |
static class |
ConfigClient.ListSinksFixedSizeCollection |
static class |
ConfigClient.ListSinksPage |
static class |
ConfigClient.ListSinksPagedResponse |
static class |
ConfigClient.ListViewsFixedSizeCollection |
static class |
ConfigClient.ListViewsPage |
static class |
ConfigClient.ListViewsPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
ConfigClient(ConfigServiceV2Stub stub) |
protected |
ConfigClient(ConfigSettings settings)
Constructs an instance of ConfigClient, using the given settings.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
com.google.api.gax.longrunning.OperationFuture<CopyLogEntriesResponse,CopyLogEntriesMetadata> |
copyLogEntriesAsync(CopyLogEntriesRequest request)
Copies a set of log entries from a log bucket to a Cloud Storage bucket.
|
com.google.api.gax.rpc.UnaryCallable<CopyLogEntriesRequest,com.google.longrunning.Operation> |
copyLogEntriesCallable()
Copies a set of log entries from a log bucket to a Cloud Storage bucket.
|
com.google.api.gax.rpc.OperationCallable<CopyLogEntriesRequest,CopyLogEntriesResponse,CopyLogEntriesMetadata> |
copyLogEntriesOperationCallable()
Copies a set of log entries from a log bucket to a Cloud Storage bucket.
|
static ConfigClient |
create()
Constructs an instance of ConfigClient with default settings.
|
static ConfigClient |
create(ConfigServiceV2Stub stub)
Constructs an instance of ConfigClient, using the given stub for making calls.
|
static ConfigClient |
create(ConfigSettings settings)
Constructs an instance of ConfigClient, using the given settings.
|
LogBucket |
createBucket(CreateBucketRequest request)
Creates a log bucket that can be used to store log entries.
|
com.google.api.gax.longrunning.OperationFuture<LogBucket,BucketMetadata> |
createBucketAsyncAsync(CreateBucketRequest request)
Creates a log bucket asynchronously that can be used to store log entries.
|
com.google.api.gax.rpc.UnaryCallable<CreateBucketRequest,com.google.longrunning.Operation> |
createBucketAsyncCallable()
Creates a log bucket asynchronously that can be used to store log entries.
|
com.google.api.gax.rpc.OperationCallable<CreateBucketRequest,LogBucket,BucketMetadata> |
createBucketAsyncOperationCallable()
Creates a log bucket asynchronously that can be used to store log entries.
|
com.google.api.gax.rpc.UnaryCallable<CreateBucketRequest,LogBucket> |
createBucketCallable()
Creates a log bucket that can be used to store log entries.
|
LogExclusion |
createExclusion(BillingAccountName parent,
LogExclusion exclusion)
Creates a new exclusion in the _Default sink in a specified parent resource.
|
LogExclusion |
createExclusion(CreateExclusionRequest request)
Creates a new exclusion in the _Default sink in a specified parent resource.
|
LogExclusion |
createExclusion(FolderName parent,
LogExclusion exclusion)
Creates a new exclusion in the _Default sink in a specified parent resource.
|
LogExclusion |
createExclusion(OrganizationName parent,
LogExclusion exclusion)
Creates a new exclusion in the _Default sink in a specified parent resource.
|
LogExclusion |
createExclusion(ProjectName parent,
LogExclusion exclusion)
Creates a new exclusion in the _Default sink in a specified parent resource.
|
LogExclusion |
createExclusion(String parent,
LogExclusion exclusion)
Creates a new exclusion in the _Default sink in a specified parent resource.
|
com.google.api.gax.rpc.UnaryCallable<CreateExclusionRequest,LogExclusion> |
createExclusionCallable()
Creates a new exclusion in the _Default sink in a specified parent resource.
|
com.google.api.gax.longrunning.OperationFuture<Link,LinkMetadata> |
createLinkAsync(CreateLinkRequest request)
Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to
read the logs stored in the log bucket.
|
com.google.api.gax.longrunning.OperationFuture<Link,LinkMetadata> |
createLinkAsync(LogBucketName parent,
Link link,
String linkId)
Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to
read the logs stored in the log bucket.
|
com.google.api.gax.longrunning.OperationFuture<Link,LinkMetadata> |
createLinkAsync(String parent,
Link link,
String linkId)
Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to
read the logs stored in the log bucket.
|
com.google.api.gax.rpc.UnaryCallable<CreateLinkRequest,com.google.longrunning.Operation> |
createLinkCallable()
Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to
read the logs stored in the log bucket.
|
com.google.api.gax.rpc.OperationCallable<CreateLinkRequest,Link,LinkMetadata> |
createLinkOperationCallable()
Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to
read the logs stored in the log bucket.
|
LogSink |
createSink(BillingAccountName parent,
LogSink sink)
Creates a sink that exports specified log entries to a destination.
|
LogSink |
createSink(CreateSinkRequest request)
Creates a sink that exports specified log entries to a destination.
|
LogSink |
createSink(FolderName parent,
LogSink sink)
Creates a sink that exports specified log entries to a destination.
|
LogSink |
createSink(OrganizationName parent,
LogSink sink)
Creates a sink that exports specified log entries to a destination.
|
LogSink |
createSink(ProjectName parent,
LogSink sink)
Creates a sink that exports specified log entries to a destination.
|
LogSink |
createSink(String parent,
LogSink sink)
Creates a sink that exports specified log entries to a destination.
|
com.google.api.gax.rpc.UnaryCallable<CreateSinkRequest,LogSink> |
createSinkCallable()
Creates a sink that exports specified log entries to a destination.
|
LogView |
createView(CreateViewRequest request)
Creates a view over log entries in a log bucket.
|
com.google.api.gax.rpc.UnaryCallable<CreateViewRequest,LogView> |
createViewCallable()
Creates a view over log entries in a log bucket.
|
void |
deleteBucket(DeleteBucketRequest request)
Deletes a log bucket.
|
com.google.api.gax.rpc.UnaryCallable<DeleteBucketRequest,com.google.protobuf.Empty> |
deleteBucketCallable()
Deletes a log bucket.
|
void |
deleteExclusion(DeleteExclusionRequest request)
Deletes an exclusion in the _Default sink.
|
void |
deleteExclusion(LogExclusionName name)
Deletes an exclusion in the _Default sink.
|
void |
deleteExclusion(String name)
Deletes an exclusion in the _Default sink.
|
com.google.api.gax.rpc.UnaryCallable<DeleteExclusionRequest,com.google.protobuf.Empty> |
deleteExclusionCallable()
Deletes an exclusion in the _Default sink.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,LinkMetadata> |
deleteLinkAsync(DeleteLinkRequest request)
Deletes a link.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,LinkMetadata> |
deleteLinkAsync(LinkName name)
Deletes a link.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,LinkMetadata> |
deleteLinkAsync(String name)
Deletes a link.
|
com.google.api.gax.rpc.UnaryCallable<DeleteLinkRequest,com.google.longrunning.Operation> |
deleteLinkCallable()
Deletes a link.
|
com.google.api.gax.rpc.OperationCallable<DeleteLinkRequest,com.google.protobuf.Empty,LinkMetadata> |
deleteLinkOperationCallable()
Deletes a link.
|
void |
deleteSink(DeleteSinkRequest request)
Deletes a sink.
|
void |
deleteSink(LogSinkName sinkName)
Deletes a sink.
|
void |
deleteSink(String sinkName)
Deletes a sink.
|
com.google.api.gax.rpc.UnaryCallable<DeleteSinkRequest,com.google.protobuf.Empty> |
deleteSinkCallable()
Deletes a sink.
|
void |
deleteView(DeleteViewRequest request)
Deletes a view on a log bucket.
|
com.google.api.gax.rpc.UnaryCallable<DeleteViewRequest,com.google.protobuf.Empty> |
deleteViewCallable()
Deletes a view on a log bucket.
|
LogBucket |
getBucket(GetBucketRequest request)
Gets a log bucket.
|
com.google.api.gax.rpc.UnaryCallable<GetBucketRequest,LogBucket> |
getBucketCallable()
Gets a log bucket.
|
CmekSettings |
getCmekSettings(GetCmekSettingsRequest request)
Gets the Logging CMEK settings for the given resource.
|
com.google.api.gax.rpc.UnaryCallable<GetCmekSettingsRequest,CmekSettings> |
getCmekSettingsCallable()
Gets the Logging CMEK settings for the given resource.
|
LogExclusion |
getExclusion(GetExclusionRequest request)
Gets the description of an exclusion in the _Default sink.
|
LogExclusion |
getExclusion(LogExclusionName name)
Gets the description of an exclusion in the _Default sink.
|
LogExclusion |
getExclusion(String name)
Gets the description of an exclusion in the _Default sink.
|
com.google.api.gax.rpc.UnaryCallable<GetExclusionRequest,LogExclusion> |
getExclusionCallable()
Gets the description of an exclusion in the _Default sink.
|
Link |
getLink(GetLinkRequest request)
Gets a link.
|
Link |
getLink(LinkName name)
Gets a link.
|
Link |
getLink(String name)
Gets a link.
|
com.google.api.gax.rpc.UnaryCallable<GetLinkRequest,Link> |
getLinkCallable()
Gets a link.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
ConfigSettings |
getSettings() |
Settings |
getSettings(GetSettingsRequest request)
Gets the Log Router settings for the given resource.
|
Settings |
getSettings(SettingsName name)
Gets the Log Router settings for the given resource.
|
Settings |
getSettings(String name)
Gets the Log Router settings for the given resource.
|
com.google.api.gax.rpc.UnaryCallable<GetSettingsRequest,Settings> |
getSettingsCallable()
Gets the Log Router settings for the given resource.
|
LogSink |
getSink(GetSinkRequest request)
Gets a sink.
|
LogSink |
getSink(LogSinkName sinkName)
Gets a sink.
|
LogSink |
getSink(String sinkName)
Gets a sink.
|
com.google.api.gax.rpc.UnaryCallable<GetSinkRequest,LogSink> |
getSinkCallable()
Gets a sink.
|
ConfigServiceV2Stub |
getStub() |
LogView |
getView(GetViewRequest request)
Gets a view on a log bucket..
|
com.google.api.gax.rpc.UnaryCallable<GetViewRequest,LogView> |
getViewCallable()
Gets a view on a log bucket..
|
boolean |
isShutdown() |
boolean |
isTerminated() |
ConfigClient.ListBucketsPagedResponse |
listBuckets(BillingAccountLocationName parent)
Lists log buckets.
|
ConfigClient.ListBucketsPagedResponse |
listBuckets(FolderLocationName parent)
Lists log buckets.
|
ConfigClient.ListBucketsPagedResponse |
listBuckets(ListBucketsRequest request)
Lists log buckets.
|
ConfigClient.ListBucketsPagedResponse |
listBuckets(LocationName parent)
Lists log buckets.
|
ConfigClient.ListBucketsPagedResponse |
listBuckets(OrganizationLocationName parent)
Lists log buckets.
|
ConfigClient.ListBucketsPagedResponse |
listBuckets(String parent)
Lists log buckets.
|
com.google.api.gax.rpc.UnaryCallable<ListBucketsRequest,ListBucketsResponse> |
listBucketsCallable()
Lists log buckets.
|
com.google.api.gax.rpc.UnaryCallable<ListBucketsRequest,ConfigClient.ListBucketsPagedResponse> |
listBucketsPagedCallable()
Lists log buckets.
|
ConfigClient.ListExclusionsPagedResponse |
listExclusions(BillingAccountName parent)
Lists all the exclusions on the _Default sink in a parent resource.
|
ConfigClient.ListExclusionsPagedResponse |
listExclusions(FolderName parent)
Lists all the exclusions on the _Default sink in a parent resource.
|
ConfigClient.ListExclusionsPagedResponse |
listExclusions(ListExclusionsRequest request)
Lists all the exclusions on the _Default sink in a parent resource.
|
ConfigClient.ListExclusionsPagedResponse |
listExclusions(OrganizationName parent)
Lists all the exclusions on the _Default sink in a parent resource.
|
ConfigClient.ListExclusionsPagedResponse |
listExclusions(ProjectName parent)
Lists all the exclusions on the _Default sink in a parent resource.
|
ConfigClient.ListExclusionsPagedResponse |
listExclusions(String parent)
Lists all the exclusions on the _Default sink in a parent resource.
|
com.google.api.gax.rpc.UnaryCallable<ListExclusionsRequest,ListExclusionsResponse> |
listExclusionsCallable()
Lists all the exclusions on the _Default sink in a parent resource.
|
com.google.api.gax.rpc.UnaryCallable<ListExclusionsRequest,ConfigClient.ListExclusionsPagedResponse> |
listExclusionsPagedCallable()
Lists all the exclusions on the _Default sink in a parent resource.
|
ConfigClient.ListLinksPagedResponse |
listLinks(ListLinksRequest request)
Lists links.
|
ConfigClient.ListLinksPagedResponse |
listLinks(LogBucketName parent)
Lists links.
|
ConfigClient.ListLinksPagedResponse |
listLinks(String parent)
Lists links.
|
com.google.api.gax.rpc.UnaryCallable<ListLinksRequest,ListLinksResponse> |
listLinksCallable()
Lists links.
|
com.google.api.gax.rpc.UnaryCallable<ListLinksRequest,ConfigClient.ListLinksPagedResponse> |
listLinksPagedCallable()
Lists links.
|
ConfigClient.ListSinksPagedResponse |
listSinks(BillingAccountName parent)
Lists sinks.
|
ConfigClient.ListSinksPagedResponse |
listSinks(FolderName parent)
Lists sinks.
|
ConfigClient.ListSinksPagedResponse |
listSinks(ListSinksRequest request)
Lists sinks.
|
ConfigClient.ListSinksPagedResponse |
listSinks(OrganizationName parent)
Lists sinks.
|
ConfigClient.ListSinksPagedResponse |
listSinks(ProjectName parent)
Lists sinks.
|
ConfigClient.ListSinksPagedResponse |
listSinks(String parent)
Lists sinks.
|
com.google.api.gax.rpc.UnaryCallable<ListSinksRequest,ListSinksResponse> |
listSinksCallable()
Lists sinks.
|
com.google.api.gax.rpc.UnaryCallable<ListSinksRequest,ConfigClient.ListSinksPagedResponse> |
listSinksPagedCallable()
Lists sinks.
|
ConfigClient.ListViewsPagedResponse |
listViews(ListViewsRequest request)
Lists views on a log bucket.
|
ConfigClient.ListViewsPagedResponse |
listViews(String parent)
Lists views on a log bucket.
|
com.google.api.gax.rpc.UnaryCallable<ListViewsRequest,ListViewsResponse> |
listViewsCallable()
Lists views on a log bucket.
|
com.google.api.gax.rpc.UnaryCallable<ListViewsRequest,ConfigClient.ListViewsPagedResponse> |
listViewsPagedCallable()
Lists views on a log bucket.
|
void |
shutdown() |
void |
shutdownNow() |
void |
undeleteBucket(UndeleteBucketRequest request)
Undeletes a log bucket.
|
com.google.api.gax.rpc.UnaryCallable<UndeleteBucketRequest,com.google.protobuf.Empty> |
undeleteBucketCallable()
Undeletes a log bucket.
|
LogBucket |
updateBucket(UpdateBucketRequest request)
Updates a log bucket.
|
com.google.api.gax.longrunning.OperationFuture<LogBucket,BucketMetadata> |
updateBucketAsyncAsync(UpdateBucketRequest request)
Updates a log bucket asynchronously.
|
com.google.api.gax.rpc.UnaryCallable<UpdateBucketRequest,com.google.longrunning.Operation> |
updateBucketAsyncCallable()
Updates a log bucket asynchronously.
|
com.google.api.gax.rpc.OperationCallable<UpdateBucketRequest,LogBucket,BucketMetadata> |
updateBucketAsyncOperationCallable()
Updates a log bucket asynchronously.
|
com.google.api.gax.rpc.UnaryCallable<UpdateBucketRequest,LogBucket> |
updateBucketCallable()
Updates a log bucket.
|
CmekSettings |
updateCmekSettings(UpdateCmekSettingsRequest request)
Updates the Log Router CMEK settings for the given resource.
|
com.google.api.gax.rpc.UnaryCallable<UpdateCmekSettingsRequest,CmekSettings> |
updateCmekSettingsCallable()
Updates the Log Router CMEK settings for the given resource.
|
LogExclusion |
updateExclusion(LogExclusionName name,
LogExclusion exclusion,
com.google.protobuf.FieldMask updateMask)
Changes one or more properties of an existing exclusion in the _Default sink.
|
LogExclusion |
updateExclusion(String name,
LogExclusion exclusion,
com.google.protobuf.FieldMask updateMask)
Changes one or more properties of an existing exclusion in the _Default sink.
|
LogExclusion |
updateExclusion(UpdateExclusionRequest request)
Changes one or more properties of an existing exclusion in the _Default sink.
|
com.google.api.gax.rpc.UnaryCallable<UpdateExclusionRequest,LogExclusion> |
updateExclusionCallable()
Changes one or more properties of an existing exclusion in the _Default sink.
|
Settings |
updateSettings(Settings settings,
com.google.protobuf.FieldMask updateMask)
Updates the Log Router settings for the given resource.
|
Settings |
updateSettings(UpdateSettingsRequest request)
Updates the Log Router settings for the given resource.
|
com.google.api.gax.rpc.UnaryCallable<UpdateSettingsRequest,Settings> |
updateSettingsCallable()
Updates the Log Router settings for the given resource.
|
LogSink |
updateSink(LogSinkName sinkName,
LogSink sink)
Updates a sink.
|
LogSink |
updateSink(LogSinkName sinkName,
LogSink sink,
com.google.protobuf.FieldMask updateMask)
Updates a sink.
|
LogSink |
updateSink(String sinkName,
LogSink sink)
Updates a sink.
|
LogSink |
updateSink(String sinkName,
LogSink sink,
com.google.protobuf.FieldMask updateMask)
Updates a sink.
|
LogSink |
updateSink(UpdateSinkRequest request)
Updates a sink.
|
com.google.api.gax.rpc.UnaryCallable<UpdateSinkRequest,LogSink> |
updateSinkCallable()
Updates a sink.
|
LogView |
updateView(UpdateViewRequest request)
Updates a view on a log bucket.
|
com.google.api.gax.rpc.UnaryCallable<UpdateViewRequest,LogView> |
updateViewCallable()
Updates a view on a log bucket.
|
protected ConfigClient(ConfigSettings settings) throws IOException
IOExceptionprotected ConfigClient(ConfigServiceV2Stub stub)
public static final ConfigClient create() throws IOException
IOExceptionpublic static final ConfigClient create(ConfigSettings settings) throws IOException
IOExceptionpublic static final ConfigClient create(ConfigServiceV2Stub stub)
public final ConfigSettings getSettings()
public ConfigServiceV2Stub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
public final ConfigClient.ListBucketsPagedResponse listBuckets(BillingAccountLocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
BillingAccountLocationName parent =
BillingAccountLocationName.of("[BILLING_ACCOUNT]", "[LOCATION]");
for (LogBucket element : configClient.listBuckets(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - 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 `-` in place of [LOCATION_ID] will return all buckets.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConfigClient.ListBucketsPagedResponse listBuckets(FolderLocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
FolderLocationName parent = FolderLocationName.of("[FOLDER]", "[LOCATION]");
for (LogBucket element : configClient.listBuckets(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - 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 `-` in place of [LOCATION_ID] will return all buckets.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConfigClient.ListBucketsPagedResponse listBuckets(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (LogBucket element : configClient.listBuckets(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - 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 `-` in place of [LOCATION_ID] will return all buckets.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConfigClient.ListBucketsPagedResponse listBuckets(OrganizationLocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
for (LogBucket element : configClient.listBuckets(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - 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 `-` in place of [LOCATION_ID] will return all buckets.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConfigClient.ListBucketsPagedResponse listBuckets(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (LogBucket element : configClient.listBuckets(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - 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 `-` in place of [LOCATION_ID] will return all buckets.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConfigClient.ListBucketsPagedResponse listBuckets(ListBucketsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListBucketsRequest,ConfigClient.ListBucketsPagedResponse> listBucketsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListBucketsRequest,ListBucketsResponse> listBucketsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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.getBucketsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final LogBucket getBucket(GetBucketRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
GetBucketRequest request =
GetBucketRequest.newBuilder()
.setName(
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
.toString())
.build();
LogBucket response = configClient.getBucket(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetBucketRequest,LogBucket> getBucketCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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();
}
public final com.google.api.gax.longrunning.OperationFuture<LogBucket,BucketMetadata> createBucketAsyncAsync(CreateBucketRequest request)
After a bucket has been created, the bucket's location cannot be changed.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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.createBucketAsyncAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateBucketRequest,LogBucket,BucketMetadata> createBucketAsyncOperationCallable()
After a bucket has been created, the bucket's location cannot be changed.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
CreateBucketRequest request =
CreateBucketRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setBucketId("bucketId-1603305307")
.setBucket(LogBucket.newBuilder().build())
.build();
OperationFuture<LogBucket, BucketMetadata> future =
configClient.createBucketAsyncOperationCallable().futureCall(request);
// Do something.
LogBucket response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateBucketRequest,com.google.longrunning.Operation> createBucketAsyncCallable()
After a bucket has been created, the bucket's location cannot be changed.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
CreateBucketRequest request =
CreateBucketRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setBucketId("bucketId-1603305307")
.setBucket(LogBucket.newBuilder().build())
.build();
ApiFuture<Operation> future = configClient.createBucketAsyncCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<LogBucket,BucketMetadata> updateBucketAsyncAsync(UpdateBucketRequest request)
If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will be returned.
After a bucket has been created, the bucket's location cannot be changed.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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.updateBucketAsyncAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateBucketRequest,LogBucket,BucketMetadata> updateBucketAsyncOperationCallable()
If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will be returned.
After a bucket has been created, the bucket's location cannot be changed.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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();
OperationFuture<LogBucket, BucketMetadata> future =
configClient.updateBucketAsyncOperationCallable().futureCall(request);
// Do something.
LogBucket response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateBucketRequest,com.google.longrunning.Operation> updateBucketAsyncCallable()
If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will be returned.
After a bucket has been created, the bucket's location cannot be changed.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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<Operation> future = configClient.updateBucketAsyncCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final LogBucket createBucket(CreateBucketRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateBucketRequest,LogBucket> createBucketCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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();
}
public final LogBucket updateBucket(UpdateBucketRequest request)
If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will be returned.
After a bucket has been created, the bucket's location cannot be changed.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateBucketRequest,LogBucket> updateBucketCallable()
If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will be returned.
After a bucket has been created, the bucket's location cannot be changed.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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();
}
public final void deleteBucket(DeleteBucketRequest request)
Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
DeleteBucketRequest request =
DeleteBucketRequest.newBuilder()
.setName(
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
.toString())
.build();
configClient.deleteBucket(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteBucketRequest,com.google.protobuf.Empty> deleteBucketCallable()
Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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();
}
public final void undeleteBucket(UndeleteBucketRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
UndeleteBucketRequest request =
UndeleteBucketRequest.newBuilder()
.setName(
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
.toString())
.build();
configClient.undeleteBucket(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UndeleteBucketRequest,com.google.protobuf.Empty> undeleteBucketCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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();
}
public final ConfigClient.ListViewsPagedResponse listViews(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
String parent = "parent-995424086";
for (LogView element : configClient.listViews(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The bucket whose views are to be listed:
"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConfigClient.ListViewsPagedResponse listViews(ListViewsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListViewsRequest,ConfigClient.ListViewsPagedResponse> listViewsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
ListViewsRequest request =
ListViewsRequest.newBuilder()
.setParent("parent-995424086")
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture<LogView> future = configClient.listViewsPagedCallable().futureCall(request);
// Do something.
for (LogView element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListViewsRequest,ListViewsResponse> listViewsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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.getViewsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final LogView getView(GetViewRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
GetViewRequest request =
GetViewRequest.newBuilder()
.setName(
LogViewName.ofProjectLocationBucketViewName(
"[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]")
.toString())
.build();
LogView response = configClient.getView(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetViewRequest,LogView> getViewCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
GetViewRequest request =
GetViewRequest.newBuilder()
.setName(
LogViewName.ofProjectLocationBucketViewName(
"[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]")
.toString())
.build();
ApiFuture<LogView> future = configClient.getViewCallable().futureCall(request);
// Do something.
LogView response = future.get();
}
public final LogView createView(CreateViewRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateViewRequest,LogView> createViewCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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();
}
public final LogView updateView(UpdateViewRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateViewRequest,LogView> updateViewCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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();
}
public final void deleteView(DeleteViewRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
DeleteViewRequest request =
DeleteViewRequest.newBuilder()
.setName(
LogViewName.ofProjectLocationBucketViewName(
"[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]")
.toString())
.build();
configClient.deleteView(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteViewRequest,com.google.protobuf.Empty> deleteViewCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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();
}
public final ConfigClient.ListSinksPagedResponse listSinks(BillingAccountName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
for (LogSink element : configClient.listSinks(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent resource whose sinks are to be listed:
"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConfigClient.ListSinksPagedResponse listSinks(FolderName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
FolderName parent = FolderName.of("[FOLDER]");
for (LogSink element : configClient.listSinks(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent resource whose sinks are to be listed:
"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConfigClient.ListSinksPagedResponse listSinks(OrganizationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
for (LogSink element : configClient.listSinks(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent resource whose sinks are to be listed:
"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConfigClient.ListSinksPagedResponse listSinks(ProjectName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
for (LogSink element : configClient.listSinks(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent resource whose sinks are to be listed:
"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConfigClient.ListSinksPagedResponse listSinks(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
for (LogSink element : configClient.listSinks(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent resource whose sinks are to be listed:
"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConfigClient.ListSinksPagedResponse listSinks(ListSinksRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListSinksRequest,ConfigClient.ListSinksPagedResponse> listSinksPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListSinksRequest,ListSinksResponse> listSinksCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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.getSinksList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final LogSink getSink(LogSinkName sinkName)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
LogSink response = configClient.getSink(sinkName);
}
sinkName - 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]"
For example:
`"projects/my-project/sinks/my-sink"`
com.google.api.gax.rpc.ApiException - if the remote call failspublic final LogSink getSink(String sinkName)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString();
LogSink response = configClient.getSink(sinkName);
}
sinkName - 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]"
For example:
`"projects/my-project/sinks/my-sink"`
com.google.api.gax.rpc.ApiException - if the remote call failspublic final LogSink getSink(GetSinkRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
GetSinkRequest request =
GetSinkRequest.newBuilder()
.setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString())
.build();
LogSink response = configClient.getSink(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetSinkRequest,LogSink> getSinkCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
GetSinkRequest request =
GetSinkRequest.newBuilder()
.setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString())
.build();
ApiFuture<LogSink> future = configClient.getSinkCallable().futureCall(request);
// Do something.
LogSink response = future.get();
}
public final LogSink createSink(BillingAccountName parent, LogSink sink)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
LogSink sink = LogSink.newBuilder().build();
LogSink response = configClient.createSink(parent, sink);
}
parent - Required. The resource in which to create the sink:
"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
For examples:
`"projects/my-project"` `"organizations/123456789"`
sink - Required. The new sink, whose `name` parameter is a sink identifier that is not
already in use.com.google.api.gax.rpc.ApiException - if the remote call failspublic final LogSink createSink(FolderName parent, LogSink sink)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
FolderName parent = FolderName.of("[FOLDER]");
LogSink sink = LogSink.newBuilder().build();
LogSink response = configClient.createSink(parent, sink);
}
parent - Required. The resource in which to create the sink:
"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
For examples:
`"projects/my-project"` `"organizations/123456789"`
sink - Required. The new sink, whose `name` parameter is a sink identifier that is not
already in use.com.google.api.gax.rpc.ApiException - if the remote call failspublic final LogSink createSink(OrganizationName parent, LogSink sink)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
LogSink sink = LogSink.newBuilder().build();
LogSink response = configClient.createSink(parent, sink);
}
parent - Required. The resource in which to create the sink:
"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
For examples:
`"projects/my-project"` `"organizations/123456789"`
sink - Required. The new sink, whose `name` parameter is a sink identifier that is not
already in use.com.google.api.gax.rpc.ApiException - if the remote call failspublic final LogSink createSink(ProjectName parent, LogSink sink)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
LogSink sink = LogSink.newBuilder().build();
LogSink response = configClient.createSink(parent, sink);
}
parent - Required. The resource in which to create the sink:
"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
For examples:
`"projects/my-project"` `"organizations/123456789"`
sink - Required. The new sink, whose `name` parameter is a sink identifier that is not
already in use.com.google.api.gax.rpc.ApiException - if the remote call failspublic final LogSink createSink(String parent, LogSink sink)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
LogSink sink = LogSink.newBuilder().build();
LogSink response = configClient.createSink(parent, sink);
}
parent - Required. The resource in which to create the sink:
"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
For examples:
`"projects/my-project"` `"organizations/123456789"`
sink - Required. The new sink, whose `name` parameter is a sink identifier that is not
already in use.com.google.api.gax.rpc.ApiException - if the remote call failspublic final LogSink createSink(CreateSinkRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateSinkRequest,LogSink> createSinkCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
CreateSinkRequest request =
CreateSinkRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setSink(LogSink.newBuilder().build())
.setUniqueWriterIdentity(true)
.build();
ApiFuture<LogSink> future = configClient.createSinkCallable().futureCall(request);
// Do something.
LogSink response = future.get();
}
public final LogSink updateSink(LogSinkName sinkName, LogSink sink)
The updated sink might also have a new `writer_identity`; see the `unique_writer_identity` field.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
LogSink sink = LogSink.newBuilder().build();
LogSink response = configClient.updateSink(sinkName, sink);
}
sinkName - 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]"
For example:
`"projects/my-project/sinks/my-sink"`
sink - Required. The updated sink, whose name is the same identifier that appears as part
of `sink_name`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final LogSink updateSink(String sinkName, LogSink sink)
The updated sink might also have a new `writer_identity`; see the `unique_writer_identity` field.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString();
LogSink sink = LogSink.newBuilder().build();
LogSink response = configClient.updateSink(sinkName, sink);
}
sinkName - 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]"
For example:
`"projects/my-project/sinks/my-sink"`
sink - Required. The updated sink, whose name is the same identifier that appears as part
of `sink_name`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final LogSink updateSink(LogSinkName sinkName, LogSink sink, com.google.protobuf.FieldMask updateMask)
The updated sink might also have a new `writer_identity`; see the `unique_writer_identity` field.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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);
}
sinkName - 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]"
For example:
`"projects/my-project/sinks/my-sink"`
sink - Required. The updated sink, whose name is the same identifier that appears as part
of `sink_name`.updateMask - Optional. Field mask that specifies the fields in `sink` that need an update.
A sink field will be overwritten if, and only if, it is in the update mask. `name` and
output only fields cannot be updated.
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 `FieldMask` definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
For example: `updateMask=filter`
com.google.api.gax.rpc.ApiException - if the remote call failspublic final LogSink updateSink(String sinkName, LogSink sink, com.google.protobuf.FieldMask updateMask)
The updated sink might also have a new `writer_identity`; see the `unique_writer_identity` field.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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);
}
sinkName - 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]"
For example:
`"projects/my-project/sinks/my-sink"`
sink - Required. The updated sink, whose name is the same identifier that appears as part
of `sink_name`.updateMask - Optional. Field mask that specifies the fields in `sink` that need an update.
A sink field will be overwritten if, and only if, it is in the update mask. `name` and
output only fields cannot be updated.
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 `FieldMask` definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
For example: `updateMask=filter`
com.google.api.gax.rpc.ApiException - if the remote call failspublic final LogSink updateSink(UpdateSinkRequest request)
The updated sink might also have a new `writer_identity`; see the `unique_writer_identity` field.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateSinkRequest,LogSink> updateSinkCallable()
The updated sink might also have a new `writer_identity`; see the `unique_writer_identity` field.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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<LogSink> future = configClient.updateSinkCallable().futureCall(request);
// Do something.
LogSink response = future.get();
}
public final void deleteSink(LogSinkName sinkName)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
configClient.deleteSink(sinkName);
}
sinkName - 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]"
For example:
`"projects/my-project/sinks/my-sink"`
com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteSink(String sinkName)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString();
configClient.deleteSink(sinkName);
}
sinkName - 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]"
For example:
`"projects/my-project/sinks/my-sink"`
com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteSink(DeleteSinkRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
DeleteSinkRequest request =
DeleteSinkRequest.newBuilder()
.setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString())
.build();
configClient.deleteSink(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteSinkRequest,com.google.protobuf.Empty> deleteSinkCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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();
}
public final com.google.api.gax.longrunning.OperationFuture<Link,LinkMetadata> createLinkAsync(LogBucketName parent, Link link, String linkId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
LogBucketName parent =
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]");
Link link = Link.newBuilder().build();
String linkId = "linkId-1102667083";
Link response = configClient.createLinkAsync(parent, link, linkId).get();
}
parent - Required. The full resource name of the bucket to create a link for.
"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
link - Required. The new link.linkId - Required. The ID to use for the link. The link_id can have up to 100 characters.
A valid link_id must only have alphanumeric characters and underscores within it.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Link,LinkMetadata> createLinkAsync(String parent, Link link, String linkId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
String parent =
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
.toString();
Link link = Link.newBuilder().build();
String linkId = "linkId-1102667083";
Link response = configClient.createLinkAsync(parent, link, linkId).get();
}
parent - Required. The full resource name of the bucket to create a link for.
"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
link - Required. The new link.linkId - Required. The ID to use for the link. The link_id can have up to 100 characters.
A valid link_id must only have alphanumeric characters and underscores within it.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Link,LinkMetadata> createLinkAsync(CreateLinkRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
CreateLinkRequest request =
CreateLinkRequest.newBuilder()
.setParent(
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
.toString())
.setLink(Link.newBuilder().build())
.setLinkId("linkId-1102667083")
.build();
Link response = configClient.createLinkAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateLinkRequest,Link,LinkMetadata> createLinkOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
CreateLinkRequest request =
CreateLinkRequest.newBuilder()
.setParent(
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
.toString())
.setLink(Link.newBuilder().build())
.setLinkId("linkId-1102667083")
.build();
OperationFuture<Link, LinkMetadata> future =
configClient.createLinkOperationCallable().futureCall(request);
// Do something.
Link response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateLinkRequest,com.google.longrunning.Operation> createLinkCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
CreateLinkRequest request =
CreateLinkRequest.newBuilder()
.setParent(
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
.toString())
.setLink(Link.newBuilder().build())
.setLinkId("linkId-1102667083")
.build();
ApiFuture<Operation> future = configClient.createLinkCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,LinkMetadata> deleteLinkAsync(LinkName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
LinkName name =
LinkName.ofProjectLocationBucketLinkName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]");
configClient.deleteLinkAsync(name).get();
}
name - Required. The full resource name of the link to delete.
"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,LinkMetadata> deleteLinkAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
String name =
LinkName.ofProjectLocationBucketLinkName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]")
.toString();
configClient.deleteLinkAsync(name).get();
}
name - Required. The full resource name of the link to delete.
"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,LinkMetadata> deleteLinkAsync(DeleteLinkRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
DeleteLinkRequest request =
DeleteLinkRequest.newBuilder()
.setName(
LinkName.ofProjectLocationBucketLinkName(
"[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]")
.toString())
.build();
configClient.deleteLinkAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteLinkRequest,com.google.protobuf.Empty,LinkMetadata> deleteLinkOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
DeleteLinkRequest request =
DeleteLinkRequest.newBuilder()
.setName(
LinkName.ofProjectLocationBucketLinkName(
"[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]")
.toString())
.build();
OperationFuture<Empty, LinkMetadata> future =
configClient.deleteLinkOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteLinkRequest,com.google.longrunning.Operation> deleteLinkCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
DeleteLinkRequest request =
DeleteLinkRequest.newBuilder()
.setName(
LinkName.ofProjectLocationBucketLinkName(
"[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]")
.toString())
.build();
ApiFuture<Operation> future = configClient.deleteLinkCallable().futureCall(request);
// Do something.
future.get();
}
public final ConfigClient.ListLinksPagedResponse listLinks(LogBucketName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
LogBucketName parent =
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]");
for (Link element : configClient.listLinks(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent resource whose links are to be listed:
"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/" "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/
com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConfigClient.ListLinksPagedResponse listLinks(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
String parent =
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
.toString();
for (Link element : configClient.listLinks(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent resource whose links are to be listed:
"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/" "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/
com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConfigClient.ListLinksPagedResponse listLinks(ListLinksRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
ListLinksRequest request =
ListLinksRequest.newBuilder()
.setParent(
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
.toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
for (Link element : configClient.listLinks(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListLinksRequest,ConfigClient.ListLinksPagedResponse> listLinksPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
ListLinksRequest request =
ListLinksRequest.newBuilder()
.setParent(
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
.toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture<Link> future = configClient.listLinksPagedCallable().futureCall(request);
// Do something.
for (Link element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListLinksRequest,ListLinksResponse> listLinksCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
ListLinksRequest request =
ListLinksRequest.newBuilder()
.setParent(
LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
.toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
while (true) {
ListLinksResponse response = configClient.listLinksCallable().call(request);
for (Link element : response.getLinksList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final Link getLink(LinkName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
LinkName name =
LinkName.ofProjectLocationBucketLinkName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]");
Link response = configClient.getLink(name);
}
name - Required. The resource name of the link:
"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]
com.google.api.gax.rpc.ApiException - if the remote call failspublic final Link getLink(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
String name =
LinkName.ofProjectLocationBucketLinkName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]")
.toString();
Link response = configClient.getLink(name);
}
name - Required. The resource name of the link:
"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]
com.google.api.gax.rpc.ApiException - if the remote call failspublic final Link getLink(GetLinkRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
GetLinkRequest request =
GetLinkRequest.newBuilder()
.setName(
LinkName.ofProjectLocationBucketLinkName(
"[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]")
.toString())
.build();
Link response = configClient.getLink(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetLinkRequest,Link> getLinkCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
GetLinkRequest request =
GetLinkRequest.newBuilder()
.setName(
LinkName.ofProjectLocationBucketLinkName(
"[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]")
.toString())
.build();
ApiFuture<Link> future = configClient.getLinkCallable().futureCall(request);
// Do something.
Link response = future.get();
}
public final ConfigClient.ListExclusionsPagedResponse listExclusions(BillingAccountName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent resource whose exclusions are to be listed.
"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConfigClient.ListExclusionsPagedResponse listExclusions(FolderName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
FolderName parent = FolderName.of("[FOLDER]");
for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent resource whose exclusions are to be listed.
"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConfigClient.ListExclusionsPagedResponse listExclusions(OrganizationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent resource whose exclusions are to be listed.
"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConfigClient.ListExclusionsPagedResponse listExclusions(ProjectName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent resource whose exclusions are to be listed.
"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConfigClient.ListExclusionsPagedResponse listExclusions(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent resource whose exclusions are to be listed.
"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConfigClient.ListExclusionsPagedResponse listExclusions(ListExclusionsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListExclusionsRequest,ConfigClient.ListExclusionsPagedResponse> listExclusionsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
ListExclusionsRequest request =
ListExclusionsRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture<LogExclusion> future =
configClient.listExclusionsPagedCallable().futureCall(request);
// Do something.
for (LogExclusion element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListExclusionsRequest,ListExclusionsResponse> listExclusionsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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.getExclusionsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final LogExclusion getExclusion(LogExclusionName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
LogExclusion response = configClient.getExclusion(name);
}
name - 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]"
For example:
`"projects/my-project/exclusions/my-exclusion"`
com.google.api.gax.rpc.ApiException - if the remote call failspublic final LogExclusion getExclusion(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
String name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString();
LogExclusion response = configClient.getExclusion(name);
}
name - 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]"
For example:
`"projects/my-project/exclusions/my-exclusion"`
com.google.api.gax.rpc.ApiException - if the remote call failspublic final LogExclusion getExclusion(GetExclusionRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
GetExclusionRequest request =
GetExclusionRequest.newBuilder()
.setName(
LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString())
.build();
LogExclusion response = configClient.getExclusion(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetExclusionRequest,LogExclusion> getExclusionCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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();
}
public final LogExclusion createExclusion(BillingAccountName parent, LogExclusion exclusion)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
LogExclusion exclusion = LogExclusion.newBuilder().build();
LogExclusion response = configClient.createExclusion(parent, exclusion);
}
parent - Required. The parent resource in which to create the exclusion:
"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
For examples:
`"projects/my-logging-project"` `"organizations/123456789"`
exclusion - Required. The new exclusion, whose `name` parameter is an exclusion name that
is not already used in the parent resource.com.google.api.gax.rpc.ApiException - if the remote call failspublic final LogExclusion createExclusion(FolderName parent, LogExclusion exclusion)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
FolderName parent = FolderName.of("[FOLDER]");
LogExclusion exclusion = LogExclusion.newBuilder().build();
LogExclusion response = configClient.createExclusion(parent, exclusion);
}
parent - Required. The parent resource in which to create the exclusion:
"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
For examples:
`"projects/my-logging-project"` `"organizations/123456789"`
exclusion - Required. The new exclusion, whose `name` parameter is an exclusion name that
is not already used in the parent resource.com.google.api.gax.rpc.ApiException - if the remote call failspublic final LogExclusion createExclusion(OrganizationName parent, LogExclusion exclusion)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
LogExclusion exclusion = LogExclusion.newBuilder().build();
LogExclusion response = configClient.createExclusion(parent, exclusion);
}
parent - Required. The parent resource in which to create the exclusion:
"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
For examples:
`"projects/my-logging-project"` `"organizations/123456789"`
exclusion - Required. The new exclusion, whose `name` parameter is an exclusion name that
is not already used in the parent resource.com.google.api.gax.rpc.ApiException - if the remote call failspublic final LogExclusion createExclusion(ProjectName parent, LogExclusion exclusion)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
LogExclusion exclusion = LogExclusion.newBuilder().build();
LogExclusion response = configClient.createExclusion(parent, exclusion);
}
parent - Required. The parent resource in which to create the exclusion:
"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
For examples:
`"projects/my-logging-project"` `"organizations/123456789"`
exclusion - Required. The new exclusion, whose `name` parameter is an exclusion name that
is not already used in the parent resource.com.google.api.gax.rpc.ApiException - if the remote call failspublic final LogExclusion createExclusion(String parent, LogExclusion exclusion)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
LogExclusion exclusion = LogExclusion.newBuilder().build();
LogExclusion response = configClient.createExclusion(parent, exclusion);
}
parent - Required. The parent resource in which to create the exclusion:
"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
For examples:
`"projects/my-logging-project"` `"organizations/123456789"`
exclusion - Required. The new exclusion, whose `name` parameter is an exclusion name that
is not already used in the parent resource.com.google.api.gax.rpc.ApiException - if the remote call failspublic final LogExclusion createExclusion(CreateExclusionRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
CreateExclusionRequest request =
CreateExclusionRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setExclusion(LogExclusion.newBuilder().build())
.build();
LogExclusion response = configClient.createExclusion(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateExclusionRequest,LogExclusion> createExclusionCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
CreateExclusionRequest request =
CreateExclusionRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setExclusion(LogExclusion.newBuilder().build())
.build();
ApiFuture<LogExclusion> future = configClient.createExclusionCallable().futureCall(request);
// Do something.
LogExclusion response = future.get();
}
public final LogExclusion updateExclusion(LogExclusionName name, LogExclusion exclusion, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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 - 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]"
For example:
`"projects/my-project/exclusions/my-exclusion"`
exclusion - Required. New values for the existing exclusion. Only the fields specified in
`update_mask` are relevant.updateMask - 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][google.logging.v2.LogExclusion] included in this request. Fields not
mentioned in `update_mask` are not changed and are ignored in the request.
For example, to change the filter and description of an exclusion, specify an `update_mask` of `"filter,description"`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final LogExclusion updateExclusion(String name, LogExclusion exclusion, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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 - 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]"
For example:
`"projects/my-project/exclusions/my-exclusion"`
exclusion - Required. New values for the existing exclusion. Only the fields specified in
`update_mask` are relevant.updateMask - 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][google.logging.v2.LogExclusion] included in this request. Fields not
mentioned in `update_mask` are not changed and are ignored in the request.
For example, to change the filter and description of an exclusion, specify an `update_mask` of `"filter,description"`.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final LogExclusion updateExclusion(UpdateExclusionRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateExclusionRequest,LogExclusion> updateExclusionCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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<LogExclusion> future = configClient.updateExclusionCallable().futureCall(request);
// Do something.
LogExclusion response = future.get();
}
public final void deleteExclusion(LogExclusionName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
configClient.deleteExclusion(name);
}
name - 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]"
For example:
`"projects/my-project/exclusions/my-exclusion"`
com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteExclusion(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
String name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString();
configClient.deleteExclusion(name);
}
name - 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]"
For example:
`"projects/my-project/exclusions/my-exclusion"`
com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteExclusion(DeleteExclusionRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
DeleteExclusionRequest request =
DeleteExclusionRequest.newBuilder()
.setName(
LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString())
.build();
configClient.deleteExclusion(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteExclusionRequest,com.google.protobuf.Empty> deleteExclusionCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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();
}
public final CmekSettings getCmekSettings(GetCmekSettingsRequest request)
Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.
See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
GetCmekSettingsRequest request =
GetCmekSettingsRequest.newBuilder()
.setName(CmekSettingsName.ofProjectName("[PROJECT]").toString())
.build();
CmekSettings response = configClient.getCmekSettings(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetCmekSettingsRequest,CmekSettings> getCmekSettingsCallable()
Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.
See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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();
}
public final CmekSettings updateCmekSettings(UpdateCmekSettingsRequest request)
Note: CMEK for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.
[UpdateCmekSettings][google.logging.v2.ConfigServiceV2.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 Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateCmekSettingsRequest,CmekSettings> updateCmekSettingsCallable()
Note: CMEK for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.
[UpdateCmekSettings][google.logging.v2.ConfigServiceV2.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 Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
UpdateCmekSettingsRequest request =
UpdateCmekSettingsRequest.newBuilder()
.setName("name3373707")
.setCmekSettings(CmekSettings.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<CmekSettings> future =
configClient.updateCmekSettingsCallable().futureCall(request);
// Do something.
CmekSettings response = future.get();
}
public final Settings getSettings(SettingsName name)
Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.
See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
SettingsName name = SettingsName.ofProjectName("[PROJECT]");
Settings response = configClient.getSettings(name);
}
name - Required. The resource for which to retrieve settings.
"projects/[PROJECT_ID]/settings" "organizations/[ORGANIZATION_ID]/settings" "billingAccounts/[BILLING_ACCOUNT_ID]/settings" "folders/[FOLDER_ID]/settings"
For example:
`"organizations/12345/settings"`
Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final Settings getSettings(String name)
Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.
See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
String name = SettingsName.ofProjectName("[PROJECT]").toString();
Settings response = configClient.getSettings(name);
}
name - Required. The resource for which to retrieve settings.
"projects/[PROJECT_ID]/settings" "organizations/[ORGANIZATION_ID]/settings" "billingAccounts/[BILLING_ACCOUNT_ID]/settings" "folders/[FOLDER_ID]/settings"
For example:
`"organizations/12345/settings"`
Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final Settings getSettings(GetSettingsRequest request)
Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.
See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
GetSettingsRequest request =
GetSettingsRequest.newBuilder()
.setName(SettingsName.ofProjectName("[PROJECT]").toString())
.build();
Settings response = configClient.getSettings(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetSettingsRequest,Settings> getSettingsCallable()
Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.
See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
GetSettingsRequest request =
GetSettingsRequest.newBuilder()
.setName(SettingsName.ofProjectName("[PROJECT]").toString())
.build();
ApiFuture<Settings> future = configClient.getSettingsCallable().futureCall(request);
// Do something.
Settings response = future.get();
}
public final Settings updateSettings(Settings settings, com.google.protobuf.FieldMask updateMask)
Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.
[UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings] 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. 4) `location_id` is not supported by Logging. 5) `location_id` violate OrgPolicy.
See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
Settings settings = Settings.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Settings response = configClient.updateSettings(settings, updateMask);
}
settings - Required. The settings to update.
See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
updateMask - Optional. Field mask identifying which fields from `settings` should be
updated. A field will be overwritten if and only if it is in the update mask. Output only
fields cannot be updated.
See [FieldMask][google.protobuf.FieldMask] for more information.
For example: `"updateMask=kmsKeyName"`
com.google.api.gax.rpc.ApiException - if the remote call failspublic final Settings updateSettings(UpdateSettingsRequest request)
Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.
[UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings] 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. 4) `location_id` is not supported by Logging. 5) `location_id` violate OrgPolicy.
See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
UpdateSettingsRequest request =
UpdateSettingsRequest.newBuilder()
.setName("name3373707")
.setSettings(Settings.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Settings response = configClient.updateSettings(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateSettingsRequest,Settings> updateSettingsCallable()
Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.
[UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings] 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. 4) `location_id` is not supported by Logging. 5) `location_id` violate OrgPolicy.
See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
UpdateSettingsRequest request =
UpdateSettingsRequest.newBuilder()
.setName("name3373707")
.setSettings(Settings.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Settings> future = configClient.updateSettingsCallable().futureCall(request);
// Do something.
Settings response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<CopyLogEntriesResponse,CopyLogEntriesMetadata> copyLogEntriesAsync(CopyLogEntriesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
CopyLogEntriesRequest request =
CopyLogEntriesRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setDestination("destination-1429847026")
.build();
CopyLogEntriesResponse response = configClient.copyLogEntriesAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CopyLogEntriesRequest,CopyLogEntriesResponse,CopyLogEntriesMetadata> copyLogEntriesOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
CopyLogEntriesRequest request =
CopyLogEntriesRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setDestination("destination-1429847026")
.build();
OperationFuture<CopyLogEntriesResponse, CopyLogEntriesMetadata> future =
configClient.copyLogEntriesOperationCallable().futureCall(request);
// Do something.
CopyLogEntriesResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CopyLogEntriesRequest,com.google.longrunning.Operation> copyLogEntriesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ConfigClient configClient = ConfigClient.create()) {
CopyLogEntriesRequest request =
CopyLogEntriesRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setDestination("destination-1429847026")
.build();
ApiFuture<Operation> future = configClient.copyLogEntriesCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2023 Google LLC. All rights reserved.