*
* try (ConfigClient configClient = ConfigClient.create()) {
- * SinkName sinkName = ProjectSinkName.of("[PROJECT]", "[SINK]");
- * LogSink response = configClient.getSink(sinkName);
+ * LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+ * configClient.deleteSink(sinkName);
* }
*
*
@@ -175,687 +187,1403 @@ public ConfigServiceV2Stub getStub() {
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Lists sinks.
+ * Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also
+ * deleted.
*
* Sample code: * *
* try (ConfigClient configClient = ConfigClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
- * for (LogSink element : configClient.listSinks(parent).iterateAll()) {
- * // doThingsWith(element);
- * }
+ * LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+ * configClient.deleteSink(sinkName);
* }
*
*
- * @param parent Required. The parent resource whose sinks are to be listed:
- * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @param 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]" + *
Example: `"projects/my-project-id/sinks/my-sink-id"`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListSinksPagedResponse listSinks(ParentName parent) { - ListSinksRequest request = - ListSinksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); - return listSinks(request); + public final void deleteSink(LogSinkName sinkName) { + DeleteSinkRequest request = + DeleteSinkRequest.newBuilder() + .setSinkName(sinkName == null ? null : sinkName.toString()) + .build(); + deleteSink(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists sinks. + * Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also + * deleted. * *
Sample code: * *
* try (ConfigClient configClient = ConfigClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
- * for (LogSink element : configClient.listSinks(parent.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
+ * LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+ * configClient.deleteSink(sinkName.toString());
* }
*
*
- * @param parent Required. The parent resource whose sinks are to be listed:
- * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @param 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]" + *
Example: `"projects/my-project-id/sinks/my-sink-id"`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListSinksPagedResponse listSinks(String parent) { - ListSinksRequest request = ListSinksRequest.newBuilder().setParent(parent).build(); - return listSinks(request); + public final void deleteSink(String sinkName) { + DeleteSinkRequest request = DeleteSinkRequest.newBuilder().setSinkName(sinkName).build(); + deleteSink(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists sinks. + * Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also + * deleted. * *
Sample code: * *
* try (ConfigClient configClient = ConfigClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
- * ListSinksRequest request = ListSinksRequest.newBuilder()
- * .setParent(parent.toString())
+ * LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+ * DeleteSinkRequest request = DeleteSinkRequest.newBuilder()
+ * .setSinkName(sinkName.toString())
* .build();
- * for (LogSink element : configClient.listSinks(request).iterateAll()) {
- * // doThingsWith(element);
- * }
+ * configClient.deleteSink(request);
* }
*
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListSinksPagedResponse listSinks(ListSinksRequest request) {
- return listSinksPagedCallable().call(request);
+ public final void deleteSink(DeleteSinkRequest request) {
+ deleteSinkCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Lists sinks.
+ * Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also
+ * deleted.
*
* Sample code: * *
* try (ConfigClient configClient = ConfigClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
- * ListSinksRequest request = ListSinksRequest.newBuilder()
- * .setParent(parent.toString())
+ * LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+ * DeleteSinkRequest request = DeleteSinkRequest.newBuilder()
+ * .setSinkName(sinkName.toString())
* .build();
- * ApiFuture<ListSinksPagedResponse> future = configClient.listSinksPagedCallable().futureCall(request);
+ * ApiFuture<Void> future = configClient.deleteSinkCallable().futureCall(request);
* // Do something
- * for (LogSink element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
+ * future.get();
* }
*
*/
- public final UnaryCallableThe updated sink might also have a new `writer_identity`; see the `unique_writer_identity` + * field. * *
Sample code: * *
* try (ConfigClient configClient = ConfigClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
- * ListSinksRequest request = ListSinksRequest.newBuilder()
- * .setParent(parent.toString())
- * .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;
- * }
- * }
+ * LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+ * LogSink sink = LogSink.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * LogSink response = configClient.updateSink(sinkName, sink, updateMask);
* }
*
+ *
+ * @param 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]" + *
Example: `"projects/my-project-id/sinks/my-sink-id"`. + * @param sink Required. The updated sink, whose name is the same identifier that appears as part + * of `sink_name`. + * @param 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 + *
Example: `updateMask=filter`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final UnaryCallable The updated sink might also have a new `writer_identity`; see the `unique_writer_identity`
+ * field.
*
* Sample code:
*
* "projects/[PROJECT_ID]/sinks/[SINK_ID]"
* "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
* "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
* "folders/[FOLDER_ID]/sinks/[SINK_ID]"
* Example: `"projects/my-project-id/sinks/my-sink-id"`.
+ * @param sink Required. The updated sink, whose name is the same identifier that appears as part
+ * of `sink_name`.
+ * @param 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
+ * Example: `updateMask=filter`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final LogSink getSink(SinkName sinkName) {
- GetSinkRequest request =
- GetSinkRequest.newBuilder()
- .setSinkName(sinkName == null ? null : sinkName.toString())
+ public final LogSink updateSink(String sinkName, LogSink sink, FieldMask updateMask) {
+ UpdateSinkRequest request =
+ UpdateSinkRequest.newBuilder()
+ .setSinkName(sinkName)
+ .setSink(sink)
+ .setUpdateMask(updateMask)
.build();
- return getSink(request);
+ return updateSink(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets a sink.
+ * Updates a sink. This method replaces the following fields in the existing sink with values from
+ * the new sink: `destination`, and `filter`.
+ *
+ * The updated sink might also have a new `writer_identity`; see the `unique_writer_identity`
+ * field.
*
* Sample code:
*
* "projects/[PROJECT_ID]/sinks/[SINK_ID]"
* "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
* "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
* "folders/[FOLDER_ID]/sinks/[SINK_ID]"
* Example: `"projects/my-project-id/sinks/my-sink-id"`.
+ * @param sink Required. The updated sink, whose name is the same identifier that appears as part
+ * of `sink_name`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final LogSink getSink(String sinkName) {
- GetSinkRequest request = GetSinkRequest.newBuilder().setSinkName(sinkName).build();
- return getSink(request);
+ public final LogSink updateSink(LogSinkName sinkName, LogSink sink) {
+ UpdateSinkRequest request =
+ UpdateSinkRequest.newBuilder()
+ .setSinkName(sinkName == null ? null : sinkName.toString())
+ .setSink(sink)
+ .build();
+ return updateSink(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets a sink.
+ * Updates a sink. This method replaces the following fields in the existing sink with values from
+ * the new sink: `destination`, and `filter`.
+ *
+ * The updated sink might also have a new `writer_identity`; see the `unique_writer_identity`
+ * field.
*
* Sample code:
*
* "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+ * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+ * "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+ * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+ * @param sink Required. The updated sink, whose name is the same identifier that appears as part
+ * of `sink_name`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final LogSink getSink(GetSinkRequest request) {
- return getSinkCallable().call(request);
+ public final LogSink updateSink(String sinkName, LogSink sink) {
+ UpdateSinkRequest request =
+ UpdateSinkRequest.newBuilder().setSinkName(sinkName).setSink(sink).build();
+ return updateSink(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets a sink.
+ * Updates a sink. This method replaces the following fields in the existing sink with values from
+ * the new sink: `destination`, and `filter`.
+ *
+ * The updated sink might also have a new `writer_identity`; see the `unique_writer_identity`
+ * field.
*
* Sample code:
*
* The updated sink might also have a new `writer_identity`; see the `unique_writer_identity`
+ * field.
*
* Sample code:
*
* "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
- * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
- * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
- * @param sink Required. The new sink, whose `name` parameter is a sink identifier that is not
- * already in use.
+ * UpdateSinkRequest request = UpdateSinkRequest.newBuilder()
+ * .setSinkName(sinkName.toString())
+ * .setSink(sink)
+ * .build();
+ * ApiFuture<LogSink> future = configClient.updateSinkCallable().futureCall(request);
+ * // Do something
+ * LogSink response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallable Sample code:
+ *
+ * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+ * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+ * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+ * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final LogSink createSink(ParentName parent, LogSink sink) {
- CreateSinkRequest request =
- CreateSinkRequest.newBuilder()
- .setParent(parent == null ? null : parent.toString())
- .setSink(sink)
- .build();
- return createSink(request);
+ public final void deleteExclusion(LogExclusionName name) {
+ DeleteExclusionRequest request =
+ DeleteExclusionRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteExclusion(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Creates a sink that exports specified log entries to a destination. The export of
- * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not
- * permitted to write to the destination. A sink can export log entries only from the resource
- * owning the sink.
+ * Deletes an exclusion.
*
* Sample code:
*
* "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
- * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
- * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
- * @param sink Required. The new sink, whose `name` parameter is a sink identifier that is not
- * already in use.
+ * @param 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]"
+ * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final LogSink createSink(String parent, LogSink sink) {
- CreateSinkRequest request =
- CreateSinkRequest.newBuilder().setParent(parent).setSink(sink).build();
- return createSink(request);
+ public final void deleteExclusion(String name) {
+ DeleteExclusionRequest request = DeleteExclusionRequest.newBuilder().setName(name).build();
+ deleteExclusion(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Creates a sink that exports specified log entries to a destination. The export of
- * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not
- * permitted to write to the destination. A sink can export log entries only from the resource
- * owning the sink.
+ * Deletes an exclusion.
*
* Sample code:
*
* Sample code:
*
* The updated sink might also have a new `writer_identity`; see the `unique_writer_identity`
- * field.
+ * Lists buckets (Beta).
*
* Sample code:
*
* "projects/[PROJECT_ID]/sinks/[SINK_ID]"
- * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
- * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
- * "folders/[FOLDER_ID]/sinks/[SINK_ID]"
- * Example: `"projects/my-project-id/sinks/my-sink-id"`.
- * @param sink Required. The updated sink, whose name is the same identifier that appears as part
- * of `sink_name`.
- * @param 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
- * Example: `updateMask=filter`.
+ * @param 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.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final LogSink updateSink(SinkName sinkName, LogSink sink, FieldMask updateMask) {
- UpdateSinkRequest request =
- UpdateSinkRequest.newBuilder()
- .setSinkName(sinkName == null ? null : sinkName.toString())
- .setSink(sink)
- .setUpdateMask(updateMask)
+ public final ListBucketsPagedResponse listBuckets(OrganizationLocationName parent) {
+ ListBucketsRequest request =
+ ListBucketsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
.build();
- return updateSink(request);
+ return listBuckets(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Updates a sink. This method replaces the following fields in the existing sink with values from
- * the new sink: `destination`, and `filter`.
- *
- * The updated sink might also have a new `writer_identity`; see the `unique_writer_identity`
- * field.
+ * Lists buckets (Beta).
*
* Sample code:
*
* "projects/[PROJECT_ID]/sinks/[SINK_ID]"
- * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
- * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
- * "folders/[FOLDER_ID]/sinks/[SINK_ID]"
- * Example: `"projects/my-project-id/sinks/my-sink-id"`.
- * @param sink Required. The updated sink, whose name is the same identifier that appears as part
- * of `sink_name`.
- * @param 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
- * Example: `updateMask=filter`.
+ * @param 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.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final LogSink updateSink(String sinkName, LogSink sink, FieldMask updateMask) {
- UpdateSinkRequest request =
- UpdateSinkRequest.newBuilder()
- .setSinkName(sinkName)
- .setSink(sink)
- .setUpdateMask(updateMask)
+ public final ListBucketsPagedResponse listBuckets(FolderLocationName parent) {
+ ListBucketsRequest request =
+ ListBucketsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
.build();
- return updateSink(request);
+ return listBuckets(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Updates a sink. This method replaces the following fields in the existing sink with values from
- * the new sink: `destination`, and `filter`.
- *
- * The updated sink might also have a new `writer_identity`; see the `unique_writer_identity`
- * field.
+ * Lists buckets (Beta).
*
* Sample code:
*
* "projects/[PROJECT_ID]/sinks/[SINK_ID]"
- * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
- * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
- * "folders/[FOLDER_ID]/sinks/[SINK_ID]"
- * Example: `"projects/my-project-id/sinks/my-sink-id"`.
- * @param sink Required. The updated sink, whose name is the same identifier that appears as part
- * of `sink_name`.
+ * @param 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.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final LogSink updateSink(SinkName sinkName, LogSink sink) {
- UpdateSinkRequest request =
- UpdateSinkRequest.newBuilder()
- .setSinkName(sinkName == null ? null : sinkName.toString())
- .setSink(sink)
+ public final ListBucketsPagedResponse listBuckets(BillingAccountLocationName parent) {
+ ListBucketsRequest request =
+ ListBucketsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
.build();
- return updateSink(request);
+ return listBuckets(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Updates a sink. This method replaces the following fields in the existing sink with values from
- * the new sink: `destination`, and `filter`.
- *
- * The updated sink might also have a new `writer_identity`; see the `unique_writer_identity`
- * field.
+ * Lists buckets (Beta).
*
* Sample code:
*
* "projects/[PROJECT_ID]/sinks/[SINK_ID]"
- * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
- * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
- * "folders/[FOLDER_ID]/sinks/[SINK_ID]"
- * Example: `"projects/my-project-id/sinks/my-sink-id"`.
- * @param sink Required. The updated sink, whose name is the same identifier that appears as part
- * of `sink_name`.
+ * @param 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.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final LogSink updateSink(String sinkName, LogSink sink) {
- UpdateSinkRequest request =
- UpdateSinkRequest.newBuilder().setSinkName(sinkName).setSink(sink).build();
- return updateSink(request);
+ public final ListBucketsPagedResponse listBuckets(LocationName parent) {
+ ListBucketsRequest request =
+ ListBucketsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listBuckets(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Updates a sink. This method replaces the following fields in the existing sink with values from
- * the new sink: `destination`, and `filter`.
- *
- * The updated sink might also have a new `writer_identity`; see the `unique_writer_identity`
- * field.
+ * Lists buckets (Beta).
*
* Sample code:
*
* "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.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final LogSink updateSink(UpdateSinkRequest request) {
- return updateSinkCallable().call(request);
+ public final ListBucketsPagedResponse listBuckets(String parent) {
+ ListBucketsRequest request = ListBucketsRequest.newBuilder().setParent(parent).build();
+ return listBuckets(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Updates a sink. This method replaces the following fields in the existing sink with values from
- * the new sink: `destination`, and `filter`.
- *
- * The updated sink might also have a new `writer_identity`; see the `unique_writer_identity`
- * field.
+ * Lists buckets (Beta).
*
* Sample code:
*
* Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * If the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be
+ * returned.
+ *
+ * If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be
+ * returned.
+ *
+ * A buckets region may not be modified after it is created. This method is in Beta.
+ *
+ * Sample code:
+ *
+ * If the retention period is decreased and the bucket is locked, FAILED_PRECONDITION will be
+ * returned.
+ *
+ * If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be
+ * returned.
+ *
+ * A buckets region may not be modified after it is created. This method is in Beta.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListSinksPagedResponse listSinks(ProjectName parent) {
+ ListSinksRequest request =
+ ListSinksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
+ return listSinks(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists sinks.
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListSinksPagedResponse listSinks(OrganizationName parent) {
+ ListSinksRequest request =
+ ListSinksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
+ return listSinks(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists sinks.
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListSinksPagedResponse listSinks(FolderName parent) {
+ ListSinksRequest request =
+ ListSinksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
+ return listSinks(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists sinks.
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListSinksPagedResponse listSinks(BillingAccountName parent) {
+ ListSinksRequest request =
+ ListSinksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
+ return listSinks(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists sinks.
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListSinksPagedResponse listSinks(String parent) {
+ ListSinksRequest request = ListSinksRequest.newBuilder().setParent(parent).build();
+ return listSinks(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists sinks.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+ * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+ * "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+ * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LogSink getSink(LogSinkName sinkName) {
+ GetSinkRequest request =
+ GetSinkRequest.newBuilder()
+ .setSinkName(sinkName == null ? null : sinkName.toString())
+ .build();
+ return getSink(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a sink.
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+ * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+ * "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+ * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LogSink getSink(String sinkName) {
+ GetSinkRequest request = GetSinkRequest.newBuilder().setSinkName(sinkName).build();
+ return getSink(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a sink.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
*
* "projects/[PROJECT_ID]/sinks/[SINK_ID]"
- * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
- * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
- * "folders/[FOLDER_ID]/sinks/[SINK_ID]"
- * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+ * @param parent Required. The resource in which to create the sink:
+ * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+ * @param sink Required. The new sink, whose `name` parameter is a sink identifier that is not
+ * already in use.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void deleteSink(SinkName sinkName) {
- DeleteSinkRequest request =
- DeleteSinkRequest.newBuilder()
- .setSinkName(sinkName == null ? null : sinkName.toString())
+ public final LogSink createSink(ProjectName parent, LogSink sink) {
+ CreateSinkRequest request =
+ CreateSinkRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setSink(sink)
.build();
- deleteSink(request);
+ return createSink(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also
- * deleted.
+ * Creates a sink that exports specified log entries to a destination. The export of
+ * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not
+ * permitted to write to the destination. A sink can export log entries only from the resource
+ * owning the sink.
*
* Sample code:
*
* "projects/[PROJECT_ID]/sinks/[SINK_ID]"
- * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
- * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
- * "folders/[FOLDER_ID]/sinks/[SINK_ID]"
- * Example: `"projects/my-project-id/sinks/my-sink-id"`.
+ * @param parent Required. The resource in which to create the sink:
+ * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+ * @param sink Required. The new sink, whose `name` parameter is a sink identifier that is not
+ * already in use.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void deleteSink(String sinkName) {
- DeleteSinkRequest request = DeleteSinkRequest.newBuilder().setSinkName(sinkName).build();
- deleteSink(request);
+ public final LogSink createSink(OrganizationName parent, LogSink sink) {
+ CreateSinkRequest request =
+ CreateSinkRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setSink(sink)
+ .build();
+ return createSink(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also
- * deleted.
+ * Creates a sink that exports specified log entries to a destination. The export of
+ * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not
+ * permitted to write to the destination. A sink can export log entries only from the resource
+ * owning the sink.
*
* Sample code:
*
* "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+ * @param sink Required. The new sink, whose `name` parameter is a sink identifier that is not
+ * already in use.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LogSink createSink(FolderName parent, LogSink sink) {
+ CreateSinkRequest request =
+ CreateSinkRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setSink(sink)
+ .build();
+ return createSink(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a sink that exports specified log entries to a destination. The export of
+ * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not
+ * permitted to write to the destination. A sink can export log entries only from the resource
+ * owning the sink.
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+ * @param sink Required. The new sink, whose `name` parameter is a sink identifier that is not
+ * already in use.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LogSink createSink(BillingAccountName parent, LogSink sink) {
+ CreateSinkRequest request =
+ CreateSinkRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setSink(sink)
+ .build();
+ return createSink(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a sink that exports specified log entries to a destination. The export of
+ * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not
+ * permitted to write to the destination. A sink can export log entries only from the resource
+ * owning the sink.
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+ * @param sink Required. The new sink, whose `name` parameter is a sink identifier that is not
+ * already in use.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LogSink createSink(String parent, LogSink sink) {
+ CreateSinkRequest request =
+ CreateSinkRequest.newBuilder().setParent(parent).setSink(sink).build();
+ return createSink(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a sink that exports specified log entries to a destination. The export of
+ * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not
+ * permitted to write to the destination. A sink can export log entries only from the resource
+ * owning the sink.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListExclusionsPagedResponse listExclusions(ProjectName parent) {
+ ListExclusionsRequest request =
+ ListExclusionsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listExclusions(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists all the exclusions in a parent resource.
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListExclusionsPagedResponse listExclusions(OrganizationName parent) {
+ ListExclusionsRequest request =
+ ListExclusionsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listExclusions(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also
- * deleted.
+ * Lists all the exclusions in a parent resource.
*
* Sample code:
*
* "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final UnaryCallable Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final LogExclusion getExclusion(ExclusionName name) {
+ public final LogExclusion getExclusion(LogExclusionName name) {
GetExclusionRequest request =
GetExclusionRequest.newBuilder().setName(name == null ? null : name.toString()).build();
return getExclusion(request);
@@ -1028,7 +1756,7 @@ public final LogExclusion getExclusion(ExclusionName name) {
*
* "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+ * @param exclusion Required. The new exclusion, whose `name` parameter is an exclusion name that
+ * is not already used in the parent resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LogExclusion createExclusion(ProjectName parent, LogExclusion exclusion) {
+ CreateExclusionRequest request =
+ CreateExclusionRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setExclusion(exclusion)
+ .build();
+ return createExclusion(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new exclusion in a specified parent resource. Only log entries belonging to that
+ * resource can be excluded. You can have up to 10 exclusions in a resource.
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+ * @param exclusion Required. The new exclusion, whose `name` parameter is an exclusion name that
+ * is not already used in the parent resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LogExclusion createExclusion(OrganizationName parent, LogExclusion exclusion) {
+ CreateExclusionRequest request =
+ CreateExclusionRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setExclusion(exclusion)
+ .build();
+ return createExclusion(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new exclusion in a specified parent resource. Only log entries belonging to that
+ * resource can be excluded. You can have up to 10 exclusions in a resource.
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.
+ * @param exclusion Required. The new exclusion, whose `name` parameter is an exclusion name that
+ * is not already used in the parent resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LogExclusion createExclusion(FolderName parent, LogExclusion exclusion) {
+ CreateExclusionRequest request =
+ CreateExclusionRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setExclusion(exclusion)
+ .build();
+ return createExclusion(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new exclusion in a specified parent resource. Only log entries belonging to that
+ * resource can be excluded. You can have up to 10 exclusions in a resource.
+ *
+ * Sample code:
+ *
+ * Sample code:
- *
- * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
- * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
- * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
- * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
- * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteExclusion(ExclusionName name) {
- DeleteExclusionRequest request =
- DeleteExclusionRequest.newBuilder().setName(name == null ? null : name.toString()).build();
- deleteExclusion(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes an exclusion.
- *
- * Sample code:
- *
- * "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
- * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
- * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
- * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
- * Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteExclusion(String name) {
- DeleteExclusionRequest request = DeleteExclusionRequest.newBuilder().setName(name).build();
- deleteExclusion(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes an exclusion.
- *
- * Sample code:
- *
- * Sample code:
- *
- * Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once
* configured, it applies to all projects and folders in the GCP organization.
*
- * See [Enabling CMEK for Logs Router](/logging/docs/routing/managed-encryption) for more
- * information.
+ * See [Enabling CMEK for Logs
+ * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
*
* Sample code:
*
* Note: CMEK for the Logs Router can currently only be configured for GCP organizations. Once
* configured, it applies to all projects and folders in the GCP organization.
*
- * See [Enabling CMEK for Logs Router](/logging/docs/routing/managed-encryption) for more
- * information.
+ * See [Enabling CMEK for Logs
+ * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
*
* Sample code:
*
* See [Enabling CMEK for Logs Router](/logging/docs/routing/managed-encryption) for more
- * information.
+ * See [Enabling CMEK for Logs
+ * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
*
* Sample code:
*
* See [Enabling CMEK for Logs Router](/logging/docs/routing/managed-encryption) for more
- * information.
+ * See [Enabling CMEK for Logs
+ * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
*
* Sample code:
*
* The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
- * For example, to set the total timeout of getSink to 30 seconds:
+ * For example, to set the total timeout of deleteSink to 30 seconds:
*
* Sample code:
+ *
+ * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * Projects listed in the `project_ids` field are added to this list.
+ * @param filter Optional. A filter that chooses which log entries to return. See [Advanced Logs
+ * Queries](https://cloud.google.com/logging/docs/view/advanced-queries). Only log entries
+ * that match the filter are returned. An empty filter matches all log entries in the
+ * resources listed in `resource_names`. Referencing a parent resource that is not listed in
+ * `resource_names` will cause the filter to return no results. The maximum length of the
+ * filter is 20000 characters.
+ * @param orderBy Optional. How the results should be sorted. Presently, the only permitted values
+ * are `"timestamp asc"` (default) and `"timestamp desc"`. The first option returns entries in
+ * order of increasing values of `LogEntry.timestamp` (oldest first), and the second option
+ * returns entries in order of decreasing timestamps (newest first). Entries with equal
+ * timestamps are returned in order of their `insert_id` values.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListLogEntriesPagedResponse listLogEntries(
+ List Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * `[LOG_ID]` must be URL-encoded. For example:
* "projects/my-project-id/logs/syslog"
* "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"
- * The permission <code>logging.logEntries.create</code> is needed on each
- * project, organization, billing account, or folder that is receiving new log entries,
- * whether the resource is specified in <code>logName</code> or in an individual
- * log entry.
+ * The permission `logging.logEntries.create` is needed on each project, organization,
+ * billing account, or folder that is receiving new log entries, whether the resource is
+ * specified in `logName` or in an individual log entry.
* @param resource Optional. A default monitored resource object that is assigned to all log
* entries in `entries` that do not specify a value for `resource`. Example:
* { "type": "gce_instance", "labels": { "zone": "us-central1-a", "instance_id":
@@ -325,12 +463,14 @@ public final UnaryCallable Log entries with timestamps that are more than the [logs retention
- * period](/logging/quota-policy) in the past or more than 24 hours in the future will not be
- * available when calling `entries.list`. However, those log entries can still be [exported
- * with LogSinks](/logging/docs/api/tasks/exporting-logs).
- * To improve throughput and to avoid exceeding the [quota limit](/logging/quota-policy)
- * for calls to `entries.write`, you should try to include several log entries in this list,
- * rather than calling this method for each individual log entry.
+ * period](https://cloud.google.com/logging/quota-policy) in the past or more than 24 hours in
+ * the future will not be available when calling `entries.list`. However, those log entries
+ * can still be [exported with
+ * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+ * To improve throughput and to avoid exceeding the [quota
+ * limit](https://cloud.google.com/logging/quota-policy) for calls to `entries.write`, you
+ * should try to include several log entries in this list, rather than calling this method for
+ * each individual log entry.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final WriteLogEntriesResponse writeLogEntries(
@@ -359,7 +499,7 @@ public final WriteLogEntriesResponse writeLogEntries(
*
* `[LOG_ID]` must be URL-encoded. For example:
* "projects/my-project-id/logs/syslog"
* "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"
- * The permission <code>logging.logEntries.create</code> is needed on each
- * project, organization, billing account, or folder that is receiving new log entries,
- * whether the resource is specified in <code>logName</code> or in an individual
- * log entry.
+ * The permission `logging.logEntries.create` is needed on each project, organization,
+ * billing account, or folder that is receiving new log entries, whether the resource is
+ * specified in `logName` or in an individual log entry.
* @param resource Optional. A default monitored resource object that is assigned to all log
* entries in `entries` that do not specify a value for `resource`. Example:
* { "type": "gce_instance", "labels": { "zone": "us-central1-a", "instance_id":
@@ -398,12 +537,14 @@ public final WriteLogEntriesResponse writeLogEntries(
* earlier in the list will sort before the entries later in the list. See the `entries.list`
* method.
* Log entries with timestamps that are more than the [logs retention
- * period](/logging/quota-policy) in the past or more than 24 hours in the future will not be
- * available when calling `entries.list`. However, those log entries can still be [exported
- * with LogSinks](/logging/docs/api/tasks/exporting-logs).
- * To improve throughput and to avoid exceeding the [quota limit](/logging/quota-policy)
- * for calls to `entries.write`, you should try to include several log entries in this list,
- * rather than calling this method for each individual log entry.
+ * period](https://cloud.google.com/logging/quota-policy) in the past or more than 24 hours in
+ * the future will not be available when calling `entries.list`. However, those log entries
+ * can still be [exported with
+ * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+ * To improve throughput and to avoid exceeding the [quota
+ * limit](https://cloud.google.com/logging/quota-policy) for calls to `entries.write`, you
+ * should try to include several log entries in this list, rather than calling this method for
+ * each individual log entry.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final WriteLogEntriesResponse writeLogEntries(
@@ -475,67 +616,14 @@ public final WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest requ
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Lists log entries. Use this method to retrieve log entries that originated from a
- * project/folder/organization/billing account. For ways to export log entries, see [Exporting
- * Logs](/logging/docs/export).
- *
- * Sample code:
- *
- * "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
- * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
- * Projects listed in the `project_ids` field are added to this list.
- * @param filter Optional. A filter that chooses which log entries to return. See [Advanced Logs
- * Queries](/logging/docs/view/advanced-queries). Only log entries that match the filter are
- * returned. An empty filter matches all log entries in the resources listed in
- * `resource_names`. Referencing a parent resource that is not listed in `resource_names` will
- * cause the filter to return no results. The maximum length of the filter is 20000
- * characters.
- * @param orderBy Optional. How the results should be sorted. Presently, the only permitted values
- * are `"timestamp asc"` (default) and `"timestamp desc"`. The first option returns entries in
- * order of increasing values of `LogEntry.timestamp` (oldest first), and the second option
- * returns entries in order of decreasing timestamps (newest first). Entries with equal
- * timestamps are returned in order of their `insert_id` values.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final ListLogEntriesPagedResponse listLogEntries(
- List Sample code:
*
* Sample code:
*
* Sample code:
*
* Sample code:
*
* "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResourceDescriptors(
- ListMonitoredResourceDescriptorsRequest request) {
- return listMonitoredResourceDescriptorsPagedCallable().call(request);
+ public final ListLogsPagedResponse listLogs(ProjectName parent) {
+ ListLogsRequest request =
+ ListLogsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
+ return listLogs(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Lists the descriptors for monitored resource types used by Logging.
+ * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have
+ * entries are listed.
*
* Sample code:
*
* "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final UnaryCallable<
- ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsPagedResponse>
- listMonitoredResourceDescriptorsPagedCallable() {
- return stub.listMonitoredResourceDescriptorsPagedCallable();
+ public final ListLogsPagedResponse listLogs(OrganizationName parent) {
+ ListLogsRequest request =
+ ListLogsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
+ return listLogs(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Lists the descriptors for monitored resource types used by Logging.
+ * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have
+ * entries are listed.
*
* Sample code:
*
* "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
+ * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final UnaryCallable<
- ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse>
- listMonitoredResourceDescriptorsCallable() {
- return stub.listMonitoredResourceDescriptorsCallable();
+ public final ListLogsPagedResponse listLogs(FolderName parent) {
+ ListLogsRequest request =
+ ListLogsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
+ return listLogs(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
@@ -694,7 +780,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
*
* Sample code:
+ *
+ * "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+ * The updated metric must be provided in the request and it's `name` field must be the
+ * same as `[METRIC_ID]` If the metric does not exist in `[PROJECT_ID]`, then a new metric is
+ * created.
+ * @param metric Required. The updated metric.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LogMetric updateLogMetric(LogMetricName metricName, LogMetric metric) {
+ UpdateLogMetricRequest request =
+ UpdateLogMetricRequest.newBuilder()
+ .setMetricName(metricName == null ? null : metricName.toString())
+ .setMetric(metric)
+ .build();
+ return updateLogMetric(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates or updates a logs-based metric.
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+ * The updated metric must be provided in the request and it's `name` field must be the
+ * same as `[METRIC_ID]` If the metric does not exist in `[PROJECT_ID]`, then a new metric is
+ * created.
+ * @param metric Required. The updated metric.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LogMetric updateLogMetric(String metricName, LogMetric metric) {
+ UpdateLogMetricRequest request =
+ UpdateLogMetricRequest.newBuilder().setMetricName(metricName).setMetric(metric).build();
+ return updateLogMetric(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates or updates a logs-based metric.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteLogMetric(LogMetricName metricName) {
+ DeleteLogMetricRequest request =
+ DeleteLogMetricRequest.newBuilder()
+ .setMetricName(metricName == null ? null : metricName.toString())
+ .build();
+ deleteLogMetric(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a logs-based metric.
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteLogMetric(String metricName) {
+ DeleteLogMetricRequest request =
+ DeleteLogMetricRequest.newBuilder().setMetricName(metricName).build();
+ deleteLogMetric(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a logs-based metric.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * "projects/[PROJECT_ID]"
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListLogMetricsPagedResponse listLogMetrics(ParentName parent) {
+ public final ListLogMetricsPagedResponse listLogMetrics(ProjectName parent) {
ListLogMetricsRequest request =
ListLogMetricsRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
@@ -196,7 +398,7 @@ public final ListLogMetricsPagedResponse listLogMetrics(ParentName parent) {
*
* "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final LogMetric getLogMetric(MetricName metricName) {
+ public final LogMetric getLogMetric(LogMetricName metricName) {
GetLogMetricRequest request =
GetLogMetricRequest.newBuilder()
.setMetricName(metricName == null ? null : metricName.toString())
@@ -327,7 +529,7 @@ public final LogMetric getLogMetric(MetricName metricName) {
*
* Sample code:
- *
- * "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
- * The updated metric must be provided in the request and it's `name` field must be the
- * same as `[METRIC_ID]` If the metric does not exist in `[PROJECT_ID]`, then a new metric is
- * created.
- * @param metric Required. The updated metric.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final LogMetric updateLogMetric(MetricName metricName, LogMetric metric) {
- UpdateLogMetricRequest request =
- UpdateLogMetricRequest.newBuilder()
- .setMetricName(metricName == null ? null : metricName.toString())
- .setMetric(metric)
- .build();
- return updateLogMetric(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates or updates a logs-based metric.
- *
- * Sample code:
- *
- * "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
- * The updated metric must be provided in the request and it's `name` field must be the
- * same as `[METRIC_ID]` If the metric does not exist in `[PROJECT_ID]`, then a new metric is
- * created.
- * @param metric Required. The updated metric.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final LogMetric updateLogMetric(String metricName, LogMetric metric) {
- UpdateLogMetricRequest request =
- UpdateLogMetricRequest.newBuilder().setMetricName(metricName).setMetric(metric).build();
- return updateLogMetric(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates or updates a logs-based metric.
- *
- * Sample code:
- *
- * Sample code:
- *
- * Sample code:
- *
- * "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteLogMetric(MetricName metricName) {
- DeleteLogMetricRequest request =
- DeleteLogMetricRequest.newBuilder()
- .setMetricName(metricName == null ? null : metricName.toString())
- .build();
- deleteLogMetric(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes a logs-based metric.
- *
- * Sample code:
- *
- * "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteLogMetric(String metricName) {
- DeleteLogMetricRequest request =
- DeleteLogMetricRequest.newBuilder().setMetricName(metricName).build();
- deleteLogMetric(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes a logs-based metric.
- *
- * Sample code:
- *
- * Sample code:
- *
- * The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
- * For example, to set the total timeout of getLogMetric to 30 seconds:
+ * For example, to set the total timeout of updateLogMetric to 30 seconds:
*
* The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
- * For example, to set the total timeout of getSink to 30 seconds:
+ * For example, to set the total timeout of deleteSink to 30 seconds:
*
*
*
- * @param sinkName Required. The resource name of the sink:
+ * @param sinkName Required. The full resource name of the sink to update, including the parent
+ * resource and the sink identifier:
*
* try (ConfigClient configClient = ConfigClient.create()) {
- * SinkName sinkName = ProjectSinkName.of("[PROJECT]", "[SINK]");
- * LogSink response = configClient.getSink(sinkName);
+ * LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+ * LogSink sink = LogSink.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * LogSink response = configClient.updateSink(sinkName.toString(), sink, updateMask);
* }
*
*
- * @param sinkName Required. The resource name of the sink:
+ * @param sinkName Required. The full resource name of the sink to update, including the parent
+ * resource and the sink identifier:
*
* try (ConfigClient configClient = ConfigClient.create()) {
- * SinkName sinkName = ProjectSinkName.of("[PROJECT]", "[SINK]");
- * LogSink response = configClient.getSink(sinkName.toString());
+ * LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+ * LogSink sink = LogSink.newBuilder().build();
+ * LogSink response = configClient.updateSink(sinkName, sink);
* }
*
*
- * @param request The request object containing all of the parameters for the API call.
+ * @param sinkName Required. The full resource name of the sink to update, including the parent
+ * resource and the sink identifier:
+ *
* try (ConfigClient configClient = ConfigClient.create()) {
- * SinkName sinkName = ProjectSinkName.of("[PROJECT]", "[SINK]");
- * GetSinkRequest request = GetSinkRequest.newBuilder()
- * .setSinkName(sinkName.toString())
- * .build();
- * LogSink response = configClient.getSink(request);
+ * LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+ * LogSink sink = LogSink.newBuilder().build();
+ * LogSink response = configClient.updateSink(sinkName.toString(), sink);
* }
*
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final UnaryCallable
* try (ConfigClient configClient = ConfigClient.create()) {
- * SinkName sinkName = ProjectSinkName.of("[PROJECT]", "[SINK]");
- * GetSinkRequest request = GetSinkRequest.newBuilder()
+ * LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+ * LogSink sink = LogSink.newBuilder().build();
+ * UpdateSinkRequest request = UpdateSinkRequest.newBuilder()
* .setSinkName(sinkName.toString())
+ * .setSink(sink)
* .build();
- * ApiFuture<LogSink> future = configClient.getSinkCallable().futureCall(request);
- * // Do something
- * LogSink response = future.get();
+ * LogSink response = configClient.updateSink(request);
* }
*
- *
- * @param parent Required. The resource in which to create the sink:
- *
* try (ConfigClient configClient = ConfigClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
* LogSink sink = LogSink.newBuilder().build();
- * LogSink response = configClient.createSink(parent, sink);
- * }
- *
+ *
+ * @param name Required. The resource name of an existing exclusion to delete:
+ *
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+ * configClient.deleteExclusion(name);
+ * }
+ *
*
- * @param parent Required. The resource in which to create the sink:
- *
* try (ConfigClient configClient = ConfigClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
- * LogSink sink = LogSink.newBuilder().build();
- * LogSink response = configClient.createSink(parent.toString(), sink);
+ * LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+ * configClient.deleteExclusion(name.toString());
* }
*
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final LogSink createSink(CreateSinkRequest request) {
- return createSinkCallable().call(request);
+ public final void deleteExclusion(DeleteExclusionRequest request) {
+ deleteExclusionCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Creates a sink that exports specified log entries to a destination. The export of
- * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not
- * permitted to write to the destination. A sink can export log entries only from the resource
- * owning the sink.
+ * Deletes an exclusion.
*
*
* try (ConfigClient configClient = ConfigClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
- * LogSink sink = LogSink.newBuilder().build();
- * CreateSinkRequest request = CreateSinkRequest.newBuilder()
- * .setParent(parent.toString())
- * .setSink(sink)
+ * LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+ * DeleteExclusionRequest request = DeleteExclusionRequest.newBuilder()
+ * .setName(name.toString())
* .build();
- * LogSink response = configClient.createSink(request);
+ * configClient.deleteExclusion(request);
* }
*
*/
- public final UnaryCallable
* try (ConfigClient configClient = ConfigClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
- * LogSink sink = LogSink.newBuilder().build();
- * CreateSinkRequest request = CreateSinkRequest.newBuilder()
- * .setParent(parent.toString())
- * .setSink(sink)
+ * LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+ * DeleteExclusionRequest request = DeleteExclusionRequest.newBuilder()
+ * .setName(name.toString())
* .build();
- * ApiFuture<LogSink> future = configClient.createSinkCallable().futureCall(request);
+ * ApiFuture<Void> future = configClient.deleteExclusionCallable().futureCall(request);
* // Do something
- * LogSink response = future.get();
+ * future.get();
* }
*
*
- * @param sinkName Required. The full resource name of the sink to update, including the parent
- * resource and the sink identifier:
- *
* try (ConfigClient configClient = ConfigClient.create()) {
- * SinkName sinkName = ProjectSinkName.of("[PROJECT]", "[SINK]");
- * LogSink sink = LogSink.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * LogSink response = configClient.updateSink(sinkName, sink, updateMask);
+ * OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
+ * for (LogBucket element : configClient.listBuckets(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
*
- * @param sinkName Required. The full resource name of the sink to update, including the parent
- * resource and the sink identifier:
- *
* try (ConfigClient configClient = ConfigClient.create()) {
- * SinkName sinkName = ProjectSinkName.of("[PROJECT]", "[SINK]");
- * LogSink sink = LogSink.newBuilder().build();
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * LogSink response = configClient.updateSink(sinkName.toString(), sink, updateMask);
+ * FolderLocationName parent = FolderLocationName.of("[FOLDER]", "[LOCATION]");
+ * for (LogBucket element : configClient.listBuckets(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
*
- * @param sinkName Required. The full resource name of the sink to update, including the parent
- * resource and the sink identifier:
- *
* try (ConfigClient configClient = ConfigClient.create()) {
- * SinkName sinkName = ProjectSinkName.of("[PROJECT]", "[SINK]");
- * LogSink sink = LogSink.newBuilder().build();
- * LogSink response = configClient.updateSink(sinkName, sink);
+ * BillingAccountLocationName parent = BillingAccountLocationName.of("[BILLING_ACCOUNT]", "[LOCATION]");
+ * for (LogBucket element : configClient.listBuckets(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
*
- * @param sinkName Required. The full resource name of the sink to update, including the parent
- * resource and the sink identifier:
- *
* try (ConfigClient configClient = ConfigClient.create()) {
- * SinkName sinkName = ProjectSinkName.of("[PROJECT]", "[SINK]");
- * LogSink sink = LogSink.newBuilder().build();
- * LogSink response = configClient.updateSink(sinkName.toString(), sink);
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (LogBucket element : configClient.listBuckets(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
*
- * @param request The request object containing all of the parameters for the API call.
+ * @param parent Required. The parent resource whose buckets are to be listed:
+ *
* try (ConfigClient configClient = ConfigClient.create()) {
- * SinkName sinkName = ProjectSinkName.of("[PROJECT]", "[SINK]");
- * LogSink sink = LogSink.newBuilder().build();
- * UpdateSinkRequest request = UpdateSinkRequest.newBuilder()
- * .setSinkName(sinkName.toString())
- * .setSink(sink)
- * .build();
- * LogSink response = configClient.updateSink(request);
+ * OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
+ * for (LogBucket element : configClient.listBuckets(parent.toString()).iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListBucketsPagedResponse listBuckets(ListBucketsRequest request) {
+ return listBucketsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists buckets (Beta).
+ *
+ *
* try (ConfigClient configClient = ConfigClient.create()) {
- * SinkName sinkName = ProjectSinkName.of("[PROJECT]", "[SINK]");
- * LogSink sink = LogSink.newBuilder().build();
- * UpdateSinkRequest request = UpdateSinkRequest.newBuilder()
- * .setSinkName(sinkName.toString())
- * .setSink(sink)
+ * OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
+ * ListBucketsRequest request = ListBucketsRequest.newBuilder()
+ * .setParent(parent.toString())
* .build();
- * ApiFuture<LogSink> future = configClient.updateSinkCallable().futureCall(request);
- * // Do something
- * LogSink response = future.get();
- * }
+ * for (LogBucket element : configClient.listBuckets(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
+ * ListBucketsRequest request = ListBucketsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * ApiFuture<ListBucketsPagedResponse> future = configClient.listBucketsPagedCallable().futureCall(request);
+ * // Do something
+ * for (LogBucket element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
+ * ListBucketsRequest request = ListBucketsRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .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;
+ * }
+ * }
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LogBucket getBucket(GetBucketRequest request) {
+ return getBucketCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a bucket (Beta).
+ *
+ *
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * LogBucketName name = LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]");
+ * GetBucketRequest request = GetBucketRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * LogBucket response = configClient.getBucket(request);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * LogBucketName name = LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]");
+ * GetBucketRequest request = GetBucketRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<LogBucket> future = configClient.getBucketCallable().futureCall(request);
+ * // Do something
+ * LogBucket response = future.get();
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LogBucket updateBucket(UpdateBucketRequest request) {
+ return updateBucketCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates a bucket. This method replaces the following fields in the existing bucket with values
+ * from the new bucket: `retention_period`
+ *
+ *
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * LogBucketName name = LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]");
+ * LogBucket bucket = LogBucket.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * UpdateBucketRequest request = UpdateBucketRequest.newBuilder()
+ * .setName(name.toString())
+ * .setBucket(bucket)
+ * .setUpdateMask(updateMask)
+ * .build();
+ * LogBucket response = configClient.updateBucket(request);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * LogBucketName name = LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]");
+ * LogBucket bucket = LogBucket.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * UpdateBucketRequest request = UpdateBucketRequest.newBuilder()
+ * .setName(name.toString())
+ * .setBucket(bucket)
+ * .setUpdateMask(updateMask)
+ * .build();
+ * ApiFuture<LogBucket> future = configClient.updateBucketCallable().futureCall(request);
+ * // Do something
+ * LogBucket response = future.get();
+ * }
+ *
+ *
+ * @param parent Required. The parent resource whose sinks are to be listed:
+ *
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * for (LogSink element : configClient.listSinks(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. The parent resource whose sinks are to be listed:
+ *
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * for (LogSink element : configClient.listSinks(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. The parent resource whose sinks are to be listed:
+ *
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * FolderName parent = FolderName.of("[FOLDER]");
+ * for (LogSink element : configClient.listSinks(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. The parent resource whose sinks are to be listed:
+ *
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+ * for (LogSink element : configClient.listSinks(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. The parent resource whose sinks are to be listed:
+ *
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * for (LogSink element : configClient.listSinks(parent.toString()).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListSinksPagedResponse listSinks(ListSinksRequest request) {
+ return listSinksPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists sinks.
+ *
+ *
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * ListSinksRequest request = ListSinksRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * for (LogSink element : configClient.listSinks(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * ListSinksRequest request = ListSinksRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .build();
+ * ApiFuture<ListSinksPagedResponse> future = configClient.listSinksPagedCallable().futureCall(request);
+ * // Do something
+ * for (LogSink element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * ListSinksRequest request = ListSinksRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .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;
+ * }
+ * }
+ * }
+ *
+ *
+ * @param sinkName Required. The resource name of the sink:
+ *
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+ * LogSink response = configClient.getSink(sinkName);
+ * }
+ *
+ *
+ * @param sinkName Required. The resource name of the sink:
+ *
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+ * LogSink response = configClient.getSink(sinkName.toString());
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LogSink getSink(GetSinkRequest request) {
+ return getSinkCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a sink.
+ *
+ *
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+ * GetSinkRequest request = GetSinkRequest.newBuilder()
+ * .setSinkName(sinkName.toString())
+ * .build();
+ * LogSink response = configClient.getSink(request);
+ * }
+ *
*/
- public final UnaryCallable
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+ * GetSinkRequest request = GetSinkRequest.newBuilder()
+ * .setSinkName(sinkName.toString())
+ * .build();
+ * ApiFuture<LogSink> future = configClient.getSinkCallable().futureCall(request);
+ * // Do something
+ * LogSink response = future.get();
+ * }
*
*
- * @param sinkName Required. The full resource name of the sink to delete, including the parent
- * resource and the sink identifier:
- *
* try (ConfigClient configClient = ConfigClient.create()) {
- * SinkName sinkName = ProjectSinkName.of("[PROJECT]", "[SINK]");
- * configClient.deleteSink(sinkName);
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * LogSink sink = LogSink.newBuilder().build();
+ * LogSink response = configClient.createSink(parent, sink);
* }
*
*
- * @param sinkName Required. The full resource name of the sink to delete, including the parent
- * resource and the sink identifier:
- *
* try (ConfigClient configClient = ConfigClient.create()) {
- * SinkName sinkName = ProjectSinkName.of("[PROJECT]", "[SINK]");
- * configClient.deleteSink(sinkName.toString());
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * LogSink sink = LogSink.newBuilder().build();
+ * LogSink response = configClient.createSink(parent, sink);
* }
*
+ *
+ * @param parent Required. The resource in which to create the sink:
+ *
* try (ConfigClient configClient = ConfigClient.create()) {
- * SinkName sinkName = ProjectSinkName.of("[PROJECT]", "[SINK]");
- * DeleteSinkRequest request = DeleteSinkRequest.newBuilder()
- * .setSinkName(sinkName.toString())
+ * FolderName parent = FolderName.of("[FOLDER]");
+ * LogSink sink = LogSink.newBuilder().build();
+ * LogSink response = configClient.createSink(parent, sink);
+ * }
+ *
+ *
+ * @param parent Required. The resource in which to create the sink:
+ *
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+ * LogSink sink = LogSink.newBuilder().build();
+ * LogSink response = configClient.createSink(parent, sink);
+ * }
+ *
+ *
+ * @param parent Required. The resource in which to create the sink:
+ *
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * LogSink sink = LogSink.newBuilder().build();
+ * LogSink response = configClient.createSink(parent.toString(), sink);
+ * }
+ *
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void deleteSink(DeleteSinkRequest request) {
- deleteSinkCallable().call(request);
+ public final LogSink createSink(CreateSinkRequest request) {
+ return createSinkCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a sink that exports specified log entries to a destination. The export of
+ * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not
+ * permitted to write to the destination. A sink can export log entries only from the resource
+ * owning the sink.
+ *
+ *
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * LogSink sink = LogSink.newBuilder().build();
+ * CreateSinkRequest request = CreateSinkRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setSink(sink)
* .build();
- * configClient.deleteSink(request);
+ * LogSink response = configClient.createSink(request);
* }
*
+ */
+ public final UnaryCallable
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * LogSink sink = LogSink.newBuilder().build();
+ * CreateSinkRequest request = CreateSinkRequest.newBuilder()
+ * .setParent(parent.toString())
+ * .setSink(sink)
+ * .build();
+ * ApiFuture<LogSink> future = configClient.createSinkCallable().futureCall(request);
+ * // Do something
+ * LogSink response = future.get();
+ * }
+ *
+ *
+ * @param parent Required. The parent resource whose exclusions are to be listed.
+ *
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. The parent resource whose exclusions are to be listed.
+ *
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. The parent resource whose exclusions are to be listed.
+ *
* try (ConfigClient configClient = ConfigClient.create()) {
- * SinkName sinkName = ProjectSinkName.of("[PROJECT]", "[SINK]");
- * DeleteSinkRequest request = DeleteSinkRequest.newBuilder()
- * .setSinkName(sinkName.toString())
- * .build();
- * ApiFuture<Void> future = configClient.deleteSinkCallable().futureCall(request);
- * // Do something
- * future.get();
+ * FolderName parent = FolderName.of("[FOLDER]");
+ * for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
* try (ConfigClient configClient = ConfigClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
* for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
* // doThingsWith(element);
* }
@@ -878,7 +1606,7 @@ public final UnaryCallable
* try (ConfigClient configClient = ConfigClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * ProjectName parent = ProjectName.of("[PROJECT]");
* for (LogExclusion element : configClient.listExclusions(parent.toString()).iterateAll()) {
* // doThingsWith(element);
* }
@@ -919,7 +1647,7 @@ public final ListExclusionsPagedResponse listExclusions(String parent) {
*
*
* try (ConfigClient configClient = ConfigClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * ProjectName parent = ProjectName.of("[PROJECT]");
* ListExclusionsRequest request = ListExclusionsRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -944,7 +1672,7 @@ public final ListExclusionsPagedResponse listExclusions(ListExclusionsRequest re
*
*
* try (ConfigClient configClient = ConfigClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * ProjectName parent = ProjectName.of("[PROJECT]");
* ListExclusionsRequest request = ListExclusionsRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -969,7 +1697,7 @@ public final ListExclusionsPagedResponse listExclusions(ListExclusionsRequest re
*
*
* try (ConfigClient configClient = ConfigClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * ProjectName parent = ProjectName.of("[PROJECT]");
* ListExclusionsRequest request = ListExclusionsRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -1001,7 +1729,7 @@ public final ListExclusionsPagedResponse listExclusions(ListExclusionsRequest re
*
*
@@ -1014,7 +1742,7 @@ public final ListExclusionsPagedResponse listExclusions(ListExclusionsRequest re
*
* try (ConfigClient configClient = ConfigClient.create()) {
- * ExclusionName name = ProjectExclusionName.of("[PROJECT]", "[EXCLUSION]");
+ * LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
* LogExclusion response = configClient.getExclusion(name);
* }
*
@@ -1054,7 +1782,7 @@ public final LogExclusion getExclusion(String name) {
*
*
* try (ConfigClient configClient = ConfigClient.create()) {
- * ExclusionName name = ProjectExclusionName.of("[PROJECT]", "[EXCLUSION]");
+ * LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
* LogExclusion response = configClient.getExclusion(name.toString());
* }
*
* try (ConfigClient configClient = ConfigClient.create()) {
- * ExclusionName name = ProjectExclusionName.of("[PROJECT]", "[EXCLUSION]");
+ * LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
* GetExclusionRequest request = GetExclusionRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -1077,7 +1805,7 @@ public final LogExclusion getExclusion(GetExclusionRequest request) {
*
*
* try (ConfigClient configClient = ConfigClient.create()) {
- * ExclusionName name = ProjectExclusionName.of("[PROJECT]", "[EXCLUSION]");
+ * LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
* GetExclusionRequest request = GetExclusionRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -1100,7 +1828,103 @@ public final UnaryCallable
+ *
+ * @param parent Required. The parent resource in which to create the exclusion:
+ *
* try (ConfigClient configClient = ConfigClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * LogExclusion exclusion = LogExclusion.newBuilder().build();
+ * LogExclusion response = configClient.createExclusion(parent, exclusion);
+ * }
+ *
+ *
+ * @param parent Required. The parent resource in which to create the exclusion:
+ *
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * LogExclusion exclusion = LogExclusion.newBuilder().build();
+ * LogExclusion response = configClient.createExclusion(parent, exclusion);
+ * }
+ *
+ *
+ * @param parent Required. The parent resource in which to create the exclusion:
+ *
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * FolderName parent = FolderName.of("[FOLDER]");
+ * LogExclusion exclusion = LogExclusion.newBuilder().build();
+ * LogExclusion response = configClient.createExclusion(parent, exclusion);
+ * }
+ *
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ * BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
* LogExclusion exclusion = LogExclusion.newBuilder().build();
* LogExclusion response = configClient.createExclusion(parent, exclusion);
* }
@@ -1114,7 +1938,7 @@ public final UnaryCallable
* try (ConfigClient configClient = ConfigClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * ProjectName parent = ProjectName.of("[PROJECT]");
* LogExclusion exclusion = LogExclusion.newBuilder().build();
* LogExclusion response = configClient.createExclusion(parent.toString(), exclusion);
* }
@@ -1161,7 +1985,7 @@ public final LogExclusion createExclusion(String parent, LogExclusion exclusion)
*
*
* try (ConfigClient configClient = ConfigClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * ProjectName parent = ProjectName.of("[PROJECT]");
* LogExclusion exclusion = LogExclusion.newBuilder().build();
* CreateExclusionRequest request = CreateExclusionRequest.newBuilder()
* .setParent(parent.toString())
@@ -1187,7 +2011,7 @@ public final LogExclusion createExclusion(CreateExclusionRequest request) {
*
*
* try (ConfigClient configClient = ConfigClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * ProjectName parent = ProjectName.of("[PROJECT]");
* LogExclusion exclusion = LogExclusion.newBuilder().build();
* CreateExclusionRequest request = CreateExclusionRequest.newBuilder()
* .setParent(parent.toString())
@@ -1211,7 +2035,7 @@ public final UnaryCallable
* try (ConfigClient configClient = ConfigClient.create()) {
- * ExclusionName name = ProjectExclusionName.of("[PROJECT]", "[EXCLUSION]");
+ * LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
* LogExclusion exclusion = LogExclusion.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* LogExclusion response = configClient.updateExclusion(name, exclusion, updateMask);
@@ -1235,7 +2059,7 @@ public final UnaryCallable
* try (ConfigClient configClient = ConfigClient.create()) {
- * ExclusionName name = ProjectExclusionName.of("[PROJECT]", "[EXCLUSION]");
+ * LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
* LogExclusion exclusion = LogExclusion.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* LogExclusion response = configClient.updateExclusion(name.toString(), exclusion, updateMask);
@@ -1295,7 +2119,7 @@ public final LogExclusion updateExclusion(
*
*
* try (ConfigClient configClient = ConfigClient.create()) {
- * ExclusionName name = ProjectExclusionName.of("[PROJECT]", "[EXCLUSION]");
+ * LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
* LogExclusion exclusion = LogExclusion.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* UpdateExclusionRequest request = UpdateExclusionRequest.newBuilder()
@@ -1322,7 +2146,7 @@ public final LogExclusion updateExclusion(UpdateExclusionRequest request) {
*
*
* try (ConfigClient configClient = ConfigClient.create()) {
- * ExclusionName name = ProjectExclusionName.of("[PROJECT]", "[EXCLUSION]");
+ * LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
* LogExclusion exclusion = LogExclusion.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* UpdateExclusionRequest request = UpdateExclusionRequest.newBuilder()
@@ -1340,104 +2164,6 @@ public final UnaryCallable
- *
- * @param name Required. The resource name of an existing exclusion to delete:
- *
- * try (ConfigClient configClient = ConfigClient.create()) {
- * ExclusionName name = ProjectExclusionName.of("[PROJECT]", "[EXCLUSION]");
- * configClient.deleteExclusion(name);
- * }
- *
- *
- * @param name Required. The resource name of an existing exclusion to delete:
- *
- * try (ConfigClient configClient = ConfigClient.create()) {
- * ExclusionName name = ProjectExclusionName.of("[PROJECT]", "[EXCLUSION]");
- * configClient.deleteExclusion(name.toString());
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteExclusion(DeleteExclusionRequest request) {
- deleteExclusionCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes an exclusion.
- *
- *
- * try (ConfigClient configClient = ConfigClient.create()) {
- * ExclusionName name = ProjectExclusionName.of("[PROJECT]", "[EXCLUSION]");
- * DeleteExclusionRequest request = DeleteExclusionRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * configClient.deleteExclusion(request);
- * }
- *
- */
- public final UnaryCallable
- * try (ConfigClient configClient = ConfigClient.create()) {
- * ExclusionName name = ProjectExclusionName.of("[PROJECT]", "[EXCLUSION]");
- * DeleteExclusionRequest request = DeleteExclusionRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = configClient.deleteExclusionCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
@@ -1471,14 +2200,17 @@ public final CmekSettings getCmekSettings(GetCmekSettingsRequest request) {
*
* try (ConfigClient configClient = ConfigClient.create()) {
- * GetCmekSettingsRequest request = GetCmekSettingsRequest.newBuilder().build();
+ * CmekSettingsName name = CmekSettingsName.ofProjectCmekSettingsName("[PROJECT]");
+ * GetCmekSettingsRequest request = GetCmekSettingsRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
* CmekSettings response = configClient.getCmekSettings(request);
* }
*
* try (ConfigClient configClient = ConfigClient.create()) {
- * GetCmekSettingsRequest request = GetCmekSettingsRequest.newBuilder().build();
+ * CmekSettingsName name = CmekSettingsName.ofProjectCmekSettingsName("[PROJECT]");
+ * GetCmekSettingsRequest request = GetCmekSettingsRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
* ApiFuture<CmekSettings> future = configClient.getCmekSettingsCallable().futureCall(request);
* // Do something
* CmekSettings response = future.get();
@@ -1501,14 +2233,19 @@ public final UnaryCallable
@@ -1532,14 +2269,19 @@ public final CmekSettings updateCmekSettings(UpdateCmekSettingsRequest request)
* `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or 3) access to the key
* is disabled.
*
- *
* try (ConfigClient configClient = ConfigClient.create()) {
- * UpdateCmekSettingsRequest request = UpdateCmekSettingsRequest.newBuilder().build();
+ * String name = "";
+ * CmekSettings cmekSettings = CmekSettings.newBuilder().build();
+ * UpdateCmekSettingsRequest request = UpdateCmekSettingsRequest.newBuilder()
+ * .setName(name)
+ * .setCmekSettings(cmekSettings)
+ * .build();
* CmekSettings response = configClient.updateCmekSettings(request);
* }
*
* try (ConfigClient configClient = ConfigClient.create()) {
- * UpdateCmekSettingsRequest request = UpdateCmekSettingsRequest.newBuilder().build();
+ * String name = "";
+ * CmekSettings cmekSettings = CmekSettings.newBuilder().build();
+ * UpdateCmekSettingsRequest request = UpdateCmekSettingsRequest.newBuilder()
+ * .setName(name)
+ * .setCmekSettings(cmekSettings)
+ * .build();
* ApiFuture<CmekSettings> future = configClient.updateCmekSettingsCallable().futureCall(request);
* // Do something
* CmekSettings response = future.get();
@@ -1580,6 +2322,86 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted
return stub.awaitTermination(duration, unit);
}
+ public static class ListBucketsPagedResponse
+ extends AbstractPagedListResponse<
+ ListBucketsRequest,
+ ListBucketsResponse,
+ LogBucket,
+ ListBucketsPage,
+ ListBucketsFixedSizeCollection> {
+
+ public static ApiFuture
*
* ConfigSettings.Builder configSettingsBuilder =
* ConfigSettings.newBuilder();
* configSettingsBuilder
- * .getSinkSettings()
+ * .deleteSinkSettings()
* .setRetrySettings(
- * configSettingsBuilder.getSinkSettings().getRetrySettings().toBuilder()
+ * configSettingsBuilder.deleteSinkSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* ConfigSettings configSettings = configSettingsBuilder.build();
@@ -86,6 +92,37 @@
@Generated("by gapic-generator")
@BetaApi
public class ConfigSettings extends ClientSettings
*
* try (LoggingClient loggingClient = LoggingClient.create()) {
- * LogName logName = ProjectLogName.of("[PROJECT]", "[LOG]");
+ * LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
* loggingClient.deleteLog(logName);
* }
*
@@ -177,7 +180,7 @@ public LoggingServiceV2Stub getStub() {
*
*
@@ -208,7 +211,7 @@ public final void deleteLog(LogName logName) {
*
*
* try (LoggingClient loggingClient = LoggingClient.create()) {
- * LogName logName = ProjectLogName.of("[PROJECT]", "[LOG]");
+ * LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
* loggingClient.deleteLog(logName);
* }
*
@@ -236,7 +239,7 @@ public final void deleteLog(String logName) {
*
*
* try (LoggingClient loggingClient = LoggingClient.create()) {
- * LogName logName = ProjectLogName.of("[PROJECT]", "[LOG]");
+ * LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
* loggingClient.deleteLog(logName.toString());
* }
*
* try (LoggingClient loggingClient = LoggingClient.create()) {
- * LogName logName = ProjectLogName.of("[PROJECT]", "[LOG]");
+ * LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
* DeleteLogRequest request = DeleteLogRequest.newBuilder()
* .setLogName(logName.toString())
* .build();
@@ -261,7 +264,7 @@ public final void deleteLog(DeleteLogRequest request) {
*
*
* try (LoggingClient loggingClient = LoggingClient.create()) {
- * LogName logName = ProjectLogName.of("[PROJECT]", "[LOG]");
+ * LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
* DeleteLogRequest request = DeleteLogRequest.newBuilder()
* .setLogName(logName.toString())
* .build();
@@ -275,6 +278,142 @@ public final UnaryCallable
+ *
+ * @param resourceNames Required. Names of one or more parent resources from which to retrieve log
+ * entries:
+ *
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * List<String> formattedResourceNames = new ArrayList<>();
+ * String filter = "";
+ * String orderBy = "";
+ * for (LogEntry element : loggingClient.listLogEntries(formattedResourceNames, filter, orderBy).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListLogEntriesPagedResponse listLogEntries(ListLogEntriesRequest request) {
+ return listLogEntriesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists log entries. Use this method to retrieve log entries that originated from a
+ * project/folder/organization/billing account. For ways to export log entries, see [Exporting
+ * Logs](https://cloud.google.com/logging/docs/export).
+ *
+ *
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * List<ProjectName> resourceNames = new ArrayList<>();
+ * ListLogEntriesRequest request = ListLogEntriesRequest.newBuilder()
+ * .addAllResourceNames(ProjectName.toStringList(resourceNames))
+ * .build();
+ * for (LogEntry element : loggingClient.listLogEntries(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * List<ProjectName> resourceNames = new ArrayList<>();
+ * ListLogEntriesRequest request = ListLogEntriesRequest.newBuilder()
+ * .addAllResourceNames(ProjectName.toStringList(resourceNames))
+ * .build();
+ * ApiFuture<ListLogEntriesPagedResponse> future = loggingClient.listLogEntriesPagedCallable().futureCall(request);
+ * // Do something
+ * for (LogEntry element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ * List<ProjectName> resourceNames = new ArrayList<>();
+ * ListLogEntriesRequest request = ListLogEntriesRequest.newBuilder()
+ * .addAllResourceNames(ProjectName.toStringList(resourceNames))
+ * .build();
+ * while (true) {
+ * ListLogEntriesResponse response = loggingClient.listLogEntriesCallable().call(request);
+ * for (LogEntry element : response.getEntriesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ *
* try (LoggingClient loggingClient = LoggingClient.create()) {
- * LogName logName = ProjectLogName.of("[PROJECT]", "[LOG]");
+ * LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
* MonitoredResource resource = MonitoredResource.newBuilder().build();
* Map<String, String> labels = new HashMap<>();
* List<LogEntry> entries = new ArrayList<>();
@@ -301,10 +440,9 @@ public final UnaryCallable
* try (LoggingClient loggingClient = LoggingClient.create()) {
- * LogName logName = ProjectLogName.of("[PROJECT]", "[LOG]");
+ * LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
* MonitoredResource resource = MonitoredResource.newBuilder().build();
* Map<String, String> labels = new HashMap<>();
* List<LogEntry> entries = new ArrayList<>();
@@ -374,10 +514,9 @@ public final WriteLogEntriesResponse writeLogEntries(
*
- *
- * @param resourceNames Required. Names of one or more parent resources from which to retrieve log
- * entries:
- *
- * try (LoggingClient loggingClient = LoggingClient.create()) {
- * List<String> formattedResourceNames = new ArrayList<>();
- * String filter = "";
- * String orderBy = "";
- * for (LogEntry element : loggingClient.listLogEntries(formattedResourceNames, filter, orderBy).iterateAll()) {
- * // doThingsWith(element);
- * }
- * }
- *
* try (LoggingClient loggingClient = LoggingClient.create()) {
- * List<ParentName> resourceNames = new ArrayList<>();
- * ListLogEntriesRequest request = ListLogEntriesRequest.newBuilder()
- * .addAllResourceNames(ParentName.toStringList(resourceNames))
- * .build();
- * for (LogEntry element : loggingClient.listLogEntries(request).iterateAll()) {
+ * ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder().build();
+ * for (MonitoredResourceDescriptor element : loggingClient.listMonitoredResourceDescriptors(request).iterateAll()) {
* // doThingsWith(element);
* }
* }
@@ -544,54 +632,46 @@ public final ListLogEntriesPagedResponse listLogEntries(
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListLogEntriesPagedResponse listLogEntries(ListLogEntriesRequest request) {
- return listLogEntriesPagedCallable().call(request);
+ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResourceDescriptors(
+ ListMonitoredResourceDescriptorsRequest request) {
+ return listMonitoredResourceDescriptorsPagedCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Lists log entries. Use this method to retrieve log entries that originated from a
- * project/folder/organization/billing account. For ways to export log entries, see [Exporting
- * Logs](/logging/docs/export).
+ * Lists the descriptors for monitored resource types used by Logging.
*
*
*/
- public final UnaryCallable
* try (LoggingClient loggingClient = LoggingClient.create()) {
- * List<ParentName> resourceNames = new ArrayList<>();
- * ListLogEntriesRequest request = ListLogEntriesRequest.newBuilder()
- * .addAllResourceNames(ParentName.toStringList(resourceNames))
- * .build();
- * ApiFuture<ListLogEntriesPagedResponse> future = loggingClient.listLogEntriesPagedCallable().futureCall(request);
+ * ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder().build();
+ * ApiFuture<ListMonitoredResourceDescriptorsPagedResponse> future = loggingClient.listMonitoredResourceDescriptorsPagedCallable().futureCall(request);
* // Do something
- * for (LogEntry element : future.get().iterateAll()) {
+ * for (MonitoredResourceDescriptor element : future.get().iterateAll()) {
* // doThingsWith(element);
* }
* }
*
*/
- public final UnaryCallable
* try (LoggingClient loggingClient = LoggingClient.create()) {
- * List<ParentName> resourceNames = new ArrayList<>();
- * ListLogEntriesRequest request = ListLogEntriesRequest.newBuilder()
- * .addAllResourceNames(ParentName.toStringList(resourceNames))
- * .build();
+ * ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder().build();
* while (true) {
- * ListLogEntriesResponse response = loggingClient.listLogEntriesCallable().call(request);
- * for (LogEntry element : response.getEntriesList()) {
+ * ListMonitoredResourceDescriptorsResponse response = loggingClient.listMonitoredResourceDescriptorsCallable().call(request);
+ * for (MonitoredResourceDescriptor element : response.getResourceDescriptorsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -604,85 +684,91 @@ public final ListLogEntriesPagedResponse listLogEntries(ListLogEntriesRequest re
* }
*
*
- * @param request The request object containing all of the parameters for the API call.
+ * @param parent Required. The resource name that owns the logs:
+ *
* try (LoggingClient loggingClient = LoggingClient.create()) {
- * ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder().build();
- * for (MonitoredResourceDescriptor element : loggingClient.listMonitoredResourceDescriptors(request).iterateAll()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * for (String element : loggingClient.listLogs(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
*
+ *
+ * @param parent Required. The resource name that owns the logs:
+ *
* try (LoggingClient loggingClient = LoggingClient.create()) {
- * ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder().build();
- * ApiFuture<ListMonitoredResourceDescriptorsPagedResponse> future = loggingClient.listMonitoredResourceDescriptorsPagedCallable().futureCall(request);
- * // Do something
- * for (MonitoredResourceDescriptor element : future.get().iterateAll()) {
+ * OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+ * for (String element : loggingClient.listLogs(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
*
+ *
+ * @param parent Required. The resource name that owns the logs:
+ *
* try (LoggingClient loggingClient = LoggingClient.create()) {
- * ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder().build();
- * while (true) {
- * ListMonitoredResourceDescriptorsResponse response = loggingClient.listMonitoredResourceDescriptorsCallable().call(request);
- * for (MonitoredResourceDescriptor element : response.getResourceDescriptorsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
+ * FolderName parent = FolderName.of("[FOLDER]");
+ * for (String element : loggingClient.listLogs(parent).iterateAll()) {
+ * // doThingsWith(element);
* }
* }
*
* try (LoggingClient loggingClient = LoggingClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
* for (String element : loggingClient.listLogs(parent).iterateAll()) {
* // doThingsWith(element);
* }
@@ -706,7 +792,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
* "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListLogsPagedResponse listLogs(ParentName parent) {
+ public final ListLogsPagedResponse listLogs(BillingAccountName parent) {
ListLogsRequest request =
ListLogsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
return listLogs(request);
@@ -721,7 +807,7 @@ public final ListLogsPagedResponse listLogs(ParentName parent) {
*
*
* try (LoggingClient loggingClient = LoggingClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * ProjectName parent = ProjectName.of("[PROJECT]");
* for (String element : loggingClient.listLogs(parent.toString()).iterateAll()) {
* // doThingsWith(element);
* }
@@ -747,7 +833,7 @@ public final ListLogsPagedResponse listLogs(String parent) {
*
*
* try (LoggingClient loggingClient = LoggingClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * ProjectName parent = ProjectName.of("[PROJECT]");
* ListLogsRequest request = ListLogsRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -773,7 +859,7 @@ public final ListLogsPagedResponse listLogs(ListLogsRequest request) {
*
*
* try (LoggingClient loggingClient = LoggingClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * ProjectName parent = ProjectName.of("[PROJECT]");
* ListLogsRequest request = ListLogsRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -798,7 +884,7 @@ public final UnaryCallable
* try (LoggingClient loggingClient = LoggingClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * ProjectName parent = ProjectName.of("[PROJECT]");
* ListLogsRequest request = ListLogsRequest.newBuilder()
* .setParent(parent.toString())
* .build();
diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingSettings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingSettings.java
index e1f26543c..ac0a7ff6e 100644
--- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingSettings.java
+++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingSettings.java
@@ -85,12 +85,6 @@ public UnaryCallSettings
*
@@ -161,6 +162,207 @@ public MetricsServiceV2Stub getStub() {
return stub;
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates or updates a logs-based metric.
+ *
+ *
* try (MetricsClient metricsClient = MetricsClient.create()) {
- * MetricName metricName = ProjectMetricName.of("[PROJECT]", "[METRIC]");
- * LogMetric response = metricsClient.getLogMetric(metricName);
+ * LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+ * LogMetric metric = LogMetric.newBuilder().build();
+ * LogMetric response = metricsClient.updateLogMetric(metricName, metric);
* }
*
*
+ *
+ * @param metricName Required. The resource name of the metric to update:
+ *
+ * try (MetricsClient metricsClient = MetricsClient.create()) {
+ * LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+ * LogMetric metric = LogMetric.newBuilder().build();
+ * LogMetric response = metricsClient.updateLogMetric(metricName, metric);
+ * }
+ *
+ *
+ * @param metricName Required. The resource name of the metric to update:
+ *
+ * try (MetricsClient metricsClient = MetricsClient.create()) {
+ * LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+ * LogMetric metric = LogMetric.newBuilder().build();
+ * LogMetric response = metricsClient.updateLogMetric(metricName.toString(), metric);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final LogMetric updateLogMetric(UpdateLogMetricRequest request) {
+ return updateLogMetricCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates or updates a logs-based metric.
+ *
+ *
+ * try (MetricsClient metricsClient = MetricsClient.create()) {
+ * LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+ * LogMetric metric = LogMetric.newBuilder().build();
+ * UpdateLogMetricRequest request = UpdateLogMetricRequest.newBuilder()
+ * .setMetricName(metricName.toString())
+ * .setMetric(metric)
+ * .build();
+ * LogMetric response = metricsClient.updateLogMetric(request);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (MetricsClient metricsClient = MetricsClient.create()) {
+ * LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+ * LogMetric metric = LogMetric.newBuilder().build();
+ * UpdateLogMetricRequest request = UpdateLogMetricRequest.newBuilder()
+ * .setMetricName(metricName.toString())
+ * .setMetric(metric)
+ * .build();
+ * ApiFuture<LogMetric> future = metricsClient.updateLogMetricCallable().futureCall(request);
+ * // Do something
+ * LogMetric response = future.get();
+ * }
+ *
+ *
+ * @param metricName Required. The resource name of the metric to delete:
+ *
+ * try (MetricsClient metricsClient = MetricsClient.create()) {
+ * LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+ * metricsClient.deleteLogMetric(metricName);
+ * }
+ *
+ *
+ * @param metricName Required. The resource name of the metric to delete:
+ *
+ * try (MetricsClient metricsClient = MetricsClient.create()) {
+ * LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+ * metricsClient.deleteLogMetric(metricName.toString());
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteLogMetric(DeleteLogMetricRequest request) {
+ deleteLogMetricCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a logs-based metric.
+ *
+ *
+ * try (MetricsClient metricsClient = MetricsClient.create()) {
+ * LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+ * DeleteLogMetricRequest request = DeleteLogMetricRequest.newBuilder()
+ * .setMetricName(metricName.toString())
+ * .build();
+ * metricsClient.deleteLogMetric(request);
+ * }
+ *
+ */
+ public final UnaryCallable
+ * try (MetricsClient metricsClient = MetricsClient.create()) {
+ * LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+ * DeleteLogMetricRequest request = DeleteLogMetricRequest.newBuilder()
+ * .setMetricName(metricName.toString())
+ * .build();
+ * ApiFuture<Void> future = metricsClient.deleteLogMetricCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
* try (MetricsClient metricsClient = MetricsClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * ProjectName parent = ProjectName.of("[PROJECT]");
* for (LogMetric element : metricsClient.listLogMetrics(parent).iterateAll()) {
* // doThingsWith(element);
* }
@@ -180,7 +382,7 @@ public MetricsServiceV2Stub getStub() {
*
* try (MetricsClient metricsClient = MetricsClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * ProjectName parent = ProjectName.of("[PROJECT]");
* for (LogMetric element : metricsClient.listLogMetrics(parent.toString()).iterateAll()) {
* // doThingsWith(element);
* }
@@ -220,7 +422,7 @@ public final ListLogMetricsPagedResponse listLogMetrics(String parent) {
*
*
* try (MetricsClient metricsClient = MetricsClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * ProjectName parent = ProjectName.of("[PROJECT]");
* ListLogMetricsRequest request = ListLogMetricsRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -245,7 +447,7 @@ public final ListLogMetricsPagedResponse listLogMetrics(ListLogMetricsRequest re
*
*
* try (MetricsClient metricsClient = MetricsClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * ProjectName parent = ProjectName.of("[PROJECT]");
* ListLogMetricsRequest request = ListLogMetricsRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -270,7 +472,7 @@ public final ListLogMetricsPagedResponse listLogMetrics(ListLogMetricsRequest re
*
*
* try (MetricsClient metricsClient = MetricsClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * ProjectName parent = ProjectName.of("[PROJECT]");
* ListLogMetricsRequest request = ListLogMetricsRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -302,7 +504,7 @@ public final ListLogMetricsPagedResponse listLogMetrics(ListLogMetricsRequest re
*
*
@@ -311,7 +513,7 @@ public final ListLogMetricsPagedResponse listLogMetrics(ListLogMetricsRequest re
*
* try (MetricsClient metricsClient = MetricsClient.create()) {
- * MetricName metricName = ProjectMetricName.of("[PROJECT]", "[METRIC]");
+ * LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
* LogMetric response = metricsClient.getLogMetric(metricName);
* }
*
@@ -350,7 +552,7 @@ public final LogMetric getLogMetric(String metricName) {
*
*
* try (MetricsClient metricsClient = MetricsClient.create()) {
- * MetricName metricName = ProjectMetricName.of("[PROJECT]", "[METRIC]");
+ * LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
* LogMetric response = metricsClient.getLogMetric(metricName.toString());
* }
*
* try (MetricsClient metricsClient = MetricsClient.create()) {
- * MetricName metricName = ProjectMetricName.of("[PROJECT]", "[METRIC]");
+ * LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
* GetLogMetricRequest request = GetLogMetricRequest.newBuilder()
* .setMetricName(metricName.toString())
* .build();
@@ -373,7 +575,7 @@ public final LogMetric getLogMetric(GetLogMetricRequest request) {
*
*
* try (MetricsClient metricsClient = MetricsClient.create()) {
- * MetricName metricName = ProjectMetricName.of("[PROJECT]", "[METRIC]");
+ * LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
* GetLogMetricRequest request = GetLogMetricRequest.newBuilder()
* .setMetricName(metricName.toString())
* .build();
@@ -395,7 +597,7 @@ public final UnaryCallable
* try (MetricsClient metricsClient = MetricsClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * ProjectName parent = ProjectName.of("[PROJECT]");
* LogMetric metric = LogMetric.newBuilder().build();
* LogMetric response = metricsClient.createLogMetric(parent, metric);
* }
@@ -408,7 +610,7 @@ public final UnaryCallable
* try (MetricsClient metricsClient = MetricsClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * ProjectName parent = ProjectName.of("[PROJECT]");
* LogMetric metric = LogMetric.newBuilder().build();
* LogMetric response = metricsClient.createLogMetric(parent.toString(), metric);
* }
@@ -452,7 +654,7 @@ public final LogMetric createLogMetric(String parent, LogMetric metric) {
*
*
* try (MetricsClient metricsClient = MetricsClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * ProjectName parent = ProjectName.of("[PROJECT]");
* LogMetric metric = LogMetric.newBuilder().build();
* CreateLogMetricRequest request = CreateLogMetricRequest.newBuilder()
* .setParent(parent.toString())
@@ -477,7 +679,7 @@ public final LogMetric createLogMetric(CreateLogMetricRequest request) {
*
*
* try (MetricsClient metricsClient = MetricsClient.create()) {
- * ParentName parent = ProjectName.of("[PROJECT]");
+ * ProjectName parent = ProjectName.of("[PROJECT]");
* LogMetric metric = LogMetric.newBuilder().build();
* CreateLogMetricRequest request = CreateLogMetricRequest.newBuilder()
* .setParent(parent.toString())
@@ -493,207 +695,6 @@ public final UnaryCallable
- *
- * @param metricName Required. The resource name of the metric to update:
- *
- * try (MetricsClient metricsClient = MetricsClient.create()) {
- * MetricName metricName = ProjectMetricName.of("[PROJECT]", "[METRIC]");
- * LogMetric metric = LogMetric.newBuilder().build();
- * LogMetric response = metricsClient.updateLogMetric(metricName, metric);
- * }
- *
- *
- * @param metricName Required. The resource name of the metric to update:
- *
- * try (MetricsClient metricsClient = MetricsClient.create()) {
- * MetricName metricName = ProjectMetricName.of("[PROJECT]", "[METRIC]");
- * LogMetric metric = LogMetric.newBuilder().build();
- * LogMetric response = metricsClient.updateLogMetric(metricName.toString(), metric);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final LogMetric updateLogMetric(UpdateLogMetricRequest request) {
- return updateLogMetricCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates or updates a logs-based metric.
- *
- *
- * try (MetricsClient metricsClient = MetricsClient.create()) {
- * MetricName metricName = ProjectMetricName.of("[PROJECT]", "[METRIC]");
- * LogMetric metric = LogMetric.newBuilder().build();
- * UpdateLogMetricRequest request = UpdateLogMetricRequest.newBuilder()
- * .setMetricName(metricName.toString())
- * .setMetric(metric)
- * .build();
- * LogMetric response = metricsClient.updateLogMetric(request);
- * }
- *
- */
- public final UnaryCallable
- * try (MetricsClient metricsClient = MetricsClient.create()) {
- * MetricName metricName = ProjectMetricName.of("[PROJECT]", "[METRIC]");
- * LogMetric metric = LogMetric.newBuilder().build();
- * UpdateLogMetricRequest request = UpdateLogMetricRequest.newBuilder()
- * .setMetricName(metricName.toString())
- * .setMetric(metric)
- * .build();
- * ApiFuture<LogMetric> future = metricsClient.updateLogMetricCallable().futureCall(request);
- * // Do something
- * LogMetric response = future.get();
- * }
- *
- *
- * @param metricName Required. The resource name of the metric to delete:
- *
- * try (MetricsClient metricsClient = MetricsClient.create()) {
- * MetricName metricName = ProjectMetricName.of("[PROJECT]", "[METRIC]");
- * metricsClient.deleteLogMetric(metricName);
- * }
- *
- *
- * @param metricName Required. The resource name of the metric to delete:
- *
- * try (MetricsClient metricsClient = MetricsClient.create()) {
- * MetricName metricName = ProjectMetricName.of("[PROJECT]", "[METRIC]");
- * metricsClient.deleteLogMetric(metricName.toString());
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteLogMetric(DeleteLogMetricRequest request) {
- deleteLogMetricCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes a logs-based metric.
- *
- *
- * try (MetricsClient metricsClient = MetricsClient.create()) {
- * MetricName metricName = ProjectMetricName.of("[PROJECT]", "[METRIC]");
- * DeleteLogMetricRequest request = DeleteLogMetricRequest.newBuilder()
- * .setMetricName(metricName.toString())
- * .build();
- * metricsClient.deleteLogMetric(request);
- * }
- *
- */
- public final UnaryCallable
- * try (MetricsClient metricsClient = MetricsClient.create()) {
- * MetricName metricName = ProjectMetricName.of("[PROJECT]", "[METRIC]");
- * DeleteLogMetricRequest request = DeleteLogMetricRequest.newBuilder()
- * .setMetricName(metricName.toString())
- * .build();
- * ApiFuture<Void> future = metricsClient.deleteLogMetricCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
*
* MetricsSettings.Builder metricsSettingsBuilder =
* MetricsSettings.newBuilder();
* metricsSettingsBuilder
- * .getLogMetricSettings()
+ * .updateLogMetricSettings()
* .setRetrySettings(
- * metricsSettingsBuilder.getLogMetricSettings().getRetrySettings().toBuilder()
+ * metricsSettingsBuilder.updateLogMetricSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* MetricsSettings metricsSettings = metricsSettingsBuilder.build();
@@ -75,6 +75,16 @@
@Generated("by gapic-generator")
@BetaApi
public class MetricsSettings extends ClientSettings
*
@@ -43,7 +43,7 @@
*
* try (ConfigClient configClient = ConfigClient.create()) {
- * SinkName sinkName = ProjectSinkName.of("[PROJECT]", "[SINK]");
- * LogSink response = configClient.getSink(sinkName);
+ * LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+ * configClient.deleteSink(sinkName);
* }
*
*
*
* try (LoggingClient loggingClient = LoggingClient.create()) {
- * LogName logName = ProjectLogName.of("[PROJECT]", "[LOG]");
+ * LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
* loggingClient.deleteLog(logName);
* }
*
@@ -58,8 +58,9 @@
*
*
diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java
index 703a3521a..146eb3f37 100644
--- a/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java
+++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java
@@ -15,6 +15,7 @@
*/
package com.google.cloud.logging.v2.stub;
+import static com.google.cloud.logging.v2.ConfigClient.ListBucketsPagedResponse;
import static com.google.cloud.logging.v2.ConfigClient.ListExclusionsPagedResponse;
import static com.google.cloud.logging.v2.ConfigClient.ListSinksPagedResponse;
@@ -26,15 +27,20 @@
import com.google.logging.v2.CreateSinkRequest;
import com.google.logging.v2.DeleteExclusionRequest;
import com.google.logging.v2.DeleteSinkRequest;
+import com.google.logging.v2.GetBucketRequest;
import com.google.logging.v2.GetCmekSettingsRequest;
import com.google.logging.v2.GetExclusionRequest;
import com.google.logging.v2.GetSinkRequest;
+import com.google.logging.v2.ListBucketsRequest;
+import com.google.logging.v2.ListBucketsResponse;
import com.google.logging.v2.ListExclusionsRequest;
import com.google.logging.v2.ListExclusionsResponse;
import com.google.logging.v2.ListSinksRequest;
import com.google.logging.v2.ListSinksResponse;
+import com.google.logging.v2.LogBucket;
import com.google.logging.v2.LogExclusion;
import com.google.logging.v2.LogSink;
+import com.google.logging.v2.UpdateBucketRequest;
import com.google.logging.v2.UpdateCmekSettingsRequest;
import com.google.logging.v2.UpdateExclusionRequest;
import com.google.logging.v2.UpdateSinkRequest;
@@ -51,6 +57,34 @@
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public abstract class ConfigServiceV2Stub implements BackgroundResource {
+ public UnaryCallable
* try (MetricsClient metricsClient = MetricsClient.create()) {
- * MetricName metricName = ProjectMetricName.of("[PROJECT]", "[METRIC]");
- * LogMetric response = metricsClient.getLogMetric(metricName);
+ * LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+ * LogMetric metric = LogMetric.newBuilder().build();
+ * LogMetric response = metricsClient.updateLogMetric(metricName, metric);
* }
*
*
*
* ConfigServiceV2StubSettings.Builder configSettingsBuilder =
* ConfigServiceV2StubSettings.newBuilder();
* configSettingsBuilder
- * .getSinkSettings()
+ * .deleteSinkSettings()
* .setRetrySettings(
- * configSettingsBuilder.getSinkSettings().getRetrySettings().toBuilder()
+ * configSettingsBuilder.deleteSinkSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* ConfigServiceV2StubSettings configSettings = configSettingsBuilder.build();
@@ -111,23 +117,58 @@ public class ConfigServiceV2StubSettings extends StubSettings