Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.

Commit ccde9b5

Browse files
feat: [Cloud Memorystore for Redis] Support Maintenance Window (#618)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 434820669 Source-Link: googleapis/googleapis@db9aa74 Source-Link: https://github.com/googleapis/googleapis-gen/commit/0cff4ff2a6d21a9501cc21e8d2f2b15cb1188730 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGNmZjRmZjJhNmQyMWE5NTAxY2MyMWU4ZDJmMmIxNWNiMTE4ODczMCJ9 feat: add support for AUTH functionality feat: add support for TLS functionality feat: add secondary_ip_range field PiperOrigin-RevId: 434816216 Source-Link: googleapis/googleapis@7cef847 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b4cef4cabbed83b194cdc07ad847e97fdb233b3c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjRjZWY0Y2FiYmVkODNiMTk0Y2RjMDdhZDg0N2U5N2ZkYjIzM2IzYyJ9
1 parent 04319d4 commit ccde9b5

27 files changed

+13458
-380
lines changed

google-cloud-redis/src/main/java/com/google/cloud/redis/v1/CloudRedisClient.java

+255
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import com.google.longrunning.OperationsClient;
3535
import com.google.protobuf.Empty;
3636
import com.google.protobuf.FieldMask;
37+
import com.google.protobuf.Timestamp;
3738
import java.io.IOException;
3839
import java.util.List;
3940
import java.util.concurrent.TimeUnit;
@@ -461,6 +462,107 @@ public final UnaryCallable<GetInstanceRequest, Instance> getInstanceCallable() {
461462
return stub.getInstanceCallable();
462463
}
463464

465+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
466+
/**
467+
* Gets the AUTH string for a Redis instance. If AUTH is not enabled for the instance the response
468+
* will be empty. This information is not included in the details returned to GetInstance.
469+
*
470+
* <p>Sample code:
471+
*
472+
* <pre>{@code
473+
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
474+
* InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
475+
* InstanceAuthString response = cloudRedisClient.getInstanceAuthString(name);
476+
* }
477+
* }</pre>
478+
*
479+
* @param name Required. Redis instance resource name using the form:
480+
* `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id`
481+
* refers to a GCP region.
482+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
483+
*/
484+
public final InstanceAuthString getInstanceAuthString(InstanceName name) {
485+
GetInstanceAuthStringRequest request =
486+
GetInstanceAuthStringRequest.newBuilder()
487+
.setName(name == null ? null : name.toString())
488+
.build();
489+
return getInstanceAuthString(request);
490+
}
491+
492+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
493+
/**
494+
* Gets the AUTH string for a Redis instance. If AUTH is not enabled for the instance the response
495+
* will be empty. This information is not included in the details returned to GetInstance.
496+
*
497+
* <p>Sample code:
498+
*
499+
* <pre>{@code
500+
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
501+
* String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
502+
* InstanceAuthString response = cloudRedisClient.getInstanceAuthString(name);
503+
* }
504+
* }</pre>
505+
*
506+
* @param name Required. Redis instance resource name using the form:
507+
* `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id`
508+
* refers to a GCP region.
509+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
510+
*/
511+
public final InstanceAuthString getInstanceAuthString(String name) {
512+
GetInstanceAuthStringRequest request =
513+
GetInstanceAuthStringRequest.newBuilder().setName(name).build();
514+
return getInstanceAuthString(request);
515+
}
516+
517+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
518+
/**
519+
* Gets the AUTH string for a Redis instance. If AUTH is not enabled for the instance the response
520+
* will be empty. This information is not included in the details returned to GetInstance.
521+
*
522+
* <p>Sample code:
523+
*
524+
* <pre>{@code
525+
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
526+
* GetInstanceAuthStringRequest request =
527+
* GetInstanceAuthStringRequest.newBuilder()
528+
* .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
529+
* .build();
530+
* InstanceAuthString response = cloudRedisClient.getInstanceAuthString(request);
531+
* }
532+
* }</pre>
533+
*
534+
* @param request The request object containing all of the parameters for the API call.
535+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
536+
*/
537+
public final InstanceAuthString getInstanceAuthString(GetInstanceAuthStringRequest request) {
538+
return getInstanceAuthStringCallable().call(request);
539+
}
540+
541+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
542+
/**
543+
* Gets the AUTH string for a Redis instance. If AUTH is not enabled for the instance the response
544+
* will be empty. This information is not included in the details returned to GetInstance.
545+
*
546+
* <p>Sample code:
547+
*
548+
* <pre>{@code
549+
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
550+
* GetInstanceAuthStringRequest request =
551+
* GetInstanceAuthStringRequest.newBuilder()
552+
* .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
553+
* .build();
554+
* ApiFuture<InstanceAuthString> future =
555+
* cloudRedisClient.getInstanceAuthStringCallable().futureCall(request);
556+
* // Do something.
557+
* InstanceAuthString response = future.get();
558+
* }
559+
* }</pre>
560+
*/
561+
public final UnaryCallable<GetInstanceAuthStringRequest, InstanceAuthString>
562+
getInstanceAuthStringCallable() {
563+
return stub.getInstanceAuthStringCallable();
564+
}
565+
464566
// AUTO-GENERATED DOCUMENTATION AND METHOD.
465567
/**
466568
* Creates a Redis instance based on the specified tier and memory size.
@@ -1422,6 +1524,159 @@ public final UnaryCallable<DeleteInstanceRequest, Operation> deleteInstanceCalla
14221524
return stub.deleteInstanceCallable();
14231525
}
14241526

1527+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1528+
/**
1529+
* Reschedule maintenance for a given instance in a given project and location.
1530+
*
1531+
* <p>Sample code:
1532+
*
1533+
* <pre>{@code
1534+
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
1535+
* InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
1536+
* RescheduleMaintenanceRequest.RescheduleType rescheduleType =
1537+
* RescheduleMaintenanceRequest.RescheduleType.forNumber(0);
1538+
* Timestamp scheduleTime = Timestamp.newBuilder().build();
1539+
* Instance response =
1540+
* cloudRedisClient.rescheduleMaintenanceAsync(name, rescheduleType, scheduleTime).get();
1541+
* }
1542+
* }</pre>
1543+
*
1544+
* @param name Required. Redis instance resource name using the form:
1545+
* `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id`
1546+
* refers to a GCP region.
1547+
* @param rescheduleType Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time
1548+
* as well.
1549+
* @param scheduleTime Optional. Timestamp when the maintenance shall be rescheduled to if
1550+
* reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for example `2012-11-15T16:19:00.094Z`.
1551+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1552+
*/
1553+
public final OperationFuture<Instance, OperationMetadata> rescheduleMaintenanceAsync(
1554+
InstanceName name,
1555+
RescheduleMaintenanceRequest.RescheduleType rescheduleType,
1556+
Timestamp scheduleTime) {
1557+
RescheduleMaintenanceRequest request =
1558+
RescheduleMaintenanceRequest.newBuilder()
1559+
.setName(name == null ? null : name.toString())
1560+
.setRescheduleType(rescheduleType)
1561+
.setScheduleTime(scheduleTime)
1562+
.build();
1563+
return rescheduleMaintenanceAsync(request);
1564+
}
1565+
1566+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1567+
/**
1568+
* Reschedule maintenance for a given instance in a given project and location.
1569+
*
1570+
* <p>Sample code:
1571+
*
1572+
* <pre>{@code
1573+
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
1574+
* String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
1575+
* RescheduleMaintenanceRequest.RescheduleType rescheduleType =
1576+
* RescheduleMaintenanceRequest.RescheduleType.forNumber(0);
1577+
* Timestamp scheduleTime = Timestamp.newBuilder().build();
1578+
* Instance response =
1579+
* cloudRedisClient.rescheduleMaintenanceAsync(name, rescheduleType, scheduleTime).get();
1580+
* }
1581+
* }</pre>
1582+
*
1583+
* @param name Required. Redis instance resource name using the form:
1584+
* `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id`
1585+
* refers to a GCP region.
1586+
* @param rescheduleType Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time
1587+
* as well.
1588+
* @param scheduleTime Optional. Timestamp when the maintenance shall be rescheduled to if
1589+
* reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for example `2012-11-15T16:19:00.094Z`.
1590+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1591+
*/
1592+
public final OperationFuture<Instance, OperationMetadata> rescheduleMaintenanceAsync(
1593+
String name,
1594+
RescheduleMaintenanceRequest.RescheduleType rescheduleType,
1595+
Timestamp scheduleTime) {
1596+
RescheduleMaintenanceRequest request =
1597+
RescheduleMaintenanceRequest.newBuilder()
1598+
.setName(name)
1599+
.setRescheduleType(rescheduleType)
1600+
.setScheduleTime(scheduleTime)
1601+
.build();
1602+
return rescheduleMaintenanceAsync(request);
1603+
}
1604+
1605+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1606+
/**
1607+
* Reschedule maintenance for a given instance in a given project and location.
1608+
*
1609+
* <p>Sample code:
1610+
*
1611+
* <pre>{@code
1612+
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
1613+
* RescheduleMaintenanceRequest request =
1614+
* RescheduleMaintenanceRequest.newBuilder()
1615+
* .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
1616+
* .setScheduleTime(Timestamp.newBuilder().build())
1617+
* .build();
1618+
* Instance response = cloudRedisClient.rescheduleMaintenanceAsync(request).get();
1619+
* }
1620+
* }</pre>
1621+
*
1622+
* @param request The request object containing all of the parameters for the API call.
1623+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1624+
*/
1625+
public final OperationFuture<Instance, OperationMetadata> rescheduleMaintenanceAsync(
1626+
RescheduleMaintenanceRequest request) {
1627+
return rescheduleMaintenanceOperationCallable().futureCall(request);
1628+
}
1629+
1630+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1631+
/**
1632+
* Reschedule maintenance for a given instance in a given project and location.
1633+
*
1634+
* <p>Sample code:
1635+
*
1636+
* <pre>{@code
1637+
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
1638+
* RescheduleMaintenanceRequest request =
1639+
* RescheduleMaintenanceRequest.newBuilder()
1640+
* .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
1641+
* .setScheduleTime(Timestamp.newBuilder().build())
1642+
* .build();
1643+
* OperationFuture<Instance, OperationMetadata> future =
1644+
* cloudRedisClient.rescheduleMaintenanceOperationCallable().futureCall(request);
1645+
* // Do something.
1646+
* Instance response = future.get();
1647+
* }
1648+
* }</pre>
1649+
*/
1650+
public final OperationCallable<RescheduleMaintenanceRequest, Instance, OperationMetadata>
1651+
rescheduleMaintenanceOperationCallable() {
1652+
return stub.rescheduleMaintenanceOperationCallable();
1653+
}
1654+
1655+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1656+
/**
1657+
* Reschedule maintenance for a given instance in a given project and location.
1658+
*
1659+
* <p>Sample code:
1660+
*
1661+
* <pre>{@code
1662+
* try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
1663+
* RescheduleMaintenanceRequest request =
1664+
* RescheduleMaintenanceRequest.newBuilder()
1665+
* .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
1666+
* .setScheduleTime(Timestamp.newBuilder().build())
1667+
* .build();
1668+
* ApiFuture<Operation> future =
1669+
* cloudRedisClient.rescheduleMaintenanceCallable().futureCall(request);
1670+
* // Do something.
1671+
* Operation response = future.get();
1672+
* }
1673+
* }</pre>
1674+
*/
1675+
public final UnaryCallable<RescheduleMaintenanceRequest, Operation>
1676+
rescheduleMaintenanceCallable() {
1677+
return stub.rescheduleMaintenanceCallable();
1678+
}
1679+
14251680
@Override
14261681
public final void close() {
14271682
stub.close();

google-cloud-redis/src/main/java/com/google/cloud/redis/v1/CloudRedisSettings.java

+36
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ public UnaryCallSettings<GetInstanceRequest, Instance> getInstanceSettings() {
8282
return ((CloudRedisStubSettings) getStubSettings()).getInstanceSettings();
8383
}
8484

85+
/** Returns the object with the settings used for calls to getInstanceAuthString. */
86+
public UnaryCallSettings<GetInstanceAuthStringRequest, InstanceAuthString>
87+
getInstanceAuthStringSettings() {
88+
return ((CloudRedisStubSettings) getStubSettings()).getInstanceAuthStringSettings();
89+
}
90+
8591
/** Returns the object with the settings used for calls to createInstance. */
8692
public UnaryCallSettings<CreateInstanceRequest, Operation> createInstanceSettings() {
8793
return ((CloudRedisStubSettings) getStubSettings()).createInstanceSettings();
@@ -159,6 +165,18 @@ public UnaryCallSettings<DeleteInstanceRequest, Operation> deleteInstanceSetting
159165
return ((CloudRedisStubSettings) getStubSettings()).deleteInstanceOperationSettings();
160166
}
161167

168+
/** Returns the object with the settings used for calls to rescheduleMaintenance. */
169+
public UnaryCallSettings<RescheduleMaintenanceRequest, Operation>
170+
rescheduleMaintenanceSettings() {
171+
return ((CloudRedisStubSettings) getStubSettings()).rescheduleMaintenanceSettings();
172+
}
173+
174+
/** Returns the object with the settings used for calls to rescheduleMaintenance. */
175+
public OperationCallSettings<RescheduleMaintenanceRequest, Instance, OperationMetadata>
176+
rescheduleMaintenanceOperationSettings() {
177+
return ((CloudRedisStubSettings) getStubSettings()).rescheduleMaintenanceOperationSettings();
178+
}
179+
162180
public static final CloudRedisSettings create(CloudRedisStubSettings stub) throws IOException {
163181
return new CloudRedisSettings.Builder(stub.toBuilder()).build();
164182
}
@@ -267,6 +285,12 @@ public UnaryCallSettings.Builder<GetInstanceRequest, Instance> getInstanceSettin
267285
return getStubSettingsBuilder().getInstanceSettings();
268286
}
269287

288+
/** Returns the builder for the settings used for calls to getInstanceAuthString. */
289+
public UnaryCallSettings.Builder<GetInstanceAuthStringRequest, InstanceAuthString>
290+
getInstanceAuthStringSettings() {
291+
return getStubSettingsBuilder().getInstanceAuthStringSettings();
292+
}
293+
270294
/** Returns the builder for the settings used for calls to createInstance. */
271295
public UnaryCallSettings.Builder<CreateInstanceRequest, Operation> createInstanceSettings() {
272296
return getStubSettingsBuilder().createInstanceSettings();
@@ -345,6 +369,18 @@ public UnaryCallSettings.Builder<DeleteInstanceRequest, Operation> deleteInstanc
345369
return getStubSettingsBuilder().deleteInstanceOperationSettings();
346370
}
347371

372+
/** Returns the builder for the settings used for calls to rescheduleMaintenance. */
373+
public UnaryCallSettings.Builder<RescheduleMaintenanceRequest, Operation>
374+
rescheduleMaintenanceSettings() {
375+
return getStubSettingsBuilder().rescheduleMaintenanceSettings();
376+
}
377+
378+
/** Returns the builder for the settings used for calls to rescheduleMaintenance. */
379+
public OperationCallSettings.Builder<RescheduleMaintenanceRequest, Instance, OperationMetadata>
380+
rescheduleMaintenanceOperationSettings() {
381+
return getStubSettingsBuilder().rescheduleMaintenanceOperationSettings();
382+
}
383+
348384
@Override
349385
public CloudRedisSettings build() throws IOException {
350386
return new CloudRedisSettings(this);

google-cloud-redis/src/main/java/com/google/cloud/redis/v1/gapic_metadata.json

+6
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,18 @@
2525
"GetInstance": {
2626
"methods": ["getInstance", "getInstance", "getInstance", "getInstanceCallable"]
2727
},
28+
"GetInstanceAuthString": {
29+
"methods": ["getInstanceAuthString", "getInstanceAuthString", "getInstanceAuthString", "getInstanceAuthStringCallable"]
30+
},
2831
"ImportInstance": {
2932
"methods": ["importInstanceAsync", "importInstanceAsync", "importInstanceOperationCallable", "importInstanceCallable"]
3033
},
3134
"ListInstances": {
3235
"methods": ["listInstances", "listInstances", "listInstances", "listInstancesPagedCallable", "listInstancesCallable"]
3336
},
37+
"RescheduleMaintenance": {
38+
"methods": ["rescheduleMaintenanceAsync", "rescheduleMaintenanceAsync", "rescheduleMaintenanceAsync", "rescheduleMaintenanceOperationCallable", "rescheduleMaintenanceCallable"]
39+
},
3440
"UpdateInstance": {
3541
"methods": ["updateInstanceAsync", "updateInstanceAsync", "updateInstanceOperationCallable", "updateInstanceCallable"]
3642
},

0 commit comments

Comments
 (0)