/
memory_db.ex
469 lines (363 loc) · 14.9 KB
/
memory_db.ex
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
# WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
# See https://github.com/aws-beam/aws-codegen for more details.
defmodule AWS.MemoryDB do
@moduledoc """
MemoryDB for Redis is a fully managed, Redis-compatible, in-memory database that
delivers ultra-fast performance and Multi-AZ durability for modern applications
built using microservices architectures.
MemoryDB stores the entire database in-memory, enabling low latency and high
throughput data access. It is compatible with Redis, a popular open source data
store, enabling you to leverage Redis’ flexible and friendly data structures,
APIs, and commands.
"""
alias AWS.Client
alias AWS.Request
def metadata do
%{
abbreviation: "Amazon MemoryDB",
api_version: "2021-01-01",
content_type: "application/x-amz-json-1.1",
credential_scope: nil,
endpoint_prefix: "memory-db",
global?: false,
protocol: "json",
service_id: "MemoryDB",
signature_version: "v4",
signing_name: "memorydb",
target_prefix: "AmazonMemoryDB"
}
end
@doc """
Apply the service update to a list of clusters supplied.
For more information on service updates and applying them, see [Applying the service
updates](https://docs.aws.amazon.com/MemoryDB/latest/devguide/managing-updates.html#applying-updates).
"""
def batch_update_cluster(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "BatchUpdateCluster", input, options)
end
@doc """
Makes a copy of an existing snapshot.
"""
def copy_snapshot(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "CopySnapshot", input, options)
end
@doc """
Creates an Access Control List.
For more information, see [Authenticating users with Access Contol Lists (ACLs)](https://docs.aws.amazon.com/MemoryDB/latest/devguide/clusters.acls.html).
"""
def create_acl(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "CreateACL", input, options)
end
@doc """
Creates a cluster.
All nodes in the cluster run the same protocol-compliant engine software.
"""
def create_cluster(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "CreateCluster", input, options)
end
@doc """
Creates a new MemoryDB parameter group.
A parameter group is a collection of parameters and their values that are
applied to all of the nodes in any cluster. For more information, see
[Configuring engine parameters using parameter groups](https://docs.aws.amazon.com/MemoryDB/latest/devguide/parametergroups.html).
"""
def create_parameter_group(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "CreateParameterGroup", input, options)
end
@doc """
Creates a copy of an entire cluster at a specific moment in time.
"""
def create_snapshot(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "CreateSnapshot", input, options)
end
@doc """
Creates a subnet group.
A subnet group is a collection of subnets (typically private) that you can
designate for your clusters running in an Amazon Virtual Private Cloud (VPC)
environment. When you create a cluster in an Amazon VPC, you must specify a
subnet group. MemoryDB uses that subnet group to choose a subnet and IP
addresses within that subnet to associate with your nodes. For more information,
see [Subnets and subnet groups](https://docs.aws.amazon.com/MemoryDB/latest/devguide/subnetgroups.html).
"""
def create_subnet_group(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "CreateSubnetGroup", input, options)
end
@doc """
Creates a MemoryDB user.
For more information, see [Authenticating users with Access Contol Lists (ACLs)](https://docs.aws.amazon.com/MemoryDB/latest/devguide/clusters.acls.html).
"""
def create_user(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "CreateUser", input, options)
end
@doc """
Deletes an Access Control List.
The ACL must first be disassociated from the cluster before it can be deleted.
For more information, see [Authenticating users with Access Contol Lists (ACLs)](https://docs.aws.amazon.com/MemoryDB/latest/devguide/clusters.acls.html).
"""
def delete_acl(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DeleteACL", input, options)
end
@doc """
Deletes a cluster.
It also deletes all associated nodes and node endpoints
"""
def delete_cluster(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DeleteCluster", input, options)
end
@doc """
Deletes the specified parameter group.
You cannot delete a parameter group if it is associated with any clusters. You
cannot delete the default parameter groups in your account.
"""
def delete_parameter_group(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DeleteParameterGroup", input, options)
end
@doc """
Deletes an existing snapshot.
When you receive a successful response from this operation, MemoryDB immediately
begins deleting the snapshot; you cannot cancel or revert this operation.
"""
def delete_snapshot(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DeleteSnapshot", input, options)
end
@doc """
Deletes a subnet group.
You cannot delete a default subnet group or one that is associated with any
clusters.
"""
def delete_subnet_group(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DeleteSubnetGroup", input, options)
end
@doc """
Deletes a user.
The user will be removed from all ACLs and in turn removed from all clusters.
"""
def delete_user(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DeleteUser", input, options)
end
@doc """
Returns a list of ACLs
"""
def describe_acls(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeACLs", input, options)
end
@doc """
Returns information about all provisioned clusters if no cluster identifier is
specified, or about a specific cluster if a cluster name is supplied.
"""
def describe_clusters(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeClusters", input, options)
end
@doc """
Returns a list of the available Redis engine versions.
"""
def describe_engine_versions(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeEngineVersions", input, options)
end
@doc """
Returns events related to clusters, security groups, and parameter groups.
You can obtain events specific to a particular cluster, security group, or
parameter group by providing the name as a parameter. By default, only the
events occurring within the last hour are returned; however, you can retrieve up
to 14 days' worth of events if necessary.
"""
def describe_events(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeEvents", input, options)
end
@doc """
Returns a list of parameter group descriptions.
If a parameter group name is specified, the list contains only the descriptions
for that group.
"""
def describe_parameter_groups(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeParameterGroups", input, options)
end
@doc """
Returns the detailed parameter list for a particular parameter group.
"""
def describe_parameters(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeParameters", input, options)
end
@doc """
Returns information about reserved nodes for this account, or about a specified
reserved node.
"""
def describe_reserved_nodes(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeReservedNodes", input, options)
end
@doc """
Lists available reserved node offerings.
"""
def describe_reserved_nodes_offerings(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeReservedNodesOfferings", input, options)
end
@doc """
Returns details of the service updates
"""
def describe_service_updates(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeServiceUpdates", input, options)
end
@doc """
Returns information about cluster snapshots.
By default, DescribeSnapshots lists all of your snapshots; it can optionally
describe a single snapshot, or just the snapshots associated with a particular
cluster.
"""
def describe_snapshots(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeSnapshots", input, options)
end
@doc """
Returns a list of subnet group descriptions.
If a subnet group name is specified, the list contains only the description of
that group.
"""
def describe_subnet_groups(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeSubnetGroups", input, options)
end
@doc """
Returns a list of users.
"""
def describe_users(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeUsers", input, options)
end
@doc """
Used to failover a shard.
This API is designed for testing the behavior of your application in case of
MemoryDB failover. It is not designed to be used as a production-level tool for
initiating a failover to overcome a problem you may have with the cluster.
Moreover, in certain conditions such as large scale operational events, Amazon
may block this API.
"""
def failover_shard(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "FailoverShard", input, options)
end
@doc """
Lists all available node types that you can scale to from your cluster's current
node type.
When you use the UpdateCluster operation to scale your cluster, the value of the
NodeType parameter must be one of the node types returned by this operation.
"""
def list_allowed_node_type_updates(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "ListAllowedNodeTypeUpdates", input, options)
end
@doc """
Lists all tags currently on a named resource.
A tag is a key-value pair where the key and value are case-sensitive. You can
use tags to categorize and track your MemoryDB resources. For more information,
see [Tagging your MemoryDB resources](https://docs.aws.amazon.com/MemoryDB/latest/devguide/Tagging-Resources.html)
"""
def list_tags(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "ListTags", input, options)
end
@doc """
Allows you to purchase a reserved node offering.
Reserved nodes are not eligible for cancellation and are non-refundable.
"""
def purchase_reserved_nodes_offering(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "PurchaseReservedNodesOffering", input, options)
end
@doc """
Modifies the parameters of a parameter group to the engine or system default
value.
You can reset specific parameters by submitting a list of parameter names. To
reset the entire parameter group, specify the AllParameters and
ParameterGroupName parameters.
"""
def reset_parameter_group(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "ResetParameterGroup", input, options)
end
@doc """
A tag is a key-value pair where the key and value are case-sensitive.
You can use tags to categorize and track all your MemoryDB resources. When you
add or remove tags on clusters, those actions will be replicated to all nodes in
the cluster. For more information, see [Resource-level permissions](https://docs.aws.amazon.com/MemoryDB/latest/devguide/iam.resourcelevelpermissions.html).
For example, you can use cost-allocation tags to your MemoryDB resources, Amazon
generates a cost allocation report as a comma-separated value (CSV) file with
your usage and costs aggregated by your tags. You can apply tags that represent
business categories (such as cost centers, application names, or owners) to
organize your costs across multiple services. For more information, see [Using Cost Allocation
Tags](https://docs.aws.amazon.com/MemoryDB/latest/devguide/tagging.html).
"""
def tag_resource(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "TagResource", input, options)
end
@doc """
Use this operation to remove tags on a resource
"""
def untag_resource(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "UntagResource", input, options)
end
@doc """
Changes the list of users that belong to the Access Control List.
"""
def update_acl(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "UpdateACL", input, options)
end
@doc """
Modifies the settings for a cluster.
You can use this operation to change one or more cluster configuration settings
by specifying the settings and the new values.
"""
def update_cluster(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "UpdateCluster", input, options)
end
@doc """
Updates the parameters of a parameter group.
You can modify up to 20 parameters in a single request by submitting a list
parameter name and value pairs.
"""
def update_parameter_group(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "UpdateParameterGroup", input, options)
end
@doc """
Updates a subnet group.
For more information, see [Updating a subnet group](https://docs.aws.amazon.com/MemoryDB/latest/devguide/ubnetGroups.Modifying.html)
"""
def update_subnet_group(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "UpdateSubnetGroup", input, options)
end
@doc """
Changes user password(s) and/or access string.
"""
def update_user(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "UpdateUser", input, options)
end
end