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

Commit 6ac4ac8

Browse files
fix: [Cloud Memorystore for Redis] Add missing fields for TLS and Maintenance Window features (#583)
* fix: [Cloud Memorystore for Redis] Add missing fields for TLS and Maintenance Window features PiperOrigin-RevId: 421360191 Source-Link: googleapis/googleapis@3e958c3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f6580f02343d8adb49c170f8e9160113bfbbd2b3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjY1ODBmMDIzNDNkOGFkYjQ5YzE3MGY4ZTkxNjAxMTNiZmJiZDJiMyJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent f1efdd1 commit 6ac4ac8

35 files changed

+13433
-637
lines changed

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

Lines changed: 255 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import com.google.protobuf.Any;
3636
import com.google.protobuf.Empty;
3737
import com.google.protobuf.FieldMask;
38+
import com.google.protobuf.Timestamp;
3839
import java.io.IOException;
3940
import java.util.List;
4041
import java.util.concurrent.TimeUnit;
@@ -463,6 +464,107 @@ public final UnaryCallable<GetInstanceRequest, Instance> getInstanceCallable() {
463464
return stub.getInstanceCallable();
464465
}
465466

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

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

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ public UnaryCallSettings<GetInstanceRequest, Instance> getInstanceSettings() {
8484
return ((CloudRedisStubSettings) getStubSettings()).getInstanceSettings();
8585
}
8686

87+
/** Returns the object with the settings used for calls to getInstanceAuthString. */
88+
public UnaryCallSettings<GetInstanceAuthStringRequest, InstanceAuthString>
89+
getInstanceAuthStringSettings() {
90+
return ((CloudRedisStubSettings) getStubSettings()).getInstanceAuthStringSettings();
91+
}
92+
8793
/** Returns the object with the settings used for calls to createInstance. */
8894
public UnaryCallSettings<CreateInstanceRequest, Operation> createInstanceSettings() {
8995
return ((CloudRedisStubSettings) getStubSettings()).createInstanceSettings();
@@ -161,6 +167,18 @@ public UnaryCallSettings<DeleteInstanceRequest, Operation> deleteInstanceSetting
161167
return ((CloudRedisStubSettings) getStubSettings()).deleteInstanceOperationSettings();
162168
}
163169

170+
/** Returns the object with the settings used for calls to rescheduleMaintenance. */
171+
public UnaryCallSettings<RescheduleMaintenanceRequest, Operation>
172+
rescheduleMaintenanceSettings() {
173+
return ((CloudRedisStubSettings) getStubSettings()).rescheduleMaintenanceSettings();
174+
}
175+
176+
/** Returns the object with the settings used for calls to rescheduleMaintenance. */
177+
public OperationCallSettings<RescheduleMaintenanceRequest, Instance, Any>
178+
rescheduleMaintenanceOperationSettings() {
179+
return ((CloudRedisStubSettings) getStubSettings()).rescheduleMaintenanceOperationSettings();
180+
}
181+
164182
public static final CloudRedisSettings create(CloudRedisStubSettings stub) throws IOException {
165183
return new CloudRedisSettings.Builder(stub.toBuilder()).build();
166184
}
@@ -269,6 +287,12 @@ public UnaryCallSettings.Builder<GetInstanceRequest, Instance> getInstanceSettin
269287
return getStubSettingsBuilder().getInstanceSettings();
270288
}
271289

290+
/** Returns the builder for the settings used for calls to getInstanceAuthString. */
291+
public UnaryCallSettings.Builder<GetInstanceAuthStringRequest, InstanceAuthString>
292+
getInstanceAuthStringSettings() {
293+
return getStubSettingsBuilder().getInstanceAuthStringSettings();
294+
}
295+
272296
/** Returns the builder for the settings used for calls to createInstance. */
273297
public UnaryCallSettings.Builder<CreateInstanceRequest, Operation> createInstanceSettings() {
274298
return getStubSettingsBuilder().createInstanceSettings();
@@ -347,6 +371,18 @@ public UnaryCallSettings.Builder<DeleteInstanceRequest, Operation> deleteInstanc
347371
return getStubSettingsBuilder().deleteInstanceOperationSettings();
348372
}
349373

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

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

Lines changed: 6 additions & 0 deletions
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)