Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Sep 16, 2023. It is now read-only.
/java-redisPublic archive

feat: [Cloud Memorystore for Redis] Support Maintenance Window#618

Merged
gcf-merge-on-green merged 6 commits intomainfromowl-bot-copy
Mar 17, 2022
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
feat: [Cloud Memorystore for Redis] Support Maintenance Window
PiperOrigin-RevId: 434820669Source-Link:googleapis/googleapis@db9aa74Source-Link:https://github.com/googleapis/googleapis-gen/commit/0cff4ff2a6d21a9501cc21e8d2f2b15cb1188730Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGNmZjRmZjJhNmQyMWE5NTAxY2MyMWU4ZDJmMmIxNWNiMTE4ODczMCJ9
  • Loading branch information
@gcf-owl-bot
gcf-owl-bot[bot] committedMar 15, 2022
commit89c1c1dcc66cab823cd788f34de19d392fe849fe
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,6 +34,7 @@
import com.google.longrunning.OperationsClient;
import com.google.protobuf.Empty;
import com.google.protobuf.FieldMask;
import com.google.protobuf.Timestamp;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
Expand All@@ -49,17 +50,17 @@
* defines the following resource model for managing Redis instances:
*
* <ul>
* <li>The service works with a collection of cloud projects, named: `/projects/&#42;`
* <li>Each project has a collection of available locations, named: `/locations/&#42;`
* <li>Each location has a collection of Redis instances, named: `/instances/&#42;`
* <li>As such, Redis instances are resources of the form:
* <li>The service works with a collection of cloud projects, named: `/projects/&#42;`
* <li>Each project has a collection of available locations, named: `/locations/&#42;`
* <li>Each location has a collection of Redis instances, named: `/instances/&#42;`
* <li>As such, Redis instances are resources of the form:
* `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
* </ul>
*
* <p>Note that location_id must be referring to a GCP `region`; for example:
*
* <ul>
* <li>`projects/redpepper-1290/locations/us-central1/instances/my-redis`
* <li>`projects/redpepper-1290/locations/us-central1/instances/my-redis`
* </ul>
*
* <p>This class provides the ability to make remote calls to the backing service through method
Expand All@@ -79,13 +80,13 @@
* methods:
*
* <ol>
* <li>A "flattened" method. With this type of method, the fields of the request type have been
* <li>A "flattened" method. With this type of method, the fields of the request type have been
* converted into function parameters. It may be the case that not all fields are available as
* parameters, and not every API method will have a flattened method entry point.
* <li>A "request object" method. This type of method only takes one parameter, a request object,
* <li>A "request object" method. This type of method only takes one parameter, a request object,
* which must be constructed before the call. Not every API method will have a request object
* method.
* <li>A "callable" method. This type of method takes no parameters and returns an immutable API
* <li>A "callable" method. This type of method takes no parameters and returns an immutable API
* callable object, which can be used to initiate calls to the service.
* </ol>
*
Expand DownExpand Up@@ -188,7 +189,7 @@ public final OperationsClient getOperationsClient() {
* <p>The location should have the following format:
*
* <ul>
* <li>`projects/{project_id}/locations/{location_id}`
* <li>`projects/{project_id}/locations/{location_id}`
* </ul>
*
* <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
Expand DownExpand Up@@ -225,7 +226,7 @@ public final ListInstancesPagedResponse listInstances(LocationName parent) {
* <p>The location should have the following format:
*
* <ul>
* <li>`projects/{project_id}/locations/{location_id}`
* <li>`projects/{project_id}/locations/{location_id}`
* </ul>
*
* <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
Expand DownExpand Up@@ -259,7 +260,7 @@ public final ListInstancesPagedResponse listInstances(String parent) {
* <p>The location should have the following format:
*
* <ul>
* <li>`projects/{project_id}/locations/{location_id}`
* <li>`projects/{project_id}/locations/{location_id}`
* </ul>
*
* <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
Expand DownExpand Up@@ -296,7 +297,7 @@ public final ListInstancesPagedResponse listInstances(ListInstancesRequest reque
* <p>The location should have the following format:
*
* <ul>
* <li>`projects/{project_id}/locations/{location_id}`
* <li>`projects/{project_id}/locations/{location_id}`
* </ul>
*
* <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
Expand DownExpand Up@@ -334,7 +335,7 @@ public final ListInstancesPagedResponse listInstances(ListInstancesRequest reque
* <p>The location should have the following format:
*
* <ul>
* <li>`projects/{project_id}/locations/{location_id}`
* <li>`projects/{project_id}/locations/{location_id}`
* </ul>
*
* <p>If `location_id` is specified as `-` (wildcard), then all regions available to the project
Expand DownExpand Up@@ -593,11 +594,11 @@ public final InstanceAuthString getInstanceAuthString(GetInstanceAuthStringReque
* @param instanceId Required. The logical name of the Redis instance in the customer project with
* the following restrictions:
* <ul>
* <li>Must contain only lowercase letters, numbers, and hyphens.
* <li>Must start with a letter.
* <li>Must be between 1-40 characters.
* <li>Must end with a number or a letter.
* <li>Must be unique within the customer project / location
* <li>Must contain only lowercase letters, numbers, and hyphens.
* <li>Must start with a letter.
* <li>Must be between 1-40 characters.
* <li>Must end with a number or a letter.
* <li>Must be unique within the customer project / location
* </ul>
*
* @param instance Required. A Redis [Instance] resource
Expand DownExpand Up@@ -645,11 +646,11 @@ public final OperationFuture<Instance, OperationMetadata> createInstanceAsync(
* @param instanceId Required. The logical name of the Redis instance in the customer project with
* the following restrictions:
* <ul>
* <li>Must contain only lowercase letters, numbers, and hyphens.
* <li>Must start with a letter.
* <li>Must be between 1-40 characters.
* <li>Must end with a number or a letter.
* <li>Must be unique within the customer project / location
* <li>Must contain only lowercase letters, numbers, and hyphens.
* <li>Must start with a letter.
* <li>Must be between 1-40 characters.
* <li>Must end with a number or a letter.
* <li>Must be unique within the customer project / location
* </ul>
*
* @param instance Required. A Redis [Instance] resource
Expand DownExpand Up@@ -1523,6 +1524,159 @@ public final UnaryCallable<DeleteInstanceRequest, Operation> deleteInstanceCalla
return stub.deleteInstanceCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Reschedule maintenance for a given instance in a given project and location.
*
* <p>Sample code:
*
* <pre>{@code
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
* InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
* RescheduleMaintenanceRequest.RescheduleType rescheduleType =
* RescheduleMaintenanceRequest.RescheduleType.forNumber(0);
* Timestamp scheduleTime = Timestamp.newBuilder().build();
* Instance response =
* cloudRedisClient.rescheduleMaintenanceAsync(name, rescheduleType, scheduleTime).get();
* }
* }</pre>
*
* @param name Required. Redis instance resource name using the form:
* `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id`
* refers to a GCP region.
* @param rescheduleType Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time
* as well.
* @param scheduleTime Optional. Timestamp when the maintenance shall be rescheduled to if
* reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for example `2012-11-15T16:19:00.094Z`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<Instance, OperationMetadata> rescheduleMaintenanceAsync(
InstanceName name,
RescheduleMaintenanceRequest.RescheduleType rescheduleType,
Timestamp scheduleTime) {
RescheduleMaintenanceRequest request =
RescheduleMaintenanceRequest.newBuilder()
.setName(name == null ? null : name.toString())
.setRescheduleType(rescheduleType)
.setScheduleTime(scheduleTime)
.build();
return rescheduleMaintenanceAsync(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Reschedule maintenance for a given instance in a given project and location.
*
* <p>Sample code:
*
* <pre>{@code
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
* String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
* RescheduleMaintenanceRequest.RescheduleType rescheduleType =
* RescheduleMaintenanceRequest.RescheduleType.forNumber(0);
* Timestamp scheduleTime = Timestamp.newBuilder().build();
* Instance response =
* cloudRedisClient.rescheduleMaintenanceAsync(name, rescheduleType, scheduleTime).get();
* }
* }</pre>
*
* @param name Required. Redis instance resource name using the form:
* `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id`
* refers to a GCP region.
* @param rescheduleType Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time
* as well.
* @param scheduleTime Optional. Timestamp when the maintenance shall be rescheduled to if
* reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for example `2012-11-15T16:19:00.094Z`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<Instance, OperationMetadata> rescheduleMaintenanceAsync(
String name,
RescheduleMaintenanceRequest.RescheduleType rescheduleType,
Timestamp scheduleTime) {
RescheduleMaintenanceRequest request =
RescheduleMaintenanceRequest.newBuilder()
.setName(name)
.setRescheduleType(rescheduleType)
.setScheduleTime(scheduleTime)
.build();
return rescheduleMaintenanceAsync(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Reschedule maintenance for a given instance in a given project and location.
*
* <p>Sample code:
*
* <pre>{@code
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
* RescheduleMaintenanceRequest request =
* RescheduleMaintenanceRequest.newBuilder()
* .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
* .setScheduleTime(Timestamp.newBuilder().build())
* .build();
* Instance response = cloudRedisClient.rescheduleMaintenanceAsync(request).get();
* }
* }</pre>
*
* @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 OperationFuture<Instance, OperationMetadata> rescheduleMaintenanceAsync(
RescheduleMaintenanceRequest request) {
return rescheduleMaintenanceOperationCallable().futureCall(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Reschedule maintenance for a given instance in a given project and location.
*
* <p>Sample code:
*
* <pre>{@code
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
* RescheduleMaintenanceRequest request =
* RescheduleMaintenanceRequest.newBuilder()
* .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
* .setScheduleTime(Timestamp.newBuilder().build())
* .build();
* OperationFuture<Instance, OperationMetadata> future =
* cloudRedisClient.rescheduleMaintenanceOperationCallable().futureCall(request);
* // Do something.
* Instance response = future.get();
* }
* }</pre>
*/
public final OperationCallable<RescheduleMaintenanceRequest, Instance, OperationMetadata>
rescheduleMaintenanceOperationCallable() {
return stub.rescheduleMaintenanceOperationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Reschedule maintenance for a given instance in a given project and location.
*
* <p>Sample code:
*
* <pre>{@code
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
* RescheduleMaintenanceRequest request =
* RescheduleMaintenanceRequest.newBuilder()
* .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
* .setScheduleTime(Timestamp.newBuilder().build())
* .build();
* ApiFuture<Operation> future =
* cloudRedisClient.rescheduleMaintenanceCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<RescheduleMaintenanceRequest, Operation>
rescheduleMaintenanceCallable() {
return stub.rescheduleMaintenanceCallable();
}

@Override
public final void close() {
stub.close();
Expand DownExpand Up@@ -1555,10 +1709,7 @@ public boolean awaitTermination(long duration, TimeUnit unit) throws Interrupted

public static class ListInstancesPagedResponse
extends AbstractPagedListResponse<
ListInstancesRequest,
ListInstancesResponse,
Instance,
ListInstancesPage,
ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage,
ListInstancesFixedSizeCollection> {

public static ApiFuture<ListInstancesPagedResponse> createAsync(
Expand DownExpand Up@@ -1608,10 +1759,7 @@ public ApiFuture<ListInstancesPage> createPageAsync(

public static class ListInstancesFixedSizeCollection
extends AbstractFixedSizeCollection<
ListInstancesRequest,
ListInstancesResponse,
Instance,
ListInstancesPage,
ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage,
ListInstancesFixedSizeCollection> {

private ListInstancesFixedSizeCollection(List<ListInstancesPage> pages, int collectionSize) {
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -28,6 +28,7 @@
import com.google.api.gax.rpc.ClientSettings;
import com.google.api.gax.rpc.OperationCallSettings;
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.StubSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.cloud.redis.v1.stub.CloudRedisStubSettings;
Expand All@@ -44,9 +45,9 @@
* <p>The default instance has everything set to sensible defaults:
*
* <ul>
* <li>The default service address (redis.googleapis.com) and default port (443) are used.
* <li>Credentials are acquired automatically through Application Default Credentials.
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
* <li>The default service address (redis.googleapis.com) and default port (443) are used.
* <li>Credentials are acquired automatically through Application Default Credentials.
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
* </ul>
*
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
Expand DownExpand Up@@ -165,6 +166,18 @@ public UnaryCallSettings<DeleteInstanceRequest, Operation> deleteInstanceSetting
return ((CloudRedisStubSettings) getStubSettings()).deleteInstanceOperationSettings();
}

/** Returns the object with the settings used for calls to rescheduleMaintenance. */
public UnaryCallSettings<RescheduleMaintenanceRequest, Operation>
rescheduleMaintenanceSettings() {
return ((CloudRedisStubSettings) getStubSettings()).rescheduleMaintenanceSettings();
}

/** Returns the object with the settings used for calls to rescheduleMaintenance. */
public OperationCallSettings<RescheduleMaintenanceRequest, Instance, OperationMetadata>
rescheduleMaintenanceOperationSettings() {
return ((CloudRedisStubSettings) getStubSettings()).rescheduleMaintenanceOperationSettings();
}

public static final CloudRedisSettings create(CloudRedisStubSettings stub) throws IOException {
return new CloudRedisSettings.Builder(stub.toBuilder()).build();
}
Expand DownExpand Up@@ -357,6 +370,18 @@ public UnaryCallSettings.Builder<DeleteInstanceRequest, Operation> deleteInstanc
return getStubSettingsBuilder().deleteInstanceOperationSettings();
}

/** Returns the builder for the settings used for calls to rescheduleMaintenance. */
public UnaryCallSettings.Builder<RescheduleMaintenanceRequest, Operation>
rescheduleMaintenanceSettings() {
return getStubSettingsBuilder().rescheduleMaintenanceSettings();
}

/** Returns the builder for the settings used for calls to rescheduleMaintenance. */
public OperationCallSettings.Builder<RescheduleMaintenanceRequest, Instance, OperationMetadata>
rescheduleMaintenanceOperationSettings() {
return getStubSettingsBuilder().rescheduleMaintenanceOperationSettings();
}

@Override
public CloudRedisSettings build() throws IOException {
return new CloudRedisSettings(this);
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,6 +34,9 @@
"ListInstances": {
"methods": ["listInstances", "listInstances", "listInstances", "listInstancesPagedCallable", "listInstancesCallable"]
},
"RescheduleMaintenance": {
"methods": ["rescheduleMaintenanceAsync", "rescheduleMaintenanceAsync", "rescheduleMaintenanceAsync", "rescheduleMaintenanceOperationCallable", "rescheduleMaintenanceCallable"]
},
"UpdateInstance": {
"methods": ["updateInstanceAsync", "updateInstanceAsync", "updateInstanceOperationCallable", "updateInstanceCallable"]
},
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp