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

Commit

Permalink
feat: add secondary_ip_range field (#157)
Browse files Browse the repository at this point in the history
* feat: add secondary_ip_range field

PiperOrigin-RevId: 427771855

Source-Link: googleapis/googleapis@fed73d4

Source-Link: googleapis/googleapis-gen@6d7c477
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNmQ3YzQ3N2Y0NTVjZGFiOTg0ZTZlNDVjOTA2YTM1YmRjYjNmMzI1MiJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: use gapic-generator-python 0.63.2
docs: add generated snippets

PiperOrigin-RevId: 427792504

Source-Link: googleapis/googleapis@55b9e1e

Source-Link: googleapis/googleapis-gen@bf4e86b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>
  • Loading branch information
3 people committed Feb 24, 2022
1 parent f49a1e9 commit dd310d5
Show file tree
Hide file tree
Showing 48 changed files with 4,855 additions and 19 deletions.
229 changes: 229 additions & 0 deletions google/cloud/redis_v1/services/cloud_redis/async_client.py
Expand Up @@ -242,6 +242,27 @@ async def list_instances(
regions available to the project are queried, and the results
are aggregated.
.. code-block::
from google.cloud import redis_v1
def sample_list_instances():
# Create a client
client = redis_v1.CloudRedisClient()
# Initialize request argument(s)
request = redis_v1.ListInstancesRequest(
parent="parent_value",
)
# Make the request
page_result = client.list_instances(request=request)
# Handle the response
for response in page_result:
print(response)
Args:
request (Union[google.cloud.redis_v1.types.ListInstancesRequest, dict]):
The request object. Request for
Expand Down Expand Up @@ -324,6 +345,25 @@ async def get_instance(
) -> cloud_redis.Instance:
r"""Gets the details of a specific Redis instance.
.. code-block::
from google.cloud import redis_v1
def sample_get_instance():
# Create a client
client = redis_v1.CloudRedisClient()
# Initialize request argument(s)
request = redis_v1.GetInstanceRequest(
name="name_value",
)
# Make the request
response = client.get_instance(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.redis_v1.types.GetInstanceRequest, dict]):
The request object. Request for
Expand Down Expand Up @@ -409,6 +449,37 @@ async def create_instance(
The returned operation is automatically deleted after a few
hours, so there is no need to call DeleteOperation.
.. code-block::
from google.cloud import redis_v1
def sample_create_instance():
# Create a client
client = redis_v1.CloudRedisClient()
# Initialize request argument(s)
instance = redis_v1.Instance()
instance.name = "name_value"
instance.tier = "STANDARD_HA"
instance.memory_size_gb = 1499
request = redis_v1.CreateInstanceRequest(
parent="parent_value",
instance_id="instance_id_value",
instance=instance,
)
# Make the request
operation = client.create_instance(request=request)
print("Waiting for operation to complete...")
response = operation.result()
# Handle the response
print(response)
Args:
request (Union[google.cloud.redis_v1.types.CreateInstanceRequest, dict]):
The request object. Request for
Expand Down Expand Up @@ -522,6 +593,35 @@ async def update_instance(
operation is automatically deleted after a few hours, so
there is no need to call DeleteOperation.
.. code-block::
from google.cloud import redis_v1
def sample_update_instance():
# Create a client
client = redis_v1.CloudRedisClient()
# Initialize request argument(s)
instance = redis_v1.Instance()
instance.name = "name_value"
instance.tier = "STANDARD_HA"
instance.memory_size_gb = 1499
request = redis_v1.UpdateInstanceRequest(
instance=instance,
)
# Make the request
operation = client.update_instance(request=request)
print("Waiting for operation to complete...")
response = operation.result()
# Handle the response
print(response)
Args:
request (Union[google.cloud.redis_v1.types.UpdateInstanceRequest, dict]):
The request object. Request for
Expand Down Expand Up @@ -625,6 +725,31 @@ async def upgrade_instance(
r"""Upgrades Redis instance to the newer Redis version
specified in the request.
.. code-block::
from google.cloud import redis_v1
def sample_upgrade_instance():
# Create a client
client = redis_v1.CloudRedisClient()
# Initialize request argument(s)
request = redis_v1.UpgradeInstanceRequest(
name="name_value",
redis_version="redis_version_value",
)
# Make the request
operation = client.upgrade_instance(request=request)
print("Waiting for operation to complete...")
response = operation.result()
# Handle the response
print(response)
Args:
request (Union[google.cloud.redis_v1.types.UpgradeInstanceRequest, dict]):
The request object. Request for
Expand Down Expand Up @@ -726,6 +851,34 @@ async def import_instance(
The returned operation is automatically deleted after a
few hours, so there is no need to call DeleteOperation.
.. code-block::
from google.cloud import redis_v1
def sample_import_instance():
# Create a client
client = redis_v1.CloudRedisClient()
# Initialize request argument(s)
input_config = redis_v1.InputConfig()
input_config.gcs_source.uri = "uri_value"
request = redis_v1.ImportInstanceRequest(
name="name_value",
input_config=input_config,
)
# Make the request
operation = client.import_instance(request=request)
print("Waiting for operation to complete...")
response = operation.result()
# Handle the response
print(response)
Args:
request (Union[google.cloud.redis_v1.types.ImportInstanceRequest, dict]):
The request object. Request for
Expand Down Expand Up @@ -823,6 +976,34 @@ async def export_instance(
The returned operation is automatically deleted after a
few hours, so there is no need to call DeleteOperation.
.. code-block::
from google.cloud import redis_v1
def sample_export_instance():
# Create a client
client = redis_v1.CloudRedisClient()
# Initialize request argument(s)
output_config = redis_v1.OutputConfig()
output_config.gcs_destination.uri = "uri_value"
request = redis_v1.ExportInstanceRequest(
name="name_value",
output_config=output_config,
)
# Make the request
operation = client.export_instance(request=request)
print("Waiting for operation to complete...")
response = operation.result()
# Handle the response
print(response)
Args:
request (Union[google.cloud.redis_v1.types.ExportInstanceRequest, dict]):
The request object. Request for
Expand Down Expand Up @@ -918,6 +1099,30 @@ async def failover_instance(
replica node for a specific STANDARD tier Cloud
Memorystore for Redis instance.
.. code-block::
from google.cloud import redis_v1
def sample_failover_instance():
# Create a client
client = redis_v1.CloudRedisClient()
# Initialize request argument(s)
request = redis_v1.FailoverInstanceRequest(
name="name_value",
)
# Make the request
operation = client.failover_instance(request=request)
print("Waiting for operation to complete...")
response = operation.result()
# Handle the response
print(response)
Args:
request (Union[google.cloud.redis_v1.types.FailoverInstanceRequest, dict]):
The request object. Request for
Expand Down Expand Up @@ -1012,6 +1217,30 @@ async def delete_instance(
r"""Deletes a specific Redis instance. Instance stops
serving and data is deleted.
.. code-block::
from google.cloud import redis_v1
def sample_delete_instance():
# Create a client
client = redis_v1.CloudRedisClient()
# Initialize request argument(s)
request = redis_v1.DeleteInstanceRequest(
name="name_value",
)
# Make the request
operation = client.delete_instance(request=request)
print("Waiting for operation to complete...")
response = operation.result()
# Handle the response
print(response)
Args:
request (Union[google.cloud.redis_v1.types.DeleteInstanceRequest, dict]):
The request object. Request for
Expand Down

0 comments on commit dd310d5

Please sign in to comment.