Skip to content

Commit

Permalink
feat: [google-cloud-redis-cluster] Add support for different node typ…
Browse files Browse the repository at this point in the history
…es (#12779)

BEGIN_COMMIT_OVERRIDE

feat: [Memorystore for Redis Cluster] Add support for different node
types
feat: [Memorystore for Redis Cluster] Add persistence support
feat: [Memorystore for Redis Cluster] Get details of certificate
authority from redis cluster
docs: [Memorystore for Redis Cluster] size_gb field shows the size of
the cluster rounded up to the next integer, precise_size_gb field will
show the exact size of the cluster

END_COMMIT_OVERRIDE

- [ ] Regenerate this pull request now.

feat: Add persistence support
feat: Get details of certificate authority from redis cluster
docs: size_gb field shows the size of the cluster rounded up to the next
integer, precise_size_gb field will show the exact size of the cluster
chore(ruby): Configure clients for google-cloud-redis-cluster

PiperOrigin-RevId: 640556570

Source-Link:
googleapis/googleapis@a083f5c

Source-Link:
googleapis/googleapis-gen@cebc07d
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJlZGlzLWNsdXN0ZXIvLk93bEJvdC55YW1sIiwiaCI6ImNlYmMwN2Q2YzU5N2E1MzVlMjZjMGI3YjNkMWYwMTQ2Yjk0Y2Q0ODEifQ==

BEGIN_NESTED_COMMIT
feat: [google-cloud-redis-cluster] [Memorystore for Redis Cluster] Add
support for different node types
feat: [Memorystore for Redis Cluster] Add persistence support
feat: [Memorystore for Redis Cluster] Get details of certificate
authority from redis cluster
docs: [Memorystore for Redis Cluster] size_gb field shows the size of
the cluster rounded up to the next integer, precise_size_gb field will
show the exact size of the cluster

PiperOrigin-RevId: 640389721

Source-Link:
googleapis/googleapis@8bca64a

Source-Link:
googleapis/googleapis-gen@24dbd22
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXJlZGlzLWNsdXN0ZXIvLk93bEJvdC55YW1sIiwiaCI6IjI0ZGJkMjI3YTU1ZTczNDc3MzNkNTkzMTE4Mzc3OTdjOTZkNmQ1NTQifQ==
END_NESTED_COMMIT

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: ohmayr <[email protected]>
Co-authored-by: Anthonios Partheniou <[email protected]>
  • Loading branch information
4 people authored Jun 5, 2024
1 parent b70fe1b commit 6a70a4b
Show file tree
Hide file tree
Showing 31 changed files with 5,051 additions and 1,245 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,44 @@
)
from google.cloud.redis_cluster_v1.types.cloud_redis_cluster import (
AuthorizationMode,
CertificateAuthority,
Cluster,
ClusterPersistenceConfig,
CreateClusterRequest,
DeleteClusterRequest,
DiscoveryEndpoint,
GetClusterCertificateAuthorityRequest,
GetClusterRequest,
ListClustersRequest,
ListClustersResponse,
NodeType,
OperationMetadata,
PscConfig,
PscConnection,
TransitEncryptionMode,
UpdateClusterRequest,
ZoneDistributionConfig,
)

__all__ = (
"CloudRedisClusterClient",
"CloudRedisClusterAsyncClient",
"CertificateAuthority",
"Cluster",
"ClusterPersistenceConfig",
"CreateClusterRequest",
"DeleteClusterRequest",
"DiscoveryEndpoint",
"GetClusterCertificateAuthorityRequest",
"GetClusterRequest",
"ListClustersRequest",
"ListClustersResponse",
"OperationMetadata",
"PscConfig",
"PscConnection",
"UpdateClusterRequest",
"ZoneDistributionConfig",
"AuthorizationMode",
"NodeType",
"TransitEncryptionMode",
)
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,44 @@
)
from .types.cloud_redis_cluster import (
AuthorizationMode,
CertificateAuthority,
Cluster,
ClusterPersistenceConfig,
CreateClusterRequest,
DeleteClusterRequest,
DiscoveryEndpoint,
GetClusterCertificateAuthorityRequest,
GetClusterRequest,
ListClustersRequest,
ListClustersResponse,
NodeType,
OperationMetadata,
PscConfig,
PscConnection,
TransitEncryptionMode,
UpdateClusterRequest,
ZoneDistributionConfig,
)

