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

Commitccde9b5

Browse files
feat: [Cloud Memorystore for Redis] Support Maintenance Window (#618)
- [ ] Regenerate this pull request now.PiperOrigin-RevId: 434820669Source-Link:googleapis/googleapis@db9aa74Source-Link:https://github.com/googleapis/googleapis-gen/commit/0cff4ff2a6d21a9501cc21e8d2f2b15cb1188730Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGNmZjRmZjJhNmQyMWE5NTAxY2MyMWU4ZDJmMmIxNWNiMTE4ODczMCJ9feat: add support for AUTH functionalityfeat: add support for TLS functionalityfeat: add secondary_ip_range fieldPiperOrigin-RevId: 434816216Source-Link:googleapis/googleapis@7cef847Source-Link:https://github.com/googleapis/googleapis-gen/commit/b4cef4cabbed83b194cdc07ad847e97fdb233b3cCopy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjRjZWY0Y2FiYmVkODNiMTk0Y2RjMDdhZDg0N2U5N2ZkYjIzM2IzYyJ9
1 parent04319d4 commitccde9b5

File tree

27 files changed

+13458
-380
lines changed

27 files changed

+13458
-380
lines changed

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

Lines changed: 255 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
importcom.google.longrunning.OperationsClient;
3535
importcom.google.protobuf.Empty;
3636
importcom.google.protobuf.FieldMask;
37+
importcom.google.protobuf.Timestamp;
3738
importjava.io.IOException;
3839
importjava.util.List;
3940
importjava.util.concurrent.TimeUnit;
@@ -461,6 +462,107 @@ public final UnaryCallable<GetInstanceRequest, Instance> getInstanceCallable() {
461462
returnstub.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+
publicfinalInstanceAuthStringgetInstanceAuthString(InstanceNamename) {
485+
GetInstanceAuthStringRequestrequest =
486+
GetInstanceAuthStringRequest.newBuilder()
487+
.setName(name ==null ?null :name.toString())
488+
.build();
489+
returngetInstanceAuthString(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+
publicfinalInstanceAuthStringgetInstanceAuthString(Stringname) {
512+
GetInstanceAuthStringRequestrequest =
513+
GetInstanceAuthStringRequest.newBuilder().setName(name).build();
514+
returngetInstanceAuthString(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+
publicfinalInstanceAuthStringgetInstanceAuthString(GetInstanceAuthStringRequestrequest) {
538+
returngetInstanceAuthStringCallable().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+
publicfinalUnaryCallable<GetInstanceAuthStringRequest,InstanceAuthString>
562+
getInstanceAuthStringCallable() {
563+
returnstub.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
returnstub.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+
publicfinalOperationFuture<Instance,OperationMetadata>rescheduleMaintenanceAsync(
1554+
InstanceNamename,
1555+
RescheduleMaintenanceRequest.RescheduleTyperescheduleType,
1556+
TimestampscheduleTime) {
1557+
RescheduleMaintenanceRequestrequest =
1558+
RescheduleMaintenanceRequest.newBuilder()
1559+
.setName(name ==null ?null :name.toString())
1560+
.setRescheduleType(rescheduleType)
1561+
.setScheduleTime(scheduleTime)
1562+
.build();
1563+
returnrescheduleMaintenanceAsync(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+
publicfinalOperationFuture<Instance,OperationMetadata>rescheduleMaintenanceAsync(
1593+
Stringname,
1594+
RescheduleMaintenanceRequest.RescheduleTyperescheduleType,
1595+
TimestampscheduleTime) {
1596+
RescheduleMaintenanceRequestrequest =
1597+
RescheduleMaintenanceRequest.newBuilder()
1598+
.setName(name)
1599+
.setRescheduleType(rescheduleType)
1600+
.setScheduleTime(scheduleTime)
1601+
.build();
1602+
returnrescheduleMaintenanceAsync(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+
publicfinalOperationFuture<Instance,OperationMetadata>rescheduleMaintenanceAsync(
1626+
RescheduleMaintenanceRequestrequest) {
1627+
returnrescheduleMaintenanceOperationCallable().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+
publicfinalOperationCallable<RescheduleMaintenanceRequest,Instance,OperationMetadata>
1651+
rescheduleMaintenanceOperationCallable() {
1652+
returnstub.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+
publicfinalUnaryCallable<RescheduleMaintenanceRequest,Operation>
1676+
rescheduleMaintenanceCallable() {
1677+
returnstub.rescheduleMaintenanceCallable();
1678+
}
1679+
14251680
@Override
14261681
publicfinalvoidclose() {
14271682
stub.close();

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

Lines changed: 36 additions & 0 deletions
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+
publicUnaryCallSettings<GetInstanceAuthStringRequest,InstanceAuthString>
87+
getInstanceAuthStringSettings() {
88+
return ((CloudRedisStubSettings)getStubSettings()).getInstanceAuthStringSettings();
89+
}
90+
8591
/** Returns the object with the settings used for calls to createInstance. */
8692
publicUnaryCallSettings<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+
publicUnaryCallSettings<RescheduleMaintenanceRequest,Operation>
170+
rescheduleMaintenanceSettings() {
171+
return ((CloudRedisStubSettings)getStubSettings()).rescheduleMaintenanceSettings();
172+
}
173+
174+
/** Returns the object with the settings used for calls to rescheduleMaintenance. */
175+
publicOperationCallSettings<RescheduleMaintenanceRequest,Instance,OperationMetadata>
176+
rescheduleMaintenanceOperationSettings() {
177+
return ((CloudRedisStubSettings)getStubSettings()).rescheduleMaintenanceOperationSettings();
178+
}
179+
162180
publicstaticfinalCloudRedisSettingscreate(CloudRedisStubSettingsstub)throwsIOException {
163181
returnnewCloudRedisSettings.Builder(stub.toBuilder()).build();
164182
}
@@ -267,6 +285,12 @@ public UnaryCallSettings.Builder<GetInstanceRequest, Instance> getInstanceSettin
267285
returngetStubSettingsBuilder().getInstanceSettings();
268286
}
269287

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

372+
/** Returns the builder for the settings used for calls to rescheduleMaintenance. */
373+
publicUnaryCallSettings.Builder<RescheduleMaintenanceRequest,Operation>
374+
rescheduleMaintenanceSettings() {
375+
returngetStubSettingsBuilder().rescheduleMaintenanceSettings();
376+
}
377+
378+
/** Returns the builder for the settings used for calls to rescheduleMaintenance. */
379+
publicOperationCallSettings.Builder<RescheduleMaintenanceRequest,Instance,OperationMetadata>
380+
rescheduleMaintenanceOperationSettings() {
381+
returngetStubSettingsBuilder().rescheduleMaintenanceOperationSettings();
382+
}
383+
348384
@Override
349385
publicCloudRedisSettingsbuild()throwsIOException {
350386
returnnewCloudRedisSettings(this);

‎google-cloud-redis/src/main/java/com/google/cloud/redis/v1/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)

[8]ページ先頭

©2009-2025 Movatter.jp