This repository has been archived by the owner on Sep 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
cloud_redis_pb2_grpc.py
236 lines (202 loc) · 11.9 KB
/
cloud_redis_pb2_grpc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.cloud.redis_v1.proto import (
cloud_redis_pb2 as google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2,
)
from google.longrunning import (
operations_pb2 as google_dot_longrunning_dot_operations__pb2,
)
class CloudRedisStub(object):
"""Configures and manages Cloud Memorystore for Redis instances
Google Cloud Memorystore for Redis v1
The `redis.googleapis.com` service implements the Google Cloud Memorystore
for Redis API and defines the following resource model for managing Redis
instances:
* The service works with a collection of cloud projects, named: `/projects/*`
* Each project has a collection of available locations, named: `/locations/*`
* Each location has a collection of Redis instances, named: `/instances/*`
* As such, Redis instances are resources of the form:
`/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
Note that location_id must be referring to a GCP `region`; for example:
* `projects/redpepper-1290/locations/us-central1/instances/my-redis`
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.ListInstances = channel.unary_unary(
"/google.cloud.redis.v1.CloudRedis/ListInstances",
request_serializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.ListInstancesRequest.SerializeToString,
response_deserializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.ListInstancesResponse.FromString,
)
self.GetInstance = channel.unary_unary(
"/google.cloud.redis.v1.CloudRedis/GetInstance",
request_serializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.GetInstanceRequest.SerializeToString,
response_deserializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.Instance.FromString,
)
self.CreateInstance = channel.unary_unary(
"/google.cloud.redis.v1.CloudRedis/CreateInstance",
request_serializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.CreateInstanceRequest.SerializeToString,
response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString,
)
self.UpdateInstance = channel.unary_unary(
"/google.cloud.redis.v1.CloudRedis/UpdateInstance",
request_serializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.UpdateInstanceRequest.SerializeToString,
response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString,
)
self.ImportInstance = channel.unary_unary(
"/google.cloud.redis.v1.CloudRedis/ImportInstance",
request_serializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.ImportInstanceRequest.SerializeToString,
response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString,
)
self.ExportInstance = channel.unary_unary(
"/google.cloud.redis.v1.CloudRedis/ExportInstance",
request_serializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.ExportInstanceRequest.SerializeToString,
response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString,
)
self.FailoverInstance = channel.unary_unary(
"/google.cloud.redis.v1.CloudRedis/FailoverInstance",
request_serializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.FailoverInstanceRequest.SerializeToString,
response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString,
)
self.DeleteInstance = channel.unary_unary(
"/google.cloud.redis.v1.CloudRedis/DeleteInstance",
request_serializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.DeleteInstanceRequest.SerializeToString,
response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString,
)
class CloudRedisServicer(object):
"""Configures and manages Cloud Memorystore for Redis instances
Google Cloud Memorystore for Redis v1
The `redis.googleapis.com` service implements the Google Cloud Memorystore
for Redis API and defines the following resource model for managing Redis
instances:
* The service works with a collection of cloud projects, named: `/projects/*`
* Each project has a collection of available locations, named: `/locations/*`
* Each location has a collection of Redis instances, named: `/instances/*`
* As such, Redis instances are resources of the form:
`/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
Note that location_id must be referring to a GCP `region`; for example:
* `projects/redpepper-1290/locations/us-central1/instances/my-redis`
"""
def ListInstances(self, request, context):
"""Lists all Redis instances owned by a project in either the specified
location (region) or all locations.
The location should have the following format:
* `projects/{project_id}/locations/{location_id}`
If `location_id` is specified as `-` (wildcard), then all regions
available to the project are queried, and the results are aggregated.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")
def GetInstance(self, request, context):
"""Gets the details of a specific Redis instance.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")
def CreateInstance(self, request, context):
"""Creates a Redis instance based on the specified tier and memory size.
By default, the instance is accessible from the project's
[default network](/compute/docs/networks-and-firewalls#networks).
The creation is executed asynchronously and callers may check the returned
operation to track its progress. Once the operation is completed the Redis
instance will be fully functional. Completed longrunning.Operation will
contain the new instance object in the response field.
The returned operation is automatically deleted after a few hours, so there
is no need to call DeleteOperation.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")
def UpdateInstance(self, request, context):
"""Updates the metadata and configuration of a specific Redis instance.
Completed longrunning.Operation will contain the new instance object
in the response field. The returned operation is automatically deleted
after a few hours, so there is no need to call DeleteOperation.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")
def ImportInstance(self, request, context):
"""Import a Redis RDB snapshot file from Cloud Storage into a Redis instance.
Redis may stop serving during this operation. Instance state will be
IMPORTING for entire operation. When complete, the instance will contain
only data from the imported file.
The returned operation is automatically deleted after a few hours, so
there is no need to call DeleteOperation.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")
def ExportInstance(self, request, context):
"""Export Redis instance data into a Redis RDB format file in Cloud Storage.
Redis will continue serving during this operation.
The returned operation is automatically deleted after a few hours, so
there is no need to call DeleteOperation.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")
def FailoverInstance(self, request, context):
"""Initiates a failover of the master node to current replica node for a
specific STANDARD tier Cloud Memorystore for Redis instance.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")
def DeleteInstance(self, request, context):
"""Deletes a specific Redis instance. Instance stops serving and data is
deleted.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")
def add_CloudRedisServicer_to_server(servicer, server):
rpc_method_handlers = {
"ListInstances": grpc.unary_unary_rpc_method_handler(
servicer.ListInstances,
request_deserializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.ListInstancesRequest.FromString,
response_serializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.ListInstancesResponse.SerializeToString,
),
"GetInstance": grpc.unary_unary_rpc_method_handler(
servicer.GetInstance,
request_deserializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.GetInstanceRequest.FromString,
response_serializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.Instance.SerializeToString,
),
"CreateInstance": grpc.unary_unary_rpc_method_handler(
servicer.CreateInstance,
request_deserializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.CreateInstanceRequest.FromString,
response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
),
"UpdateInstance": grpc.unary_unary_rpc_method_handler(
servicer.UpdateInstance,
request_deserializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.UpdateInstanceRequest.FromString,
response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
),
"ImportInstance": grpc.unary_unary_rpc_method_handler(
servicer.ImportInstance,
request_deserializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.ImportInstanceRequest.FromString,
response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
),
"ExportInstance": grpc.unary_unary_rpc_method_handler(
servicer.ExportInstance,
request_deserializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.ExportInstanceRequest.FromString,
response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
),
"FailoverInstance": grpc.unary_unary_rpc_method_handler(
servicer.FailoverInstance,
request_deserializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.FailoverInstanceRequest.FromString,
response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
),
"DeleteInstance": grpc.unary_unary_rpc_method_handler(
servicer.DeleteInstance,
request_deserializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.DeleteInstanceRequest.FromString,
response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
"google.cloud.redis.v1.CloudRedis", rpc_method_handlers
)
server.add_generic_rpc_handlers((generic_handler,))