__all__ = (
"CloudRedisClusterAsyncClient",
"AuthorizationMode",
"CertificateAuthority",
"CloudRedisClusterClient",
"Cluster",
"ClusterPersistenceConfig",
"CreateClusterRequest",
"DeleteClusterRequest",
"DiscoveryEndpoint",
"GetClusterCertificateAuthorityRequest",
"GetClusterRequest",
"ListClustersRequest",
"ListClustersResponse",
"NodeType",
"OperationMetadata",
"PscConfig",
"PscConnection",
"TransitEncryptionMode",
"UpdateClusterRequest",
"ZoneDistributionConfig",
)
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
"get_cluster"
]
},
"GetClusterCertificateAuthority": {
"methods": [
"get_cluster_certificate_authority"
]
},
"ListClusters": {
"methods": [
"list_clusters"
Expand Down Expand Up @@ -55,6 +60,11 @@
"get_cluster"
]
},
"GetClusterCertificateAuthority": {
"methods": [
"get_cluster_certificate_authority"
]
},
"ListClusters": {
"methods": [
"list_clusters"
Expand Down Expand Up @@ -85,6 +95,11 @@
"get_cluster"
]
},
"GetClusterCertificateAuthority": {
"methods": [
"get_cluster_certificate_authority"
]
},
"ListClusters": {
"methods": [
"list_clusters"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ class CloudRedisClusterAsyncClient:
_DEFAULT_ENDPOINT_TEMPLATE = CloudRedisClusterClient._DEFAULT_ENDPOINT_TEMPLATE
_DEFAULT_UNIVERSE = CloudRedisClusterClient._DEFAULT_UNIVERSE

certificate_authority_path = staticmethod(
CloudRedisClusterClient.certificate_authority_path
)
parse_certificate_authority_path = staticmethod(
CloudRedisClusterClient.parse_certificate_authority_path
)
cluster_path = staticmethod(CloudRedisClusterClient.cluster_path)
parse_cluster_path = staticmethod(CloudRedisClusterClient.parse_cluster_path)
common_billing_account_path = staticmethod(
Expand Down Expand Up @@ -969,6 +975,117 @@ async def sample_create_cluster():
# Done; return the response.
return response

async def get_cluster_certificate_authority(
self,
request: Optional[
Union[cloud_redis_cluster.GetClusterCertificateAuthorityRequest, dict]
] = None,
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> cloud_redis_cluster.CertificateAuthority:
r"""Gets the details of certificate authority information
for Redis cluster.
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import redis_cluster_v1
async def sample_get_cluster_certificate_authority():
# Create a client
client = redis_cluster_v1.CloudRedisClusterAsyncClient()
# Initialize request argument(s)
request = redis_cluster_v1.GetClusterCertificateAuthorityRequest(
name="name_value",
)
# Make the request
response = await client.get_cluster_certificate_authority(request=request)
# Handle the response
print(response)
Args:
request (Optional[Union[google.cloud.redis_cluster_v1.types.GetClusterCertificateAuthorityRequest, dict]]):
The request object. Request for
[GetClusterCertificateAuthorityRequest][CloudRedis.GetClusterCertificateAuthorityRequest].
name (:class:`str`):
Required. Redis cluster certificate authority resource
name using the form:
``projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certificateAuthority``
where ``location_id`` refers to a GCP region.
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
Returns:
google.cloud.redis_cluster_v1.types.CertificateAuthority:
Redis cluster certificate authority
"""
# Create or coerce a protobuf request object.
# - Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([name])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)

# - Use the request object if provided (there's no risk of modifying the input as
# there are no flattened fields), or create one.
if not isinstance(
request, cloud_redis_cluster.GetClusterCertificateAuthorityRequest
):
request = cloud_redis_cluster.GetClusterCertificateAuthorityRequest(request)

# If we have keyword arguments corresponding to fields on the
# request, apply these.
if name is not None:
request.name = name

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._client._transport._wrapped_methods[
self._client._transport.get_cluster_certificate_authority
]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
)

# Validate the universe domain.
self._client._validate_universe_domain()

# Send the request.
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response

async def list_operations(
self,
request: Optional[operations_pb2.ListOperationsRequest] = None,
Expand Down
Loading

0 comments on commit 6a70a4b

Please sign in to comment.