google-cloud-memorystore 0.2.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {google_cloud_memorystore-0.2.0/google_cloud_memorystore.egg-info → google_cloud_memorystore-0.3.0}/PKG-INFO +1 -1
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore/__init__.py +2 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore/gapic_version.py +1 -1
- google_cloud_memorystore-0.3.0/google/cloud/memorystore_v1/__init__.py +207 -0
- {google_cloud_memorystore-0.2.0/google/cloud/memorystore_v1beta → google_cloud_memorystore-0.3.0/google/cloud/memorystore_v1}/gapic_version.py +1 -1
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1/services/memorystore/client.py +58 -14
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1/types/__init__.py +2 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1/types/memorystore.py +217 -3
- google_cloud_memorystore-0.3.0/google/cloud/memorystore_v1beta/__init__.py +167 -0
- {google_cloud_memorystore-0.2.0/google/cloud/memorystore_v1 → google_cloud_memorystore-0.3.0/google/cloud/memorystore_v1beta}/gapic_version.py +1 -1
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1beta/services/memorystore/client.py +32 -14
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0/google_cloud_memorystore.egg-info}/PKG-INFO +1 -1
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/tests/unit/gapic/memorystore_v1/test_memorystore.py +351 -63
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/tests/unit/gapic/memorystore_v1beta/test_memorystore.py +225 -29
- google_cloud_memorystore-0.2.0/google/cloud/memorystore_v1/__init__.py +0 -101
- google_cloud_memorystore-0.2.0/google/cloud/memorystore_v1beta/__init__.py +0 -63
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/LICENSE +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/MANIFEST.in +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/README.rst +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore/py.typed +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1/gapic_metadata.json +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1/py.typed +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1/services/__init__.py +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1/services/memorystore/__init__.py +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1/services/memorystore/pagers.py +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1/services/memorystore/transports/__init__.py +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1/services/memorystore/transports/base.py +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1/services/memorystore/transports/rest.py +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1/services/memorystore/transports/rest_base.py +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1beta/gapic_metadata.json +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1beta/py.typed +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1beta/services/__init__.py +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1beta/services/memorystore/__init__.py +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1beta/services/memorystore/pagers.py +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1beta/services/memorystore/transports/__init__.py +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1beta/services/memorystore/transports/base.py +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1beta/services/memorystore/transports/rest.py +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1beta/services/memorystore/transports/rest_base.py +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1beta/types/__init__.py +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google/cloud/memorystore_v1beta/types/memorystore.py +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google_cloud_memorystore.egg-info/SOURCES.txt +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google_cloud_memorystore.egg-info/dependency_links.txt +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google_cloud_memorystore.egg-info/not-zip-safe +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google_cloud_memorystore.egg-info/requires.txt +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/google_cloud_memorystore.egg-info/top_level.txt +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/setup.cfg +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/setup.py +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/tests/__init__.py +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/tests/unit/__init__.py +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/tests/unit/gapic/__init__.py +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/tests/unit/gapic/memorystore_v1/__init__.py +0 -0
- {google_cloud_memorystore-0.2.0 → google_cloud_memorystore-0.3.0}/tests/unit/gapic/memorystore_v1beta/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: google-cloud-memorystore
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Google Cloud Memorystore API client library
|
|
5
5
|
Home-page: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-memorystore
|
|
6
6
|
Author: Google LLC
|
|
@@ -32,6 +32,7 @@ from google.cloud.memorystore_v1.types.memorystore import (
|
|
|
32
32
|
DeleteBackupRequest,
|
|
33
33
|
DeleteInstanceRequest,
|
|
34
34
|
DiscoveryEndpoint,
|
|
35
|
+
EncryptionInfo,
|
|
35
36
|
ExportBackupRequest,
|
|
36
37
|
GetBackupCollectionRequest,
|
|
37
38
|
GetBackupRequest,
|
|
@@ -72,6 +73,7 @@ __all__ = (
|
|
|
72
73
|
"DeleteBackupRequest",
|
|
73
74
|
"DeleteInstanceRequest",
|
|
74
75
|
"DiscoveryEndpoint",
|
|
76
|
+
"EncryptionInfo",
|
|
75
77
|
"ExportBackupRequest",
|
|
76
78
|
"GetBackupCollectionRequest",
|
|
77
79
|
"GetBackupRequest",
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright 2025 Google LLC
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
16
|
+
import sys
|
|
17
|
+
|
|
18
|
+
import google.api_core as api_core
|
|
19
|
+
|
|
20
|
+
from google.cloud.memorystore_v1 import gapic_version as package_version
|
|
21
|
+
|
|
22
|
+
__version__ = package_version.__version__
|
|
23
|
+
|
|
24
|
+
if sys.version_info >= (3, 8): # pragma: NO COVER
|
|
25
|
+
from importlib import metadata
|
|
26
|
+
else: # pragma: NO COVER
|
|
27
|
+
# TODO(https://github.com/googleapis/python-api-core/issues/835): Remove
|
|
28
|
+
# this code path once we drop support for Python 3.7
|
|
29
|
+
import importlib_metadata as metadata
|
|
30
|
+
|
|
31
|
+
from .services.memorystore import MemorystoreClient
|
|
32
|
+
from .types.memorystore import (
|
|
33
|
+
AutomatedBackupConfig,
|
|
34
|
+
Backup,
|
|
35
|
+
BackupCollection,
|
|
36
|
+
BackupFile,
|
|
37
|
+
BackupInstanceRequest,
|
|
38
|
+
CertificateAuthority,
|
|
39
|
+
ConnectionType,
|
|
40
|
+
CreateInstanceRequest,
|
|
41
|
+
CrossInstanceReplicationConfig,
|
|
42
|
+
DeleteBackupRequest,
|
|
43
|
+
DeleteInstanceRequest,
|
|
44
|
+
DiscoveryEndpoint,
|
|
45
|
+
EncryptionInfo,
|
|
46
|
+
ExportBackupRequest,
|
|
47
|
+
GetBackupCollectionRequest,
|
|
48
|
+
GetBackupRequest,
|
|
49
|
+
GetCertificateAuthorityRequest,
|
|
50
|
+
GetInstanceRequest,
|
|
51
|
+
Instance,
|
|
52
|
+
ListBackupCollectionsRequest,
|
|
53
|
+
ListBackupCollectionsResponse,
|
|
54
|
+
ListBackupsRequest,
|
|
55
|
+
ListBackupsResponse,
|
|
56
|
+
ListInstancesRequest,
|
|
57
|
+
ListInstancesResponse,
|
|
58
|
+
MaintenancePolicy,
|
|
59
|
+
MaintenanceSchedule,
|
|
60
|
+
NodeConfig,
|
|
61
|
+
OperationMetadata,
|
|
62
|
+
PersistenceConfig,
|
|
63
|
+
PscAttachmentDetail,
|
|
64
|
+
PscAutoConnection,
|
|
65
|
+
PscConnection,
|
|
66
|
+
PscConnectionStatus,
|
|
67
|
+
RescheduleMaintenanceRequest,
|
|
68
|
+
UpdateInstanceRequest,
|
|
69
|
+
WeeklyMaintenanceWindow,
|
|
70
|
+
ZoneDistributionConfig,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
if hasattr(api_core, "check_python_version") and hasattr(
|
|
74
|
+
api_core, "check_dependency_versions"
|
|
75
|
+
): # pragma: NO COVER
|
|
76
|
+
api_core.check_python_version("google.cloud.memorystore_v1") # type: ignore
|
|
77
|
+
api_core.check_dependency_versions("google.cloud.memorystore_v1") # type: ignore
|
|
78
|
+
else: # pragma: NO COVER
|
|
79
|
+
# An older version of api_core is installed which does not define the
|
|
80
|
+
# functions above. We do equivalent checks manually.
|
|
81
|
+
try:
|
|
82
|
+
import sys
|
|
83
|
+
import warnings
|
|
84
|
+
|
|
85
|
+
_py_version_str = sys.version.split()[0]
|
|
86
|
+
_package_label = "google.cloud.memorystore_v1"
|
|
87
|
+
if sys.version_info < (3, 9):
|
|
88
|
+
warnings.warn(
|
|
89
|
+
"You are using a non-supported Python version "
|
|
90
|
+
+ f"({_py_version_str}). Google will not post any further "
|
|
91
|
+
+ f"updates to {_package_label} supporting this Python version. "
|
|
92
|
+
+ "Please upgrade to the latest Python version, or at "
|
|
93
|
+
+ f"least to Python 3.9, and then update {_package_label}.",
|
|
94
|
+
FutureWarning,
|
|
95
|
+
)
|
|
96
|
+
if sys.version_info[:2] == (3, 9):
|
|
97
|
+
warnings.warn(
|
|
98
|
+
f"You are using a Python version ({_py_version_str}) "
|
|
99
|
+
+ f"which Google will stop supporting in {_package_label} in "
|
|
100
|
+
+ "January 2026. Please "
|
|
101
|
+
+ "upgrade to the latest Python version, or at "
|
|
102
|
+
+ "least to Python 3.10, before then, and "
|
|
103
|
+
+ f"then update {_package_label}.",
|
|
104
|
+
FutureWarning,
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
def parse_version_to_tuple(version_string: str):
|
|
108
|
+
"""Safely converts a semantic version string to a comparable tuple of integers.
|
|
109
|
+
Example: "4.25.8" -> (4, 25, 8)
|
|
110
|
+
Ignores non-numeric parts and handles common version formats.
|
|
111
|
+
Args:
|
|
112
|
+
version_string: Version string in the format "x.y.z" or "x.y.z<suffix>"
|
|
113
|
+
Returns:
|
|
114
|
+
Tuple of integers for the parsed version string.
|
|
115
|
+
"""
|
|
116
|
+
parts = []
|
|
117
|
+
for part in version_string.split("."):
|
|
118
|
+
try:
|
|
119
|
+
parts.append(int(part))
|
|
120
|
+
except ValueError:
|
|
121
|
+
# If it's a non-numeric part (e.g., '1.0.0b1' -> 'b1'), stop here.
|
|
122
|
+
# This is a simplification compared to 'packaging.parse_version', but sufficient
|
|
123
|
+
# for comparing strictly numeric semantic versions.
|
|
124
|
+
break
|
|
125
|
+
return tuple(parts)
|
|
126
|
+
|
|
127
|
+
def _get_version(dependency_name):
|
|
128
|
+
try:
|
|
129
|
+
version_string: str = metadata.version(dependency_name)
|
|
130
|
+
parsed_version = parse_version_to_tuple(version_string)
|
|
131
|
+
return (parsed_version, version_string)
|
|
132
|
+
except Exception:
|
|
133
|
+
# Catch exceptions from metadata.version() (e.g., PackageNotFoundError)
|
|
134
|
+
# or errors during parse_version_to_tuple
|
|
135
|
+
return (None, "--")
|
|
136
|
+
|
|
137
|
+
_dependency_package = "google.protobuf"
|
|
138
|
+
_next_supported_version = "4.25.8"
|
|
139
|
+
_next_supported_version_tuple = (4, 25, 8)
|
|
140
|
+
_recommendation = " (we recommend 6.x)"
|
|
141
|
+
(_version_used, _version_used_string) = _get_version(_dependency_package)
|
|
142
|
+
if _version_used and _version_used < _next_supported_version_tuple:
|
|
143
|
+
warnings.warn(
|
|
144
|
+
f"Package {_package_label} depends on "
|
|
145
|
+
+ f"{_dependency_package}, currently installed at version "
|
|
146
|
+
+ f"{_version_used_string}. Future updates to "
|
|
147
|
+
+ f"{_package_label} will require {_dependency_package} at "
|
|
148
|
+
+ f"version {_next_supported_version} or higher{_recommendation}."
|
|
149
|
+
+ " Please ensure "
|
|
150
|
+
+ "that either (a) your Python environment doesn't pin the "
|
|
151
|
+
+ f"version of {_dependency_package}, so that updates to "
|
|
152
|
+
+ f"{_package_label} can require the higher version, or "
|
|
153
|
+
+ "(b) you manually update your Python environment to use at "
|
|
154
|
+
+ f"least version {_next_supported_version} of "
|
|
155
|
+
+ f"{_dependency_package}.",
|
|
156
|
+
FutureWarning,
|
|
157
|
+
)
|
|
158
|
+
except Exception:
|
|
159
|
+
warnings.warn(
|
|
160
|
+
"Could not determine the version of Python "
|
|
161
|
+
+ "currently being used. To continue receiving "
|
|
162
|
+
+ "updates for {_package_label}, ensure you are "
|
|
163
|
+
+ "using a supported version of Python; see "
|
|
164
|
+
+ "https://devguide.python.org/versions/"
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
__all__ = (
|
|
168
|
+
"AutomatedBackupConfig",
|
|
169
|
+
"Backup",
|
|
170
|
+
"BackupCollection",
|
|
171
|
+
"BackupFile",
|
|
172
|
+
"BackupInstanceRequest",
|
|
173
|
+
"CertificateAuthority",
|
|
174
|
+
"ConnectionType",
|
|
175
|
+
"CreateInstanceRequest",
|
|
176
|
+
"CrossInstanceReplicationConfig",
|
|
177
|
+
"DeleteBackupRequest",
|
|
178
|
+
"DeleteInstanceRequest",
|
|
179
|
+
"DiscoveryEndpoint",
|
|
180
|
+
"EncryptionInfo",
|
|
181
|
+
"ExportBackupRequest",
|
|
182
|
+
"GetBackupCollectionRequest",
|
|
183
|
+
"GetBackupRequest",
|
|
184
|
+
"GetCertificateAuthorityRequest",
|
|
185
|
+
"GetInstanceRequest",
|
|
186
|
+
"Instance",
|
|
187
|
+
"ListBackupCollectionsRequest",
|
|
188
|
+
"ListBackupCollectionsResponse",
|
|
189
|
+
"ListBackupsRequest",
|
|
190
|
+
"ListBackupsResponse",
|
|
191
|
+
"ListInstancesRequest",
|
|
192
|
+
"ListInstancesResponse",
|
|
193
|
+
"MaintenancePolicy",
|
|
194
|
+
"MaintenanceSchedule",
|
|
195
|
+
"MemorystoreClient",
|
|
196
|
+
"NodeConfig",
|
|
197
|
+
"OperationMetadata",
|
|
198
|
+
"PersistenceConfig",
|
|
199
|
+
"PscAttachmentDetail",
|
|
200
|
+
"PscAutoConnection",
|
|
201
|
+
"PscConnection",
|
|
202
|
+
"PscConnectionStatus",
|
|
203
|
+
"RescheduleMaintenanceRequest",
|
|
204
|
+
"UpdateInstanceRequest",
|
|
205
|
+
"WeeklyMaintenanceWindow",
|
|
206
|
+
"ZoneDistributionConfig",
|
|
207
|
+
)
|
|
@@ -151,6 +151,34 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
151
151
|
_DEFAULT_ENDPOINT_TEMPLATE = "memorystore.{UNIVERSE_DOMAIN}"
|
|
152
152
|
_DEFAULT_UNIVERSE = "googleapis.com"
|
|
153
153
|
|
|
154
|
+
@staticmethod
|
|
155
|
+
def _use_client_cert_effective():
|
|
156
|
+
"""Returns whether client certificate should be used for mTLS if the
|
|
157
|
+
google-auth version supports should_use_client_cert automatic mTLS enablement.
|
|
158
|
+
|
|
159
|
+
Alternatively, read from the GOOGLE_API_USE_CLIENT_CERTIFICATE env var.
|
|
160
|
+
|
|
161
|
+
Returns:
|
|
162
|
+
bool: whether client certificate should be used for mTLS
|
|
163
|
+
Raises:
|
|
164
|
+
ValueError: (If using a version of google-auth without should_use_client_cert and
|
|
165
|
+
GOOGLE_API_USE_CLIENT_CERTIFICATE is set to an unexpected value.)
|
|
166
|
+
"""
|
|
167
|
+
# check if google-auth version supports should_use_client_cert for automatic mTLS enablement
|
|
168
|
+
if hasattr(mtls, "should_use_client_cert"): # pragma: NO COVER
|
|
169
|
+
return mtls.should_use_client_cert()
|
|
170
|
+
else: # pragma: NO COVER
|
|
171
|
+
# if unsupported, fallback to reading from env var
|
|
172
|
+
use_client_cert_str = os.getenv(
|
|
173
|
+
"GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"
|
|
174
|
+
).lower()
|
|
175
|
+
if use_client_cert_str not in ("true", "false"):
|
|
176
|
+
raise ValueError(
|
|
177
|
+
"Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be"
|
|
178
|
+
" either `true` or `false`"
|
|
179
|
+
)
|
|
180
|
+
return use_client_cert_str == "true"
|
|
181
|
+
|
|
154
182
|
@classmethod
|
|
155
183
|
def from_service_account_info(cls, info: dict, *args, **kwargs):
|
|
156
184
|
"""Creates an instance of this client using the provided credentials
|
|
@@ -290,6 +318,32 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
290
318
|
)
|
|
291
319
|
return m.groupdict() if m else {}
|
|
292
320
|
|
|
321
|
+
@staticmethod
|
|
322
|
+
def crypto_key_version_path(
|
|
323
|
+
project: str,
|
|
324
|
+
location: str,
|
|
325
|
+
key_ring: str,
|
|
326
|
+
crypto_key: str,
|
|
327
|
+
crypto_key_version: str,
|
|
328
|
+
) -> str:
|
|
329
|
+
"""Returns a fully-qualified crypto_key_version string."""
|
|
330
|
+
return "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}".format(
|
|
331
|
+
project=project,
|
|
332
|
+
location=location,
|
|
333
|
+
key_ring=key_ring,
|
|
334
|
+
crypto_key=crypto_key,
|
|
335
|
+
crypto_key_version=crypto_key_version,
|
|
336
|
+
)
|
|
337
|
+
|
|
338
|
+
@staticmethod
|
|
339
|
+
def parse_crypto_key_version_path(path: str) -> Dict[str, str]:
|
|
340
|
+
"""Parses a crypto_key_version path into its component segments."""
|
|
341
|
+
m = re.match(
|
|
342
|
+
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/keyRings/(?P<key_ring>.+?)/cryptoKeys/(?P<crypto_key>.+?)/cryptoKeyVersions/(?P<crypto_key_version>.+?)$",
|
|
343
|
+
path,
|
|
344
|
+
)
|
|
345
|
+
return m.groupdict() if m else {}
|
|
346
|
+
|
|
293
347
|
@staticmethod
|
|
294
348
|
def forwarding_rule_path(
|
|
295
349
|
project: str,
|
|
@@ -493,12 +547,8 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
493
547
|
)
|
|
494
548
|
if client_options is None:
|
|
495
549
|
client_options = client_options_lib.ClientOptions()
|
|
496
|
-
use_client_cert =
|
|
550
|
+
use_client_cert = MemorystoreClient._use_client_cert_effective()
|
|
497
551
|
use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto")
|
|
498
|
-
if use_client_cert not in ("true", "false"):
|
|
499
|
-
raise ValueError(
|
|
500
|
-
"Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`"
|
|
501
|
-
)
|
|
502
552
|
if use_mtls_endpoint not in ("auto", "never", "always"):
|
|
503
553
|
raise MutualTLSChannelError(
|
|
504
554
|
"Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`"
|
|
@@ -506,7 +556,7 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
506
556
|
|
|
507
557
|
# Figure out the client cert source to use.
|
|
508
558
|
client_cert_source = None
|
|
509
|
-
if use_client_cert
|
|
559
|
+
if use_client_cert:
|
|
510
560
|
if client_options.client_cert_source:
|
|
511
561
|
client_cert_source = client_options.client_cert_source
|
|
512
562
|
elif mtls.has_default_client_cert_source():
|
|
@@ -538,20 +588,14 @@ class MemorystoreClient(metaclass=MemorystoreClientMeta):
|
|
|
538
588
|
google.auth.exceptions.MutualTLSChannelError: If GOOGLE_API_USE_MTLS_ENDPOINT
|
|
539
589
|
is not any of ["auto", "never", "always"].
|
|
540
590
|
"""
|
|
541
|
-
use_client_cert =
|
|
542
|
-
"GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"
|
|
543
|
-
).lower()
|
|
591
|
+
use_client_cert = MemorystoreClient._use_client_cert_effective()
|
|
544
592
|
use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto").lower()
|
|
545
593
|
universe_domain_env = os.getenv("GOOGLE_CLOUD_UNIVERSE_DOMAIN")
|
|
546
|
-
if use_client_cert not in ("true", "false"):
|
|
547
|
-
raise ValueError(
|
|
548
|
-
"Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`"
|
|
549
|
-
)
|
|
550
594
|
if use_mtls_endpoint not in ("auto", "never", "always"):
|
|
551
595
|
raise MutualTLSChannelError(
|
|
552
596
|
"Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`"
|
|
553
597
|
)
|
|
554
|
-
return use_client_cert
|
|
598
|
+
return use_client_cert, use_mtls_endpoint, universe_domain_env
|
|
555
599
|
|
|
556
600
|
@staticmethod
|
|
557
601
|
def _get_client_cert_source(provided_cert_source, use_cert_flag):
|
|
@@ -26,6 +26,7 @@ from .memorystore import (
|
|
|
26
26
|
DeleteBackupRequest,
|
|
27
27
|
DeleteInstanceRequest,
|
|
28
28
|
DiscoveryEndpoint,
|
|
29
|
+
EncryptionInfo,
|
|
29
30
|
ExportBackupRequest,
|
|
30
31
|
GetBackupCollectionRequest,
|
|
31
32
|
GetBackupRequest,
|
|
@@ -65,6 +66,7 @@ __all__ = (
|
|
|
65
66
|
"DeleteBackupRequest",
|
|
66
67
|
"DeleteInstanceRequest",
|
|
67
68
|
"DiscoveryEndpoint",
|
|
69
|
+
"EncryptionInfo",
|
|
68
70
|
"ExportBackupRequest",
|
|
69
71
|
"GetBackupCollectionRequest",
|
|
70
72
|
"GetBackupRequest",
|
|
@@ -64,6 +64,7 @@ __protobuf__ = proto.module(
|
|
|
64
64
|
"GetCertificateAuthorityRequest",
|
|
65
65
|
"CertificateAuthority",
|
|
66
66
|
"OperationMetadata",
|
|
67
|
+
"EncryptionInfo",
|
|
67
68
|
},
|
|
68
69
|
)
|
|
69
70
|
|
|
@@ -165,9 +166,13 @@ class Instance(proto.Message):
|
|
|
165
166
|
shard_count (int):
|
|
166
167
|
Optional. Number of shards for the instance.
|
|
167
168
|
discovery_endpoints (MutableSequence[google.cloud.memorystore_v1.types.DiscoveryEndpoint]):
|
|
168
|
-
Output only. Deprecated:
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
Output only. Deprecated: The discovery_endpoints parameter
|
|
170
|
+
is deprecated. As a result, it will not be populated if the
|
|
171
|
+
connections are created using endpoints parameter. Instead
|
|
172
|
+
of this parameter, for discovery, use
|
|
173
|
+
endpoints.connections.pscConnection and
|
|
174
|
+
endpoints.connections.pscAutoConnection with connectionType
|
|
175
|
+
CONNECTION_TYPE_DISCOVERY.
|
|
171
176
|
node_type (google.cloud.memorystore_v1.types.Instance.NodeType):
|
|
172
177
|
Optional. Machine type for individual nodes
|
|
173
178
|
of the instance.
|
|
@@ -201,11 +206,26 @@ class Instance(proto.Message):
|
|
|
201
206
|
Optional. Endpoints for the instance.
|
|
202
207
|
mode (google.cloud.memorystore_v1.types.Instance.Mode):
|
|
203
208
|
Optional. The mode config for the instance.
|
|
209
|
+
simulate_maintenance_event (bool):
|
|
210
|
+
Optional. Input only. Simulate a maintenance
|
|
211
|
+
event.
|
|
212
|
+
|
|
213
|
+
This field is a member of `oneof`_ ``_simulate_maintenance_event``.
|
|
204
214
|
ondemand_maintenance (bool):
|
|
205
215
|
Optional. Input only. Ondemand maintenance
|
|
206
216
|
for the instance.
|
|
207
217
|
|
|
208
218
|
This field is a member of `oneof`_ ``_ondemand_maintenance``.
|
|
219
|
+
satisfies_pzs (bool):
|
|
220
|
+
Optional. Output only. Reserved for future
|
|
221
|
+
use.
|
|
222
|
+
|
|
223
|
+
This field is a member of `oneof`_ ``_satisfies_pzs``.
|
|
224
|
+
satisfies_pzi (bool):
|
|
225
|
+
Optional. Output only. Reserved for future
|
|
226
|
+
use.
|
|
227
|
+
|
|
228
|
+
This field is a member of `oneof`_ ``_satisfies_pzi``.
|
|
209
229
|
maintenance_policy (google.cloud.memorystore_v1.types.MaintenancePolicy):
|
|
210
230
|
Optional. The maintenance policy for the
|
|
211
231
|
instance. If not provided, the maintenance event
|
|
@@ -225,6 +245,14 @@ class Instance(proto.Message):
|
|
|
225
245
|
are deleted.
|
|
226
246
|
|
|
227
247
|
This field is a member of `oneof`_ ``_async_instance_endpoints_deletion_enabled``.
|
|
248
|
+
kms_key (str):
|
|
249
|
+
Optional. The KMS key used to encrypt the
|
|
250
|
+
at-rest data of the cluster.
|
|
251
|
+
|
|
252
|
+
This field is a member of `oneof`_ ``_kms_key``.
|
|
253
|
+
encryption_info (google.cloud.memorystore_v1.types.EncryptionInfo):
|
|
254
|
+
Output only. Encryption information of the
|
|
255
|
+
data at rest of the cluster.
|
|
228
256
|
backup_collection (str):
|
|
229
257
|
Output only. The backup collection full
|
|
230
258
|
resource name. Example:
|
|
@@ -234,6 +262,24 @@ class Instance(proto.Message):
|
|
|
234
262
|
automated_backup_config (google.cloud.memorystore_v1.types.AutomatedBackupConfig):
|
|
235
263
|
Optional. The automated backup config for the
|
|
236
264
|
instance.
|
|
265
|
+
maintenance_version (str):
|
|
266
|
+
Optional. This field can be used to trigger self service
|
|
267
|
+
update to indicate the desired maintenance version. The
|
|
268
|
+
input to this field can be determined by the
|
|
269
|
+
available_maintenance_versions field.
|
|
270
|
+
|
|
271
|
+
This field is a member of `oneof`_ ``_maintenance_version``.
|
|
272
|
+
effective_maintenance_version (str):
|
|
273
|
+
Output only. This field represents the actual
|
|
274
|
+
maintenance version of the instance.
|
|
275
|
+
|
|
276
|
+
This field is a member of `oneof`_ ``_effective_maintenance_version``.
|
|
277
|
+
available_maintenance_versions (MutableSequence[str]):
|
|
278
|
+
Output only. This field is used to determine
|
|
279
|
+
the available maintenance versions for the self
|
|
280
|
+
service update.
|
|
281
|
+
allow_fewer_zones_deployment (bool):
|
|
282
|
+
Optional. Immutable. Deprecated, do not use.
|
|
237
283
|
"""
|
|
238
284
|
|
|
239
285
|
class State(proto.Enum):
|
|
@@ -616,11 +662,26 @@ class Instance(proto.Message):
|
|
|
616
662
|
number=26,
|
|
617
663
|
enum=Mode,
|
|
618
664
|
)
|
|
665
|
+
simulate_maintenance_event: bool = proto.Field(
|
|
666
|
+
proto.BOOL,
|
|
667
|
+
number=27,
|
|
668
|
+
optional=True,
|
|
669
|
+
)
|
|
619
670
|
ondemand_maintenance: bool = proto.Field(
|
|
620
671
|
proto.BOOL,
|
|
621
672
|
number=28,
|
|
622
673
|
optional=True,
|
|
623
674
|
)
|
|
675
|
+
satisfies_pzs: bool = proto.Field(
|
|
676
|
+
proto.BOOL,
|
|
677
|
+
number=29,
|
|
678
|
+
optional=True,
|
|
679
|
+
)
|
|
680
|
+
satisfies_pzi: bool = proto.Field(
|
|
681
|
+
proto.BOOL,
|
|
682
|
+
number=30,
|
|
683
|
+
optional=True,
|
|
684
|
+
)
|
|
624
685
|
maintenance_policy: "MaintenancePolicy" = proto.Field(
|
|
625
686
|
proto.MESSAGE,
|
|
626
687
|
number=31,
|
|
@@ -641,6 +702,16 @@ class Instance(proto.Message):
|
|
|
641
702
|
number=44,
|
|
642
703
|
optional=True,
|
|
643
704
|
)
|
|
705
|
+
kms_key: str = proto.Field(
|
|
706
|
+
proto.STRING,
|
|
707
|
+
number=45,
|
|
708
|
+
optional=True,
|
|
709
|
+
)
|
|
710
|
+
encryption_info: "EncryptionInfo" = proto.Field(
|
|
711
|
+
proto.MESSAGE,
|
|
712
|
+
number=46,
|
|
713
|
+
message="EncryptionInfo",
|
|
714
|
+
)
|
|
644
715
|
backup_collection: str = proto.Field(
|
|
645
716
|
proto.STRING,
|
|
646
717
|
number=47,
|
|
@@ -651,6 +722,24 @@ class Instance(proto.Message):
|
|
|
651
722
|
number=48,
|
|
652
723
|
message="AutomatedBackupConfig",
|
|
653
724
|
)
|
|
725
|
+
maintenance_version: str = proto.Field(
|
|
726
|
+
proto.STRING,
|
|
727
|
+
number=49,
|
|
728
|
+
optional=True,
|
|
729
|
+
)
|
|
730
|
+
effective_maintenance_version: str = proto.Field(
|
|
731
|
+
proto.STRING,
|
|
732
|
+
number=50,
|
|
733
|
+
optional=True,
|
|
734
|
+
)
|
|
735
|
+
available_maintenance_versions: MutableSequence[str] = proto.RepeatedField(
|
|
736
|
+
proto.STRING,
|
|
737
|
+
number=51,
|
|
738
|
+
)
|
|
739
|
+
allow_fewer_zones_deployment: bool = proto.Field(
|
|
740
|
+
proto.BOOL,
|
|
741
|
+
number=54,
|
|
742
|
+
)
|
|
654
743
|
|
|
655
744
|
|
|
656
745
|
class AutomatedBackupConfig(proto.Message):
|
|
@@ -751,6 +840,15 @@ class BackupCollection(proto.Message):
|
|
|
751
840
|
create_time (google.protobuf.timestamp_pb2.Timestamp):
|
|
752
841
|
Output only. The time when the backup
|
|
753
842
|
collection was created.
|
|
843
|
+
total_backup_size_bytes (int):
|
|
844
|
+
Output only. Total size of all backups in the
|
|
845
|
+
backup collection.
|
|
846
|
+
total_backup_count (int):
|
|
847
|
+
Output only. Total number of backups in the
|
|
848
|
+
backup collection.
|
|
849
|
+
last_backup_time (google.protobuf.timestamp_pb2.Timestamp):
|
|
850
|
+
Output only. The last time a backup was
|
|
851
|
+
created in the backup collection.
|
|
754
852
|
"""
|
|
755
853
|
|
|
756
854
|
name: str = proto.Field(
|
|
@@ -778,6 +876,19 @@ class BackupCollection(proto.Message):
|
|
|
778
876
|
number=7,
|
|
779
877
|
message=timestamp_pb2.Timestamp,
|
|
780
878
|
)
|
|
879
|
+
total_backup_size_bytes: int = proto.Field(
|
|
880
|
+
proto.INT64,
|
|
881
|
+
number=8,
|
|
882
|
+
)
|
|
883
|
+
total_backup_count: int = proto.Field(
|
|
884
|
+
proto.INT64,
|
|
885
|
+
number=10,
|
|
886
|
+
)
|
|
887
|
+
last_backup_time: timestamp_pb2.Timestamp = proto.Field(
|
|
888
|
+
proto.MESSAGE,
|
|
889
|
+
number=11,
|
|
890
|
+
message=timestamp_pb2.Timestamp,
|
|
891
|
+
)
|
|
781
892
|
|
|
782
893
|
|
|
783
894
|
class Backup(proto.Message):
|
|
@@ -821,6 +932,9 @@ class Backup(proto.Message):
|
|
|
821
932
|
Output only. Type of the backup.
|
|
822
933
|
state (google.cloud.memorystore_v1.types.Backup.State):
|
|
823
934
|
Output only. State of the backup.
|
|
935
|
+
encryption_info (google.cloud.memorystore_v1.types.EncryptionInfo):
|
|
936
|
+
Output only. Encryption information of the
|
|
937
|
+
backup.
|
|
824
938
|
uid (str):
|
|
825
939
|
Output only. System assigned unique
|
|
826
940
|
identifier of the backup.
|
|
@@ -922,6 +1036,11 @@ class Backup(proto.Message):
|
|
|
922
1036
|
number=13,
|
|
923
1037
|
enum=State,
|
|
924
1038
|
)
|
|
1039
|
+
encryption_info: "EncryptionInfo" = proto.Field(
|
|
1040
|
+
proto.MESSAGE,
|
|
1041
|
+
number=14,
|
|
1042
|
+
message="EncryptionInfo",
|
|
1043
|
+
)
|
|
925
1044
|
uid: str = proto.Field(
|
|
926
1045
|
proto.STRING,
|
|
927
1046
|
number=15,
|
|
@@ -2297,4 +2416,99 @@ class OperationMetadata(proto.Message):
|
|
|
2297
2416
|
)
|
|
2298
2417
|
|
|
2299
2418
|
|
|
2419
|
+
class EncryptionInfo(proto.Message):
|
|
2420
|
+
r"""EncryptionInfo describes the encryption information of a
|
|
2421
|
+
cluster.
|
|
2422
|
+
|
|
2423
|
+
Attributes:
|
|
2424
|
+
encryption_type (google.cloud.memorystore_v1.types.EncryptionInfo.Type):
|
|
2425
|
+
Output only. Type of encryption.
|
|
2426
|
+
kms_key_versions (MutableSequence[str]):
|
|
2427
|
+
Output only. KMS key versions that are being
|
|
2428
|
+
used to protect the data at-rest.
|
|
2429
|
+
kms_key_primary_state (google.cloud.memorystore_v1.types.EncryptionInfo.KmsKeyState):
|
|
2430
|
+
Output only. The state of the primary version
|
|
2431
|
+
of the KMS key perceived by the system. This
|
|
2432
|
+
field is not populated in backups.
|
|
2433
|
+
last_update_time (google.protobuf.timestamp_pb2.Timestamp):
|
|
2434
|
+
Output only. The most recent time when the
|
|
2435
|
+
encryption info was updated.
|
|
2436
|
+
"""
|
|
2437
|
+
|
|
2438
|
+
class Type(proto.Enum):
|
|
2439
|
+
r"""Possible encryption types.
|
|
2440
|
+
|
|
2441
|
+
Values:
|
|
2442
|
+
TYPE_UNSPECIFIED (0):
|
|
2443
|
+
Encryption type not specified. Defaults to
|
|
2444
|
+
GOOGLE_DEFAULT_ENCRYPTION.
|
|
2445
|
+
GOOGLE_DEFAULT_ENCRYPTION (1):
|
|
2446
|
+
The data is encrypted at rest with a key that
|
|
2447
|
+
is fully managed by Google. No key version will
|
|
2448
|
+
be populated. This is the default state.
|
|
2449
|
+
CUSTOMER_MANAGED_ENCRYPTION (2):
|
|
2450
|
+
The data is encrypted at rest with a key that
|
|
2451
|
+
is managed by the customer. KMS key versions
|
|
2452
|
+
will be populated.
|
|
2453
|
+
"""
|
|
2454
|
+
TYPE_UNSPECIFIED = 0
|
|
2455
|
+
GOOGLE_DEFAULT_ENCRYPTION = 1
|
|
2456
|
+
CUSTOMER_MANAGED_ENCRYPTION = 2
|
|
2457
|
+
|
|
2458
|
+
class KmsKeyState(proto.Enum):
|
|
2459
|
+
r"""The state of the KMS key perceived by the system. Refer to
|
|
2460
|
+
the public documentation for the impact of each state.
|
|
2461
|
+
|
|
2462
|
+
Values:
|
|
2463
|
+
KMS_KEY_STATE_UNSPECIFIED (0):
|
|
2464
|
+
The default value. This value is unused.
|
|
2465
|
+
ENABLED (1):
|
|
2466
|
+
The KMS key is enabled and correctly
|
|
2467
|
+
configured.
|
|
2468
|
+
PERMISSION_DENIED (2):
|
|
2469
|
+
Permission denied on the KMS key.
|
|
2470
|
+
DISABLED (3):
|
|
2471
|
+
The KMS key is disabled.
|
|
2472
|
+
DESTROYED (4):
|
|
2473
|
+
The KMS key is destroyed.
|
|
2474
|
+
DESTROY_SCHEDULED (5):
|
|
2475
|
+
The KMS key is scheduled to be destroyed.
|
|
2476
|
+
EKM_KEY_UNREACHABLE_DETECTED (6):
|
|
2477
|
+
The EKM key is unreachable.
|
|
2478
|
+
BILLING_DISABLED (7):
|
|
2479
|
+
Billing is disabled for the project.
|
|
2480
|
+
UNKNOWN_FAILURE (8):
|
|
2481
|
+
All other unknown failures.
|
|
2482
|
+
"""
|
|
2483
|
+
KMS_KEY_STATE_UNSPECIFIED = 0
|
|
2484
|
+
ENABLED = 1
|
|
2485
|
+
PERMISSION_DENIED = 2
|
|
2486
|
+
DISABLED = 3
|
|
2487
|
+
DESTROYED = 4
|
|
2488
|
+
DESTROY_SCHEDULED = 5
|
|
2489
|
+
EKM_KEY_UNREACHABLE_DETECTED = 6
|
|
2490
|
+
BILLING_DISABLED = 7
|
|
2491
|
+
UNKNOWN_FAILURE = 8
|
|
2492
|
+
|
|
2493
|
+
encryption_type: Type = proto.Field(
|
|
2494
|
+
proto.ENUM,
|
|
2495
|
+
number=1,
|
|
2496
|
+
enum=Type,
|
|
2497
|
+
)
|
|
2498
|
+
kms_key_versions: MutableSequence[str] = proto.RepeatedField(
|
|
2499
|
+
proto.STRING,
|
|
2500
|
+
number=2,
|
|
2501
|
+
)
|
|
2502
|
+
kms_key_primary_state: KmsKeyState = proto.Field(
|
|
2503
|
+
proto.ENUM,
|
|
2504
|
+
number=3,
|
|
2505
|
+
enum=KmsKeyState,
|
|
2506
|
+
)
|
|
2507
|
+
last_update_time: timestamp_pb2.Timestamp = proto.Field(
|
|
2508
|
+
proto.MESSAGE,
|
|
2509
|
+
number=4,
|
|
2510
|
+
message=timestamp_pb2.Timestamp,
|
|
2511
|
+
)
|
|
2512
|
+
|
|
2513
|
+
|
|
2300
2514
|
__all__ = tuple(sorted(__protobuf__.manifest))
|