Skip to content

Commit 5e3f4ae

Browse files
feat(api): [google-cloud-netapp] A new rpc 'SwitchActiveReplicaZone' is added to service 'google.cloud.netapp.v1.NetApp' (googleapis#13086)
- [ ] Regenerate this pull request now. BEGIN_COMMIT_OVERRIDE feat(api): [google-cloud-netapp] A new rpc 'SwitchActiveReplicaZone' is added to service 'google.cloud.netapp.v1.NetApp' feat: A new message 'google.cloud.netapp.v1.SwitchActiveReplicaZoneRequest' is added feat: A new field 'allow_auto_tiering' in message 'google.cloud.netapp.v1.StoragePool' is added feat: A new field 'cold_tier_size_gib' in message 'google.cloud.netapp.v1.Volume' is added END_COMMIT_OVERRIDE feat: A new message 'google.cloud.netapp.v1.SwitchActiveReplicaZoneRequest' is added feat: A new field 'allow_auto_tiering' in message 'google.cloud.netapp.v1.StoragePool' is added feat: A new field 'cold_tier_size_gib' in message 'google.cloud.netapp.v1.Volume' is added PiperOrigin-RevId: 674440910 Source-Link: googleapis/googleapis@e99de3d Source-Link: https://github.com/googleapis/googleapis-gen/commit/ca2b9f634b559466682d84b12d0aeb9b74ebdba2 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW5ldGFwcC8uT3dsQm90LnlhbWwiLCJoIjoiY2EyYjlmNjM0YjU1OTQ2NjY4MmQ4NGIxMmQwYWViOWI3NGViZGJhMiJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Victor Chudnovsky <vchudnov@google.com>
1 parent 366f6f1 commit 5e3f4ae

17 files changed

Lines changed: 1319 additions & 0 deletions

packages/google-cloud-netapp/google/cloud/netapp/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
ListStoragePoolsRequest,
105105
ListStoragePoolsResponse,
106106
StoragePool,
107+
SwitchActiveReplicaZoneRequest,
107108
UpdateStoragePoolRequest,
108109
)
109110
from google.cloud.netapp_v1.types.volume import (
@@ -203,6 +204,7 @@
203204
"ListStoragePoolsRequest",
204205
"ListStoragePoolsResponse",
205206
"StoragePool",
207+
"SwitchActiveReplicaZoneRequest",
206208
"UpdateStoragePoolRequest",
207209
"BackupConfig",
208210
"CreateVolumeRequest",

packages/google-cloud-netapp/google/cloud/netapp_v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
ListStoragePoolsRequest,
100100
ListStoragePoolsResponse,
101101
StoragePool,
102+
SwitchActiveReplicaZoneRequest,
102103
UpdateStoragePoolRequest,
103104
)
104105
from .types.volume import (
@@ -208,6 +209,7 @@
208209
"SnapshotPolicy",
209210
"StopReplicationRequest",
210211
"StoragePool",
212+
"SwitchActiveReplicaZoneRequest",
211213
"TieringPolicy",
212214
"TransferStats",
213215
"UpdateActiveDirectoryRequest",

packages/google-cloud-netapp/google/cloud/netapp_v1/gapic_metadata.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,11 @@
215215
"stop_replication"
216216
]
217217
},
218+
"SwitchActiveReplicaZone": {
219+
"methods": [
220+
"switch_active_replica_zone"
221+
]
222+
},
218223
"UpdateActiveDirectory": {
219224
"methods": [
220225
"update_active_directory"
@@ -475,6 +480,11 @@
475480
"stop_replication"
476481
]
477482
},
483+
"SwitchActiveReplicaZone": {
484+
"methods": [
485+
"switch_active_replica_zone"
486+
]
487+
},
478488
"UpdateActiveDirectory": {
479489
"methods": [
480490
"update_active_directory"
@@ -735,6 +745,11 @@
735745
"stop_replication"
736746
]
737747
},
748+
"SwitchActiveReplicaZone": {
749+
"methods": [
750+
"switch_active_replica_zone"
751+
]
752+
},
738753
"UpdateActiveDirectory": {
739754
"methods": [
740755
"update_active_directory"

packages/google-cloud-netapp/google/cloud/netapp_v1/services/net_app/async_client.py

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,110 @@ async def sample_delete_storage_pool():
941941
# Done; return the response.
942942
return response
943943

944+
async def switch_active_replica_zone(
945+
self,
946+
request: Optional[
947+
Union[storage_pool.SwitchActiveReplicaZoneRequest, dict]
948+
] = None,
949+
*,
950+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
951+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
952+
metadata: Sequence[Tuple[str, str]] = (),
953+
) -> operation_async.AsyncOperation:
954+
r"""This operation will switch the active/replica zone
955+
for a regional storagePool.
956+
957+
.. code-block:: python
958+
959+
# This snippet has been automatically generated and should be regarded as a
960+
# code template only.
961+
# It will require modifications to work:
962+
# - It may require correct/in-range values for request initialization.
963+
# - It may require specifying regional endpoints when creating the service
964+
# client as shown in:
965+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
966+
from google.cloud import netapp_v1
967+
968+
async def sample_switch_active_replica_zone():
969+
# Create a client
970+
client = netapp_v1.NetAppAsyncClient()
971+
972+
# Initialize request argument(s)
973+
request = netapp_v1.SwitchActiveReplicaZoneRequest(
974+
name="name_value",
975+
)
976+
977+
# Make the request
978+
operation = client.switch_active_replica_zone(request=request)
979+
980+
print("Waiting for operation to complete...")
981+
982+
response = (await operation).result()
983+
984+
# Handle the response
985+
print(response)
986+
987+
Args:
988+
request (Optional[Union[google.cloud.netapp_v1.types.SwitchActiveReplicaZoneRequest, dict]]):
989+
The request object. SwitchActiveReplicaZoneRequest switch
990+
the active/replica zone for a regional
991+
storagePool.
992+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
993+
should be retried.
994+
timeout (float): The timeout for this request.
995+
metadata (Sequence[Tuple[str, str]]): Strings which should be
996+
sent along with the request as metadata.
997+
998+
Returns:
999+
google.api_core.operation_async.AsyncOperation:
1000+
An object representing a long-running operation.
1001+
1002+
The result type for the operation will be :class:`google.cloud.netapp_v1.types.StoragePool` StoragePool is a container for volumes with a service level and capacity.
1003+
Volumes can be created in a pool of sufficient
1004+
available capacity. StoragePool capacity is what you
1005+
are billed for.
1006+
1007+
"""
1008+
# Create or coerce a protobuf request object.
1009+
# - Use the request object if provided (there's no risk of modifying the input as
1010+
# there are no flattened fields), or create one.
1011+
if not isinstance(request, storage_pool.SwitchActiveReplicaZoneRequest):
1012+
request = storage_pool.SwitchActiveReplicaZoneRequest(request)
1013+
1014+
# Wrap the RPC method; this adds retry and timeout information,
1015+
# and friendly error handling.
1016+
rpc = self._client._transport._wrapped_methods[
1017+
self._client._transport.switch_active_replica_zone
1018+
]
1019+
1020+
# Certain fields should be provided within the metadata header;
1021+
# add these here.
1022+
metadata = tuple(metadata) + (
1023+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1024+
)
1025+
1026+
# Validate the universe domain.
1027+
self._client._validate_universe_domain()
1028+
1029+
# Send the request.
1030+
response = await rpc(
1031+
request,
1032+
retry=retry,
1033+
timeout=timeout,
1034+
metadata=metadata,
1035+
)
1036+
1037+
# Wrap the response in an operation future.
1038+
response = operation_async.from_gapic(
1039+
response,
1040+
self._client._transport.operations_client,
1041+
storage_pool.StoragePool,
1042+
metadata_type=cloud_netapp_service.OperationMetadata,
1043+
)
1044+
1045+
# Done; return the response.
1046+
return response
1047+
9441048
async def list_volumes(
9451049
self,
9461050
request: Optional[Union[volume.ListVolumesRequest, dict]] = None,

packages/google-cloud-netapp/google/cloud/netapp_v1/services/net_app/client.py

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,6 +1537,110 @@ def sample_delete_storage_pool():
15371537
# Done; return the response.
15381538
return response
15391539

1540+
def switch_active_replica_zone(
1541+
self,
1542+
request: Optional[
1543+
Union[storage_pool.SwitchActiveReplicaZoneRequest, dict]
1544+
] = None,
1545+
*,
1546+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1547+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1548+
metadata: Sequence[Tuple[str, str]] = (),
1549+
) -> operation.Operation:
1550+
r"""This operation will switch the active/replica zone
1551+
for a regional storagePool.
1552+
1553+
.. code-block:: python
1554+
1555+
# This snippet has been automatically generated and should be regarded as a
1556+
# code template only.
1557+
# It will require modifications to work:
1558+
# - It may require correct/in-range values for request initialization.
1559+
# - It may require specifying regional endpoints when creating the service
1560+
# client as shown in:
1561+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
1562+
from google.cloud import netapp_v1
1563+
1564+
def sample_switch_active_replica_zone():
1565+
# Create a client
1566+
client = netapp_v1.NetAppClient()
1567+
1568+
# Initialize request argument(s)
1569+
request = netapp_v1.SwitchActiveReplicaZoneRequest(
1570+
name="name_value",
1571+
)
1572+
1573+
# Make the request
1574+
operation = client.switch_active_replica_zone(request=request)
1575+
1576+
print("Waiting for operation to complete...")
1577+
1578+
response = operation.result()
1579+
1580+
# Handle the response
1581+
print(response)
1582+
1583+
Args:
1584+
request (Union[google.cloud.netapp_v1.types.SwitchActiveReplicaZoneRequest, dict]):
1585+
The request object. SwitchActiveReplicaZoneRequest switch
1586+
the active/replica zone for a regional
1587+
storagePool.
1588+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1589+
should be retried.
1590+
timeout (float): The timeout for this request.
1591+
metadata (Sequence[Tuple[str, str]]): Strings which should be
1592+
sent along with the request as metadata.
1593+
1594+
Returns:
1595+
google.api_core.operation.Operation:
1596+
An object representing a long-running operation.
1597+
1598+
The result type for the operation will be :class:`google.cloud.netapp_v1.types.StoragePool` StoragePool is a container for volumes with a service level and capacity.
1599+
Volumes can be created in a pool of sufficient
1600+
available capacity. StoragePool capacity is what you
1601+
are billed for.
1602+
1603+
"""
1604+
# Create or coerce a protobuf request object.
1605+
# - Use the request object if provided (there's no risk of modifying the input as
1606+
# there are no flattened fields), or create one.
1607+
if not isinstance(request, storage_pool.SwitchActiveReplicaZoneRequest):
1608+
request = storage_pool.SwitchActiveReplicaZoneRequest(request)
1609+
1610+
# Wrap the RPC method; this adds retry and timeout information,
1611+
# and friendly error handling.
1612+
rpc = self._transport._wrapped_methods[
1613+
self._transport.switch_active_replica_zone
1614+
]
1615+
1616+
# Certain fields should be provided within the metadata header;
1617+
# add these here.
1618+
metadata = tuple(metadata) + (
1619+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1620+
)
1621+
1622+
# Validate the universe domain.
1623+
self._validate_universe_domain()
1624+
1625+
# Send the request.
1626+
response = rpc(
1627+
request,
1628+
retry=retry,
1629+
timeout=timeout,
1630+
metadata=metadata,
1631+
)
1632+
1633+
# Wrap the response in an operation future.
1634+
response = operation.from_gapic(
1635+
response,
1636+
self._transport.operations_client,
1637+
storage_pool.StoragePool,
1638+
metadata_type=cloud_netapp_service.OperationMetadata,
1639+
)
1640+
1641+
# Done; return the response.
1642+
return response
1643+
15401644
def list_volumes(
15411645
self,
15421646
request: Optional[Union[volume.ListVolumesRequest, dict]] = None,

packages/google-cloud-netapp/google/cloud/netapp_v1/services/net_app/transports/base.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@ def _prep_wrapped_messages(self, client_info):
189189
default_timeout=60.0,
190190
client_info=client_info,
191191
),
192+
self.switch_active_replica_zone: gapic_v1.method.wrap_method(
193+
self.switch_active_replica_zone,
194+
default_timeout=None,
195+
client_info=client_info,
196+
),
192197
self.list_volumes: gapic_v1.method.wrap_method(
193198
self.list_volumes,
194199
default_retry=retries.Retry(
@@ -627,6 +632,15 @@ def delete_storage_pool(
627632
]:
628633
raise NotImplementedError()
629634

635+
@property
636+
def switch_active_replica_zone(
637+
self,
638+
) -> Callable[
639+
[storage_pool.SwitchActiveReplicaZoneRequest],
640+
Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
641+
]:
642+
raise NotImplementedError()
643+
630644
@property
631645
def list_volumes(
632646
self,

packages/google-cloud-netapp/google/cloud/netapp_v1/services/net_app/transports/grpc.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,35 @@ def delete_storage_pool(
407407
)
408408
return self._stubs["delete_storage_pool"]
409409

410+
@property
411+
def switch_active_replica_zone(
412+
self,
413+
) -> Callable[
414+
[storage_pool.SwitchActiveReplicaZoneRequest], operations_pb2.Operation
415+
]:
416+
r"""Return a callable for the switch active replica zone method over gRPC.
417+
418+
This operation will switch the active/replica zone
419+
for a regional storagePool.
420+
421+
Returns:
422+
Callable[[~.SwitchActiveReplicaZoneRequest],
423+
~.Operation]:
424+
A function that, when called, will call the underlying RPC
425+
on the server.
426+
"""
427+
# Generate a "stub function" on-the-fly which will actually make
428+
# the request.
429+
# gRPC handles serialization and deserialization, so we just need
430+
# to pass in the functions for each.
431+
if "switch_active_replica_zone" not in self._stubs:
432+
self._stubs["switch_active_replica_zone"] = self.grpc_channel.unary_unary(
433+
"/google.cloud.netapp.v1.NetApp/SwitchActiveReplicaZone",
434+
request_serializer=storage_pool.SwitchActiveReplicaZoneRequest.serialize,
435+
response_deserializer=operations_pb2.Operation.FromString,
436+
)
437+
return self._stubs["switch_active_replica_zone"]
438+
410439
@property
411440
def list_volumes(
412441
self,

0 commit comments

Comments
 (0)