Skip to content

Commit b45a11d

Browse files
feat: [google-cloud-netapp] Add ValidateDirectoryService API for testing AD connection of a storage pool (googleapis#13412)
- [ ] Regenerate this pull request now. BEGIN_COMMIT_OVERRIDE feat: Add ValidateDirectoryService API for testing AD connection of a storage pool docs: Remove the format for `replication` in message `google.cloud.netapp.v1.HybridReplicationParameters` END_COMMIT_OVERRIDE docs: Removed the format for `replication` in message `google.cloud.netapp.v1.HybridReplicationParameters` PiperOrigin-RevId: 713157619 Source-Link: googleapis/googleapis@7f2db36 Source-Link: https://github.com/googleapis/googleapis-gen/commit/33068cc50b39cb01ecc6d175f464e138491711f2 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW5ldGFwcC8uT3dsQm90LnlhbWwiLCJoIjoiMzMwNjhjYzUwYjM5Y2IwMWVjYzZkMTc1ZjQ2NGUxMzg0OTE3MTFmMiJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Victor Chudnovsky <[email protected]>
1 parent d30f5ea commit b45a11d

21 files changed

+1485
-8
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
)
5959
from google.cloud.netapp_v1.types.cloud_netapp_service import OperationMetadata
6060
from google.cloud.netapp_v1.types.common import (
61+
DirectoryServiceType,
6162
EncryptionType,
6263
LocationMetadata,
6364
ServiceLevel,
@@ -109,6 +110,7 @@
109110
StoragePool,
110111
SwitchActiveReplicaZoneRequest,
111112
UpdateStoragePoolRequest,
113+
ValidateDirectoryServiceRequest,
112114
)
113115
from google.cloud.netapp_v1.types.volume import (
114116
AccessType,
@@ -171,6 +173,7 @@
171173
"UpdateBackupVaultRequest",
172174
"OperationMetadata",
173175
"LocationMetadata",
176+
"DirectoryServiceType",
174177
"EncryptionType",
175178
"ServiceLevel",
176179
"CreateKmsConfigRequest",
@@ -213,6 +216,7 @@
213216
"StoragePool",
214217
"SwitchActiveReplicaZoneRequest",
215218
"UpdateStoragePoolRequest",
219+
"ValidateDirectoryServiceRequest",
216220
"BackupConfig",
217221
"CreateVolumeRequest",
218222
"DailySchedule",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.3.17" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@
5656
UpdateBackupVaultRequest,
5757
)
5858
from .types.cloud_netapp_service import OperationMetadata
59-
from .types.common import EncryptionType, LocationMetadata, ServiceLevel
59+
from .types.common import (
60+
DirectoryServiceType,
61+
EncryptionType,
62+
LocationMetadata,
63+
ServiceLevel,
64+
)
6065
from .types.kms import (
6166
CreateKmsConfigRequest,
6267
DeleteKmsConfigRequest,
@@ -104,6 +109,7 @@
104109
StoragePool,
105110
SwitchActiveReplicaZoneRequest,
106111
UpdateStoragePoolRequest,
112+
ValidateDirectoryServiceRequest,
107113
)
108114
from .types.volume import (
109115
AccessType,
@@ -161,6 +167,7 @@
161167
"DeleteStoragePoolRequest",
162168
"DeleteVolumeRequest",
163169
"DestinationVolumeParameters",
170+
"DirectoryServiceType",
164171
"EncryptVolumesRequest",
165172
"EncryptionType",
166173
"EstablishPeeringRequest",
@@ -229,6 +236,7 @@
229236
"UpdateSnapshotRequest",
230237
"UpdateStoragePoolRequest",
231238
"UpdateVolumeRequest",
239+
"ValidateDirectoryServiceRequest",
232240
"VerifyKmsConfigRequest",
233241
"VerifyKmsConfigResponse",
234242
"Volume",

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
@@ -275,6 +275,11 @@
275275
"update_volume"
276276
]
277277
},
278+
"ValidateDirectoryService": {
279+
"methods": [
280+
"validate_directory_service"
281+
]
282+
},
278283
"VerifyKmsConfig": {
279284
"methods": [
280285
"verify_kms_config"
@@ -550,6 +555,11 @@
550555
"update_volume"
551556
]
552557
},
558+
"ValidateDirectoryService": {
559+
"methods": [
560+
"validate_directory_service"
561+
]
562+
},
553563
"VerifyKmsConfig": {
554564
"methods": [
555565
"verify_kms_config"
@@ -825,6 +835,11 @@
825835
"update_volume"
826836
]
827837
},
838+
"ValidateDirectoryService": {
839+
"methods": [
840+
"validate_directory_service"
841+
]
842+
},
828843
"VerifyKmsConfig": {
829844
"methods": [
830845
"verify_kms_config"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.3.17" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

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

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,119 @@ async def sample_delete_storage_pool():
982982
# Done; return the response.
983983
return response
984984

985+
async def validate_directory_service(
986+
self,
987+
request: Optional[
988+
Union[storage_pool.ValidateDirectoryServiceRequest, dict]
989+
] = None,
990+
*,
991+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
992+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
993+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
994+
) -> operation_async.AsyncOperation:
995+
r"""ValidateDirectoryService does a connectivity check
996+
for a directory service policy attached to the storage
997+
pool.
998+
999+
.. code-block:: python
1000+
1001+
# This snippet has been automatically generated and should be regarded as a
1002+
# code template only.
1003+
# It will require modifications to work:
1004+
# - It may require correct/in-range values for request initialization.
1005+
# - It may require specifying regional endpoints when creating the service
1006+
# client as shown in:
1007+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
1008+
from google.cloud import netapp_v1
1009+
1010+
async def sample_validate_directory_service():
1011+
# Create a client
1012+
client = netapp_v1.NetAppAsyncClient()
1013+
1014+
# Initialize request argument(s)
1015+
request = netapp_v1.ValidateDirectoryServiceRequest(
1016+
name="name_value",
1017+
)
1018+
1019+
# Make the request
1020+
operation = client.validate_directory_service(request=request)
1021+
1022+
print("Waiting for operation to complete...")
1023+
1024+
response = (await operation).result()
1025+
1026+
# Handle the response
1027+
print(response)
1028+
1029+
Args:
1030+
request (Optional[Union[google.cloud.netapp_v1.types.ValidateDirectoryServiceRequest, dict]]):
1031+
The request object. ValidateDirectoryServiceRequest
1032+
validates the directory service policy
1033+
attached to the storage pool.
1034+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
1035+
should be retried.
1036+
timeout (float): The timeout for this request.
1037+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1038+
sent along with the request as metadata. Normally, each value must be of type `str`,
1039+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
1040+
be of type `bytes`.
1041+
1042+
Returns:
1043+
google.api_core.operation_async.AsyncOperation:
1044+
An object representing a long-running operation.
1045+
1046+
The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated
1047+
empty messages in your APIs. A typical example is to
1048+
use it as the request or the response type of an API
1049+
method. For instance:
1050+
1051+
service Foo {
1052+
rpc Bar(google.protobuf.Empty) returns
1053+
(google.protobuf.Empty);
1054+
1055+
}
1056+
1057+
"""
1058+
# Create or coerce a protobuf request object.
1059+
# - Use the request object if provided (there's no risk of modifying the input as
1060+
# there are no flattened fields), or create one.
1061+
if not isinstance(request, storage_pool.ValidateDirectoryServiceRequest):
1062+
request = storage_pool.ValidateDirectoryServiceRequest(request)
1063+
1064+
# Wrap the RPC method; this adds retry and timeout information,
1065+
# and friendly error handling.
1066+
rpc = self._client._transport._wrapped_methods[
1067+
self._client._transport.validate_directory_service
1068+
]
1069+
1070+
# Certain fields should be provided within the metadata header;
1071+
# add these here.
1072+
metadata = tuple(metadata) + (
1073+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1074+
)
1075+
1076+
# Validate the universe domain.
1077+
self._client._validate_universe_domain()
1078+
1079+
# Send the request.
1080+
response = await rpc(
1081+
request,
1082+
retry=retry,
1083+
timeout=timeout,
1084+
metadata=metadata,
1085+
)
1086+
1087+
# Wrap the response in an operation future.
1088+
response = operation_async.from_gapic(
1089+
response,
1090+
self._client._transport.operations_client,
1091+
empty_pb2.Empty,
1092+
metadata_type=cloud_netapp_service.OperationMetadata,
1093+
)
1094+
1095+
# Done; return the response.
1096+
return response
1097+
9851098
async def switch_active_replica_zone(
9861099
self,
9871100
request: Optional[

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

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,6 +1549,119 @@ def sample_delete_storage_pool():
15491549
# Done; return the response.
15501550
return response
15511551

1552+
def validate_directory_service(
1553+
self,
1554+
request: Optional[
1555+
Union[storage_pool.ValidateDirectoryServiceRequest, dict]
1556+
] = None,
1557+
*,
1558+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1559+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1560+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1561+
) -> operation.Operation:
1562+
r"""ValidateDirectoryService does a connectivity check
1563+
for a directory service policy attached to the storage
1564+
pool.
1565+
1566+
.. code-block:: python
1567+
1568+
# This snippet has been automatically generated and should be regarded as a
1569+
# code template only.
1570+
# It will require modifications to work:
1571+
# - It may require correct/in-range values for request initialization.
1572+
# - It may require specifying regional endpoints when creating the service
1573+
# client as shown in:
1574+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
1575+
from google.cloud import netapp_v1
1576+
1577+
def sample_validate_directory_service():
1578+
# Create a client
1579+
client = netapp_v1.NetAppClient()
1580+
1581+
# Initialize request argument(s)
1582+
request = netapp_v1.ValidateDirectoryServiceRequest(
1583+
name="name_value",
1584+
)
1585+
1586+
# Make the request
1587+
operation = client.validate_directory_service(request=request)
1588+
1589+
print("Waiting for operation to complete...")
1590+
1591+
response = operation.result()
1592+
1593+
# Handle the response
1594+
print(response)
1595+
1596+
Args:
1597+
request (Union[google.cloud.netapp_v1.types.ValidateDirectoryServiceRequest, dict]):
1598+
The request object. ValidateDirectoryServiceRequest
1599+
validates the directory service policy
1600+
attached to the storage pool.
1601+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1602+
should be retried.
1603+
timeout (float): The timeout for this request.
1604+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1605+
sent along with the request as metadata. Normally, each value must be of type `str`,
1606+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
1607+
be of type `bytes`.
1608+
1609+
Returns:
1610+
google.api_core.operation.Operation:
1611+
An object representing a long-running operation.
1612+
1613+
The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated
1614+
empty messages in your APIs. A typical example is to
1615+
use it as the request or the response type of an API
1616+
method. For instance:
1617+
1618+
service Foo {
1619+
rpc Bar(google.protobuf.Empty) returns
1620+
(google.protobuf.Empty);
1621+
1622+
}
1623+
1624+
"""
1625+
# Create or coerce a protobuf request object.
1626+
# - Use the request object if provided (there's no risk of modifying the input as
1627+
# there are no flattened fields), or create one.
1628+
if not isinstance(request, storage_pool.ValidateDirectoryServiceRequest):
1629+
request = storage_pool.ValidateDirectoryServiceRequest(request)
1630+
1631+
# Wrap the RPC method; this adds retry and timeout information,
1632+
# and friendly error handling.
1633+
rpc = self._transport._wrapped_methods[
1634+
self._transport.validate_directory_service
1635+
]
1636+
1637+
# Certain fields should be provided within the metadata header;
1638+
# add these here.
1639+
metadata = tuple(metadata) + (
1640+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1641+
)
1642+
1643+
# Validate the universe domain.
1644+
self._validate_universe_domain()
1645+
1646+
# Send the request.
1647+
response = rpc(
1648+
request,
1649+
retry=retry,
1650+
timeout=timeout,
1651+
metadata=metadata,
1652+
)
1653+
1654+
# Wrap the response in an operation future.
1655+
response = operation.from_gapic(
1656+
response,
1657+
self._transport.operations_client,
1658+
empty_pb2.Empty,
1659+
metadata_type=cloud_netapp_service.OperationMetadata,
1660+
)
1661+
1662+
# Done; return the response.
1663+
return response
1664+
15521665
def switch_active_replica_zone(
15531666
self,
15541667
request: Optional[

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.validate_directory_service: gapic_v1.method.wrap_method(
193+
self.validate_directory_service,
194+
default_timeout=None,
195+
client_info=client_info,
196+
),
192197
self.switch_active_replica_zone: gapic_v1.method.wrap_method(
193198
self.switch_active_replica_zone,
194199
default_timeout=None,
@@ -672,6 +677,15 @@ def delete_storage_pool(
672677
]:
673678
raise NotImplementedError()
674679

680+
@property
681+
def validate_directory_service(
682+
self,
683+
) -> Callable[
684+
[storage_pool.ValidateDirectoryServiceRequest],
685+
Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
686+
]:
687+
raise NotImplementedError()
688+
675689
@property
676690
def switch_active_replica_zone(
677691
self,

0 commit comments

Comments
 (0)