Skip to content

Commit 923f33e

Browse files
feat: [google-cloud-alloydb] A new method ExportCluster is added to service AlloyDBAdmin (#13673)
- [ ] Regenerate this pull request now. BEGIN_COMMIT_OVERRIDE feat(v1beta): A new message `GcsDestination` is added feat(v1beta): A new message `ExportClusterRequest` is added feat(v1beta): A new message `ExportClusterResponse` is added docs(v1beta): A comment for field `zone_id` in message `.google.cloud.alloydb.v1beta.Instance` is changed docs(v1beta): A comment for field `id` in message `.google.cloud.alloydb.v1beta.Instance` is changed docs(v1beta): A comment for field `ip` in message `.google.cloud.alloydb.v1beta.Instance` is changed docs(v1beta): A comment for field `state` in message `.google.cloud.alloydb.v1beta.Instance` is changed docs(v1beta): A comment for field `database_flags` in message `.google.cloud.alloydb.v1beta.Instance` is changed docs(v1beta): A comment for field `requested_cancellation` in message `.google.cloud.alloydb.v1beta.OperationMetadata` is changed feat(v1beta): A new method `ExportCluster` is added to service `AlloyDBAdmin` END_COMMIT_OVERRIDE PiperOrigin-RevId: 737752125 Source-Link: googleapis/googleapis@6155d42 Source-Link: googleapis/googleapis-gen@367acad Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFsbG95ZGIvLk93bEJvdC55YW1sIiwiaCI6IjM2N2FjYWRkYmFiMzMwMmE2YTU3OWQ5NjA5OTBiNzNjNDIxZTQ5YTYifQ== --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 63f5a3e commit 923f33e

24 files changed

+2163
-119
lines changed

packages/google-cloud-alloydb/google/cloud/alloydb/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.4.4" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-alloydb/google/cloud/alloydb_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.4.4" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-alloydb/google/cloud/alloydb_v1alpha/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.4.4" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@
6666
ExecuteSqlMetadata,
6767
ExecuteSqlRequest,
6868
ExecuteSqlResponse,
69+
ExportClusterRequest,
70+
ExportClusterResponse,
6971
FailoverInstanceRequest,
72+
GcsDestination,
7073
GenerateClientCertificateRequest,
7174
GenerateClientCertificateResponse,
7275
GetBackupRequest,
@@ -137,7 +140,10 @@
137140
"ExecuteSqlMetadata",
138141
"ExecuteSqlRequest",
139142
"ExecuteSqlResponse",
143+
"ExportClusterRequest",
144+
"ExportClusterResponse",
140145
"FailoverInstanceRequest",
146+
"GcsDestination",
141147
"GeminiClusterConfig",
142148
"GeminiInstanceConfig",
143149
"GenerateClientCertificateRequest",

packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/gapic_metadata.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@
7070
"execute_sql"
7171
]
7272
},
73+
"ExportCluster": {
74+
"methods": [
75+
"export_cluster"
76+
]
77+
},
7378
"FailoverInstance": {
7479
"methods": [
7580
"failover_instance"
@@ -250,6 +255,11 @@
250255
"execute_sql"
251256
]
252257
},
258+
"ExportCluster": {
259+
"methods": [
260+
"export_cluster"
261+
]
262+
},
253263
"FailoverInstance": {
254264
"methods": [
255265
"failover_instance"
@@ -430,6 +440,11 @@
430440
"execute_sql"
431441
]
432442
},
443+
"ExportCluster": {
444+
"methods": [
445+
"export_cluster"
446+
]
447+
},
433448
"FailoverInstance": {
434449
"methods": [
435450
"failover_instance"

packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/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.4.4" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-alloydb/google/cloud/alloydb_v1beta/services/alloy_db_admin/async_client.py

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,195 @@ async def sample_update_cluster():
864864
# Done; return the response.
865865
return response
866866

867+
async def export_cluster(
868+
self,
869+
request: Optional[Union[service.ExportClusterRequest, dict]] = None,
870+
*,
871+
name: Optional[str] = None,
872+
gcs_destination: Optional[service.GcsDestination] = None,
873+
database: Optional[str] = None,
874+
csv_export_options: Optional[
875+
service.ExportClusterRequest.CsvExportOptions
876+
] = None,
877+
sql_export_options: Optional[
878+
service.ExportClusterRequest.SqlExportOptions
879+
] = None,
880+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
881+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
882+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
883+
) -> operation_async.AsyncOperation:
884+
r"""Exports data from the cluster.
885+
Imperative only.
886+
887+
.. code-block:: python
888+
889+
# This snippet has been automatically generated and should be regarded as a
890+
# code template only.
891+
# It will require modifications to work:
892+
# - It may require correct/in-range values for request initialization.
893+
# - It may require specifying regional endpoints when creating the service
894+
# client as shown in:
895+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
896+
from google.cloud import alloydb_v1beta
897+
898+
async def sample_export_cluster():
899+
# Create a client
900+
client = alloydb_v1beta.AlloyDBAdminAsyncClient()
901+
902+
# Initialize request argument(s)
903+
gcs_destination = alloydb_v1beta.GcsDestination()
904+
gcs_destination.uri = "uri_value"
905+
906+
csv_export_options = alloydb_v1beta.CsvExportOptions()
907+
csv_export_options.select_query = "select_query_value"
908+
909+
request = alloydb_v1beta.ExportClusterRequest(
910+
gcs_destination=gcs_destination,
911+
csv_export_options=csv_export_options,
912+
name="name_value",
913+
database="database_value",
914+
)
915+
916+
# Make the request
917+
operation = client.export_cluster(request=request)
918+
919+
print("Waiting for operation to complete...")
920+
921+
response = (await operation).result()
922+
923+
# Handle the response
924+
print(response)
925+
926+
Args:
927+
request (Optional[Union[google.cloud.alloydb_v1beta.types.ExportClusterRequest, dict]]):
928+
The request object. Export cluster request.
929+
name (:class:`str`):
930+
Required. The resource name of the
931+
cluster.
932+
933+
This corresponds to the ``name`` field
934+
on the ``request`` instance; if ``request`` is provided, this
935+
should not be set.
936+
gcs_destination (:class:`google.cloud.alloydb_v1beta.types.GcsDestination`):
937+
Required. Option to export data to
938+
cloud storage.
939+
940+
This corresponds to the ``gcs_destination`` field
941+
on the ``request`` instance; if ``request`` is provided, this
942+
should not be set.
943+
database (:class:`str`):
944+
Required. Name of the database where the export command
945+
will be executed. Note - Value provided should be the
946+
same as expected from ``SELECT current_database();`` and
947+
NOT as a resource reference.
948+
949+
This corresponds to the ``database`` field
950+
on the ``request`` instance; if ``request`` is provided, this
951+
should not be set.
952+
csv_export_options (:class:`google.cloud.alloydb_v1beta.types.ExportClusterRequest.CsvExportOptions`):
953+
Options for exporting data in CSV
954+
format. Required field to be set for CSV
955+
file type.
956+
957+
This corresponds to the ``csv_export_options`` field
958+
on the ``request`` instance; if ``request`` is provided, this
959+
should not be set.
960+
sql_export_options (:class:`google.cloud.alloydb_v1beta.types.ExportClusterRequest.SqlExportOptions`):
961+
Options for exporting data in SQL
962+
format. Required field to be set for SQL
963+
file type.
964+
965+
This corresponds to the ``sql_export_options`` field
966+
on the ``request`` instance; if ``request`` is provided, this
967+
should not be set.
968+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
969+
should be retried.
970+
timeout (float): The timeout for this request.
971+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
972+
sent along with the request as metadata. Normally, each value must be of type `str`,
973+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
974+
be of type `bytes`.
975+
976+
Returns:
977+
google.api_core.operation_async.AsyncOperation:
978+
An object representing a long-running operation.
979+
980+
The result type for the operation will be
981+
:class:`google.cloud.alloydb_v1beta.types.ExportClusterResponse`
982+
Response of export cluster rpc.
983+
984+
"""
985+
# Create or coerce a protobuf request object.
986+
# - Quick check: If we got a request object, we should *not* have
987+
# gotten any keyword arguments that map to the request.
988+
flattened_params = [
989+
name,
990+
gcs_destination,
991+
database,
992+
csv_export_options,
993+
sql_export_options,
994+
]
995+
has_flattened_params = (
996+
len([param for param in flattened_params if param is not None]) > 0
997+
)
998+
if request is not None and has_flattened_params:
999+
raise ValueError(
1000+
"If the `request` argument is set, then none of "
1001+
"the individual field arguments should be set."
1002+
)
1003+
1004+
# - Use the request object if provided (there's no risk of modifying the input as
1005+
# there are no flattened fields), or create one.
1006+
if not isinstance(request, service.ExportClusterRequest):
1007+
request = service.ExportClusterRequest(request)
1008+
1009+
# If we have keyword arguments corresponding to fields on the
1010+
# request, apply these.
1011+
if name is not None:
1012+
request.name = name
1013+
if gcs_destination is not None:
1014+
request.gcs_destination = gcs_destination
1015+
if database is not None:
1016+
request.database = database
1017+
if csv_export_options is not None:
1018+
request.csv_export_options = csv_export_options
1019+
if sql_export_options is not None:
1020+
request.sql_export_options = sql_export_options
1021+
1022+
# Wrap the RPC method; this adds retry and timeout information,
1023+
# and friendly error handling.
1024+
rpc = self._client._transport._wrapped_methods[
1025+
self._client._transport.export_cluster
1026+
]
1027+
1028+
# Certain fields should be provided within the metadata header;
1029+
# add these here.
1030+
metadata = tuple(metadata) + (
1031+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1032+
)
1033+
1034+
# Validate the universe domain.
1035+
self._client._validate_universe_domain()
1036+
1037+
# Send the request.
1038+
response = await rpc(
1039+
request,
1040+
retry=retry,
1041+
timeout=timeout,
1042+
metadata=metadata,
1043+
)
1044+
1045+
# Wrap the response in an operation future.
1046+
response = operation_async.from_gapic(
1047+
response,
1048+
self._client._transport.operations_client,
1049+
service.ExportClusterResponse,
1050+
metadata_type=service.OperationMetadata,
1051+
)
1052+
1053+
# Done; return the response.
1054+
return response
1055+
8671056
async def upgrade_cluster(
8681057
self,
8691058
request: Optional[Union[service.UpgradeClusterRequest, dict]] = None,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy