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

Commit 0b3f2c0

Browse files
fix: update retry config (#24)
1 parent 7f4b773 commit 0b3f2c0

17 files changed

+1739
-959
lines changed

google/cloud/redis_v1/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727
if sys.version_info[:2] == (2, 7):
2828
message = (
29-
"A future version of this library will drop support for Python 2.7."
30-
"More details about Python 2 support for Google Cloud Client Libraries"
29+
"A future version of this library will drop support for Python 2.7. "
30+
"More details about Python 2 support for Google Cloud Client Libraries "
3131
"can be found at https://cloud.google.com/python/docs/python2-sunset/"
3232
)
3333
warnings.warn(message, DeprecationWarning)

google/cloud/redis_v1/gapic/cloud_redis_client.py

+185-185
Large diffs are not rendered by default.

google/cloud/redis_v1/gapic/cloud_redis_client_config.py

+45-39
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,67 @@
11
config = {
22
"interfaces": {
33
"google.cloud.redis.v1.CloudRedis": {
4-
"retry_codes": {
5-
"idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"],
6-
"non_idempotent": [],
7-
},
4+
"retry_codes": {"no_retry_codes": [], "no_retry_1_codes": []},
85
"retry_params": {
9-
"default": {
10-
"initial_retry_delay_millis": 100,
11-
"retry_delay_multiplier": 1.3,
12-
"max_retry_delay_millis": 60000,
13-
"initial_rpc_timeout_millis": 20000,
6+
"no_retry_params": {
7+
"initial_retry_delay_millis": 0,
8+
"retry_delay_multiplier": 0.0,
9+
"max_retry_delay_millis": 0,
10+
"initial_rpc_timeout_millis": 0,
11+
"rpc_timeout_multiplier": 1.0,
12+
"max_rpc_timeout_millis": 0,
13+
"total_timeout_millis": 0,
14+
},
15+
"no_retry_1_params": {
16+
"initial_retry_delay_millis": 0,
17+
"retry_delay_multiplier": 0.0,
18+
"max_retry_delay_millis": 0,
19+
"initial_rpc_timeout_millis": 600000,
1420
"rpc_timeout_multiplier": 1.0,
15-
"max_rpc_timeout_millis": 20000,
21+
"max_rpc_timeout_millis": 600000,
1622
"total_timeout_millis": 600000,
17-
}
23+
},
1824
},
1925
"methods": {
20-
"ListInstances": {
21-
"timeout_millis": 60000,
22-
"retry_codes_name": "non_idempotent",
23-
"retry_params_name": "default",
24-
},
25-
"GetInstance": {
26-
"timeout_millis": 60000,
27-
"retry_codes_name": "non_idempotent",
28-
"retry_params_name": "default",
29-
},
3026
"CreateInstance": {
31-
"timeout_millis": 60000,
32-
"retry_codes_name": "non_idempotent",
33-
"retry_params_name": "default",
27+
"timeout_millis": 600000,
28+
"retry_codes_name": "no_retry_1_codes",
29+
"retry_params_name": "no_retry_1_params",
3430
},
3531
"UpdateInstance": {
36-
"timeout_millis": 60000,
37-
"retry_codes_name": "non_idempotent",
38-
"retry_params_name": "default",
32+
"timeout_millis": 600000,
33+
"retry_codes_name": "no_retry_1_codes",
34+
"retry_params_name": "no_retry_1_params",
3935
},
4036
"ImportInstance": {
41-
"timeout_millis": 60000,
42-
"retry_codes_name": "non_idempotent",
43-
"retry_params_name": "default",
37+
"timeout_millis": 600000,
38+
"retry_codes_name": "no_retry_1_codes",
39+
"retry_params_name": "no_retry_1_params",
4440
},
4541
"ExportInstance": {
46-
"timeout_millis": 60000,
47-
"retry_codes_name": "non_idempotent",
48-
"retry_params_name": "default",
42+
"timeout_millis": 600000,
43+
"retry_codes_name": "no_retry_1_codes",
44+
"retry_params_name": "no_retry_1_params",
4945
},
5046
"FailoverInstance": {
51-
"timeout_millis": 60000,
52-
"retry_codes_name": "non_idempotent",
53-
"retry_params_name": "default",
47+
"timeout_millis": 600000,
48+
"retry_codes_name": "no_retry_1_codes",
49+
"retry_params_name": "no_retry_1_params",
5450
},
5551
"DeleteInstance": {
56-
"timeout_millis": 60000,
57-
"retry_codes_name": "non_idempotent",
58-
"retry_params_name": "default",
52+
"timeout_millis": 600000,
53+
"retry_codes_name": "no_retry_1_codes",
54+
"retry_params_name": "no_retry_1_params",
55+
},
56+
"ListInstances": {
57+
"timeout_millis": 600000,
58+
"retry_codes_name": "no_retry_1_codes",
59+
"retry_params_name": "no_retry_1_params",
60+
},
61+
"GetInstance": {
62+
"timeout_millis": 600000,
63+
"retry_codes_name": "no_retry_1_codes",
64+
"retry_params_name": "no_retry_1_params",
5965
},
6066
},
6167
}

google/cloud/redis_v1/gapic/transports/cloud_redis_grpc_transport.py

+35-35
Original file line numberDiff line numberDiff line change
@@ -113,40 +113,6 @@ def channel(self):
113113
"""
114114
return self._channel
115115

116-
@property
117-
def list_instances(self):
118-
"""Return the gRPC stub for :meth:`CloudRedisClient.list_instances`.
119-
120-
Lists all Redis instances owned by a project in either the specified
121-
location (region) or all locations.
122-
123-
The location should have the following format:
124-
125-
- ``projects/{project_id}/locations/{location_id}``
126-
127-
If ``location_id`` is specified as ``-`` (wildcard), then all regions
128-
available to the project are queried, and the results are aggregated.
129-
130-
Returns:
131-
Callable: A callable which accepts the appropriate
132-
deserialized request object and returns a
133-
deserialized response object.
134-
"""
135-
return self._stubs["cloud_redis_stub"].ListInstances
136-
137-
@property
138-
def get_instance(self):
139-
"""Return the gRPC stub for :meth:`CloudRedisClient.get_instance`.
140-
141-
Gets the details of a specific Redis instance.
142-
143-
Returns:
144-
Callable: A callable which accepts the appropriate
145-
deserialized request object and returns a
146-
deserialized response object.
147-
"""
148-
return self._stubs["cloud_redis_stub"].GetInstance
149-
150116
@property
151117
def create_instance(self):
152118
"""Return the gRPC stub for :meth:`CloudRedisClient.create_instance`.
@@ -155,7 +121,7 @@ def create_instance(self):
155121
size.
156122
157123
By default, the instance is accessible from the project's `default
158-
network <https://cloud.google.com/compute/docs/networks-and-firewalls#networks>`__.
124+
network <https://cloud.google.com/vpc/docs/vpc>`__.
159125
160126
The creation is executed asynchronously and callers may check the
161127
returned operation to track its progress. Once the operation is
@@ -255,3 +221,37 @@ def delete_instance(self):
255221
deserialized response object.
256222
"""
257223
return self._stubs["cloud_redis_stub"].DeleteInstance
224+
225+
@property
226+
def list_instances(self):
227+
"""Return the gRPC stub for :meth:`CloudRedisClient.list_instances`.
228+
229+
Lists all Redis instances owned by a project in either the specified
230+
location (region) or all locations.
231+
232+
The location should have the following format:
233+
234+
- ``projects/{project_id}/locations/{location_id}``
235+
236+
If ``location_id`` is specified as ``-`` (wildcard), then all regions
237+
available to the project are queried, and the results are aggregated.
238+
239+
Returns:
240+
Callable: A callable which accepts the appropriate
241+
deserialized request object and returns a
242+
deserialized response object.
243+
"""
244+
return self._stubs["cloud_redis_stub"].ListInstances
245+
246+
@property
247+
def get_instance(self):
248+
"""Return the gRPC stub for :meth:`CloudRedisClient.get_instance`.
249+
250+
Gets the details of a specific Redis instance.
251+
252+
Returns:
253+
Callable: A callable which accepts the appropriate
254+
deserialized request object and returns a
255+
deserialized response object.
256+
"""
257+
return self._stubs["cloud_redis_stub"].GetInstance

google/cloud/redis_v1/proto/cloud_redis.proto

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ service CloudRedis {
7575
// Creates a Redis instance based on the specified tier and memory size.
7676
//
7777
// By default, the instance is accessible from the project's
78-
// [default network](/compute/docs/networks-and-firewalls#networks).
78+
// [default network](https://cloud.google.com/vpc/docs/vpc).
7979
//
8080
// The creation is executed asynchronously and callers may check the returned
8181
// operation to track its progress. Once the operation is completed the Redis
@@ -340,7 +340,7 @@ message Instance {
340340
int32 memory_size_gb = 18 [(google.api.field_behavior) = REQUIRED];
341341

342342
// Optional. The full name of the Google Compute Engine
343-
// [network](/compute/docs/networks-and-firewalls#networks) to which the
343+
// [network](https://cloud.google.com/vpc/docs/vpc) to which the
344344
// instance is connected. If left unspecified, the `default` network
345345
// will be used.
346346
string authorized_network = 20 [(google.api.field_behavior) = OPTIONAL];

0 commit comments

Comments
 (0)