google-cloud-sql 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- google/cloud/sqladmin/__init__.py +605 -0
- google/cloud/sqladmin/gapic_version.py +16 -0
- google/cloud/sqladmin/py.typed +2 -0
- google/cloud/sqladmin_v1/__init__.py +616 -0
- google/cloud/sqladmin_v1/_compat.py +262 -0
- google/cloud/sqladmin_v1/gapic_metadata.json +959 -0
- google/cloud/sqladmin_v1/gapic_version.py +16 -0
- google/cloud/sqladmin_v1/py.typed +2 -0
- google/cloud/sqladmin_v1/services/__init__.py +15 -0
- google/cloud/sqladmin_v1/services/sql_available_database_versions_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_available_database_versions_service/async_client.py +336 -0
- google/cloud/sqladmin_v1/services/sql_available_database_versions_service/client.py +613 -0
- google/cloud/sqladmin_v1/services/sql_available_database_versions_service/transports/__init__.py +34 -0
- google/cloud/sqladmin_v1/services/sql_available_database_versions_service/transports/base.py +159 -0
- google/cloud/sqladmin_v1/services/sql_available_database_versions_service/transports/grpc.py +339 -0
- google/cloud/sqladmin_v1/services/sql_available_database_versions_service/transports/grpc_asyncio.py +356 -0
- google/cloud/sqladmin_v1/services/sql_backup_runs_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_backup_runs_service/async_client.py +697 -0
- google/cloud/sqladmin_v1/services/sql_backup_runs_service/client.py +977 -0
- google/cloud/sqladmin_v1/services/sql_backup_runs_service/pagers.py +199 -0
- google/cloud/sqladmin_v1/services/sql_backup_runs_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_backup_runs_service/transports/base.py +225 -0
- google/cloud/sqladmin_v1/services/sql_backup_runs_service/transports/grpc.py +456 -0
- google/cloud/sqladmin_v1/services/sql_backup_runs_service/transports/grpc_asyncio.py +495 -0
- google/cloud/sqladmin_v1/services/sql_backups_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_backups_service/async_client.py +946 -0
- google/cloud/sqladmin_v1/services/sql_backups_service/client.py +1244 -0
- google/cloud/sqladmin_v1/services/sql_backups_service/pagers.py +197 -0
- google/cloud/sqladmin_v1/services/sql_backups_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_backups_service/transports/base.py +237 -0
- google/cloud/sqladmin_v1/services/sql_backups_service/transports/grpc.py +478 -0
- google/cloud/sqladmin_v1/services/sql_backups_service/transports/grpc_asyncio.py +527 -0
- google/cloud/sqladmin_v1/services/sql_connect_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_connect_service/async_client.py +591 -0
- google/cloud/sqladmin_v1/services/sql_connect_service/client.py +867 -0
- google/cloud/sqladmin_v1/services/sql_connect_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_connect_service/transports/base.py +215 -0
- google/cloud/sqladmin_v1/services/sql_connect_service/transports/grpc.py +430 -0
- google/cloud/sqladmin_v1/services/sql_connect_service/transports/grpc_asyncio.py +464 -0
- google/cloud/sqladmin_v1/services/sql_databases_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_databases_service/async_client.py +872 -0
- google/cloud/sqladmin_v1/services/sql_databases_service/client.py +1152 -0
- google/cloud/sqladmin_v1/services/sql_databases_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_databases_service/transports/base.py +251 -0
- google/cloud/sqladmin_v1/services/sql_databases_service/transports/grpc.py +515 -0
- google/cloud/sqladmin_v1/services/sql_databases_service/transports/grpc_asyncio.py +568 -0
- google/cloud/sqladmin_v1/services/sql_events_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_events_service/async_client.py +311 -0
- google/cloud/sqladmin_v1/services/sql_events_service/client.py +593 -0
- google/cloud/sqladmin_v1/services/sql_events_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_events_service/transports/base.py +159 -0
- google/cloud/sqladmin_v1/services/sql_events_service/transports/grpc.py +337 -0
- google/cloud/sqladmin_v1/services/sql_events_service/transports/grpc_asyncio.py +354 -0
- google/cloud/sqladmin_v1/services/sql_feature_eligibility_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_feature_eligibility_service/async_client.py +327 -0
- google/cloud/sqladmin_v1/services/sql_feature_eligibility_service/client.py +605 -0
- google/cloud/sqladmin_v1/services/sql_feature_eligibility_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_feature_eligibility_service/transports/base.py +159 -0
- google/cloud/sqladmin_v1/services/sql_feature_eligibility_service/transports/grpc.py +337 -0
- google/cloud/sqladmin_v1/services/sql_feature_eligibility_service/transports/grpc_asyncio.py +356 -0
- google/cloud/sqladmin_v1/services/sql_flags_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_flags_service/async_client.py +386 -0
- google/cloud/sqladmin_v1/services/sql_flags_service/client.py +667 -0
- google/cloud/sqladmin_v1/services/sql_flags_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_flags_service/transports/base.py +181 -0
- google/cloud/sqladmin_v1/services/sql_flags_service/transports/grpc.py +367 -0
- google/cloud/sqladmin_v1/services/sql_flags_service/transports/grpc_asyncio.py +391 -0
- google/cloud/sqladmin_v1/services/sql_iam_policies_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_iam_policies_service/async_client.py +315 -0
- google/cloud/sqladmin_v1/services/sql_iam_policies_service/client.py +593 -0
- google/cloud/sqladmin_v1/services/sql_iam_policies_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_iam_policies_service/transports/base.py +159 -0
- google/cloud/sqladmin_v1/services/sql_iam_policies_service/transports/grpc.py +336 -0
- google/cloud/sqladmin_v1/services/sql_iam_policies_service/transports/grpc_asyncio.py +353 -0
- google/cloud/sqladmin_v1/services/sql_instance_names_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_instance_names_service/async_client.py +321 -0
- google/cloud/sqladmin_v1/services/sql_instance_names_service/client.py +595 -0
- google/cloud/sqladmin_v1/services/sql_instance_names_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_instance_names_service/transports/base.py +159 -0
- google/cloud/sqladmin_v1/services/sql_instance_names_service/transports/grpc.py +336 -0
- google/cloud/sqladmin_v1/services/sql_instance_names_service/transports/grpc_asyncio.py +353 -0
- google/cloud/sqladmin_v1/services/sql_instances_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_instances_service/async_client.py +4519 -0
- google/cloud/sqladmin_v1/services/sql_instances_service/client.py +4833 -0
- google/cloud/sqladmin_v1/services/sql_instances_service/pagers.py +197 -0
- google/cloud/sqladmin_v1/services/sql_instances_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_instances_service/transports/base.py +801 -0
- google/cloud/sqladmin_v1/services/sql_instances_service/transports/grpc.py +1661 -0
- google/cloud/sqladmin_v1/services/sql_instances_service/transports/grpc_asyncio.py +1904 -0
- google/cloud/sqladmin_v1/services/sql_operations_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_operations_service/async_client.py +591 -0
- google/cloud/sqladmin_v1/services/sql_operations_service/client.py +871 -0
- google/cloud/sqladmin_v1/services/sql_operations_service/pagers.py +197 -0
- google/cloud/sqladmin_v1/services/sql_operations_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_operations_service/transports/base.py +210 -0
- google/cloud/sqladmin_v1/services/sql_operations_service/transports/grpc.py +426 -0
- google/cloud/sqladmin_v1/services/sql_operations_service/transports/grpc_asyncio.py +462 -0
- google/cloud/sqladmin_v1/services/sql_regions_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_regions_service/async_client.py +314 -0
- google/cloud/sqladmin_v1/services/sql_regions_service/client.py +596 -0
- google/cloud/sqladmin_v1/services/sql_regions_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_regions_service/transports/base.py +159 -0
- google/cloud/sqladmin_v1/services/sql_regions_service/transports/grpc.py +338 -0
- google/cloud/sqladmin_v1/services/sql_regions_service/transports/grpc_asyncio.py +355 -0
- google/cloud/sqladmin_v1/services/sql_ssl_certs_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_ssl_certs_service/async_client.py +680 -0
- google/cloud/sqladmin_v1/services/sql_ssl_certs_service/client.py +960 -0
- google/cloud/sqladmin_v1/services/sql_ssl_certs_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_ssl_certs_service/transports/base.py +226 -0
- google/cloud/sqladmin_v1/services/sql_ssl_certs_service/transports/grpc.py +461 -0
- google/cloud/sqladmin_v1/services/sql_ssl_certs_service/transports/grpc_asyncio.py +501 -0
- google/cloud/sqladmin_v1/services/sql_tiers_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_tiers_service/async_client.py +395 -0
- google/cloud/sqladmin_v1/services/sql_tiers_service/client.py +676 -0
- google/cloud/sqladmin_v1/services/sql_tiers_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_tiers_service/transports/base.py +181 -0
- google/cloud/sqladmin_v1/services/sql_tiers_service/transports/grpc.py +369 -0
- google/cloud/sqladmin_v1/services/sql_tiers_service/transports/grpc_asyncio.py +393 -0
- google/cloud/sqladmin_v1/services/sql_users_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_users_service/async_client.py +754 -0
- google/cloud/sqladmin_v1/services/sql_users_service/client.py +1035 -0
- google/cloud/sqladmin_v1/services/sql_users_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_users_service/transports/base.py +237 -0
- google/cloud/sqladmin_v1/services/sql_users_service/transports/grpc.py +477 -0
- google/cloud/sqladmin_v1/services/sql_users_service/transports/grpc_asyncio.py +526 -0
- google/cloud/sqladmin_v1/types/__init__.py +472 -0
- google/cloud/sqladmin_v1/types/cloud_sql_available_database_versions.py +24 -0
- google/cloud/sqladmin_v1/types/cloud_sql_backup_runs.py +438 -0
- google/cloud/sqladmin_v1/types/cloud_sql_backups.py +467 -0
- google/cloud/sqladmin_v1/types/cloud_sql_connect.py +385 -0
- google/cloud/sqladmin_v1/types/cloud_sql_databases.py +202 -0
- google/cloud/sqladmin_v1/types/cloud_sql_events.py +24 -0
- google/cloud/sqladmin_v1/types/cloud_sql_feature_eligibility.py +24 -0
- google/cloud/sqladmin_v1/types/cloud_sql_flags.py +272 -0
- google/cloud/sqladmin_v1/types/cloud_sql_iam_policies.py +24 -0
- google/cloud/sqladmin_v1/types/cloud_sql_instance_names.py +24 -0
- google/cloud/sqladmin_v1/types/cloud_sql_instances.py +4514 -0
- google/cloud/sqladmin_v1/types/cloud_sql_operations.py +164 -0
- google/cloud/sqladmin_v1/types/cloud_sql_regions.py +24 -0
- google/cloud/sqladmin_v1/types/cloud_sql_resources.py +4678 -0
- google/cloud/sqladmin_v1/types/cloud_sql_ssl_certs.py +220 -0
- google/cloud/sqladmin_v1/types/cloud_sql_tiers.py +108 -0
- google/cloud/sqladmin_v1/types/cloud_sql_users.py +571 -0
- google/cloud/sqladmin_v1beta4/__init__.py +583 -0
- google/cloud/sqladmin_v1beta4/_compat.py +262 -0
- google/cloud/sqladmin_v1beta4/gapic_metadata.json +1371 -0
- google/cloud/sqladmin_v1beta4/gapic_version.py +16 -0
- google/cloud/sqladmin_v1beta4/py.typed +2 -0
- google/cloud/sqladmin_v1beta4/services/__init__.py +15 -0
- google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/async_client.py +689 -0
- google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/client.py +971 -0
- google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/pagers.py +197 -0
- google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/transports/base.py +223 -0
- google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/transports/grpc.py +449 -0
- google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/transports/grpc_asyncio.py +490 -0
- google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/transports/rest.py +1038 -0
- google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/transports/rest_base.py +150 -0
- google/cloud/sqladmin_v1beta4/services/sql_backups_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_backups_service/async_client.py +941 -0
- google/cloud/sqladmin_v1beta4/services/sql_backups_service/client.py +1241 -0
- google/cloud/sqladmin_v1beta4/services/sql_backups_service/pagers.py +197 -0
- google/cloud/sqladmin_v1beta4/services/sql_backups_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_backups_service/transports/base.py +234 -0
- google/cloud/sqladmin_v1beta4/services/sql_backups_service/transports/grpc.py +470 -0
- google/cloud/sqladmin_v1beta4/services/sql_backups_service/transports/grpc_asyncio.py +521 -0
- google/cloud/sqladmin_v1beta4/services/sql_backups_service/transports/rest.py +1238 -0
- google/cloud/sqladmin_v1beta4/services/sql_backups_service/transports/rest_base.py +175 -0
- google/cloud/sqladmin_v1beta4/services/sql_connect_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_connect_service/async_client.py +591 -0
- google/cloud/sqladmin_v1beta4/services/sql_connect_service/client.py +869 -0
- google/cloud/sqladmin_v1beta4/services/sql_connect_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_connect_service/transports/base.py +215 -0
- google/cloud/sqladmin_v1beta4/services/sql_connect_service/transports/grpc.py +430 -0
- google/cloud/sqladmin_v1beta4/services/sql_connect_service/transports/grpc_asyncio.py +464 -0
- google/cloud/sqladmin_v1beta4/services/sql_connect_service/transports/rest.py +852 -0
- google/cloud/sqladmin_v1beta4/services/sql_connect_service/transports/rest_base.py +138 -0
- google/cloud/sqladmin_v1beta4/services/sql_data_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_data_service/async_client.py +444 -0
- google/cloud/sqladmin_v1beta4/services/sql_data_service/client.py +739 -0
- google/cloud/sqladmin_v1beta4/services/sql_data_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_data_service/transports/base.py +181 -0
- google/cloud/sqladmin_v1beta4/services/sql_data_service/transports/grpc.py +407 -0
- google/cloud/sqladmin_v1beta4/services/sql_data_service/transports/grpc_asyncio.py +431 -0
- google/cloud/sqladmin_v1beta4/services/sql_data_service/transports/rest.py +213 -0
- google/cloud/sqladmin_v1beta4/services/sql_data_service/transports/rest_base.py +97 -0
- google/cloud/sqladmin_v1beta4/services/sql_databases_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_databases_service/async_client.py +860 -0
- google/cloud/sqladmin_v1beta4/services/sql_databases_service/client.py +1142 -0
- google/cloud/sqladmin_v1beta4/services/sql_databases_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_databases_service/transports/base.py +251 -0
- google/cloud/sqladmin_v1beta4/services/sql_databases_service/transports/grpc.py +502 -0
- google/cloud/sqladmin_v1beta4/services/sql_databases_service/transports/grpc_asyncio.py +561 -0
- google/cloud/sqladmin_v1beta4/services/sql_databases_service/transports/rest.py +1468 -0
- google/cloud/sqladmin_v1beta4/services/sql_databases_service/transports/rest_base.py +180 -0
- google/cloud/sqladmin_v1beta4/services/sql_flags_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_flags_service/async_client.py +386 -0
- google/cloud/sqladmin_v1beta4/services/sql_flags_service/client.py +669 -0
- google/cloud/sqladmin_v1beta4/services/sql_flags_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_flags_service/transports/base.py +181 -0
- google/cloud/sqladmin_v1beta4/services/sql_flags_service/transports/grpc.py +365 -0
- google/cloud/sqladmin_v1beta4/services/sql_flags_service/transports/grpc_asyncio.py +389 -0
- google/cloud/sqladmin_v1beta4/services/sql_flags_service/transports/rest.py +392 -0
- google/cloud/sqladmin_v1beta4/services/sql_flags_service/transports/rest_base.py +107 -0
- google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/async_client.py +315 -0
- google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/client.py +595 -0
- google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/transports/__init__.py +39 -0
- google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/transports/base.py +159 -0
- google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/transports/grpc.py +336 -0
- google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/transports/grpc_asyncio.py +353 -0
- google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/transports/rest.py +184 -0
- google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/transports/rest_base.py +91 -0
- google/cloud/sqladmin_v1beta4/services/sql_instances_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_instances_service/async_client.py +4399 -0
- google/cloud/sqladmin_v1beta4/services/sql_instances_service/client.py +4715 -0
- google/cloud/sqladmin_v1beta4/services/sql_instances_service/pagers.py +197 -0
- google/cloud/sqladmin_v1beta4/services/sql_instances_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_instances_service/transports/base.py +801 -0
- google/cloud/sqladmin_v1beta4/services/sql_instances_service/transports/grpc.py +1627 -0
- google/cloud/sqladmin_v1beta4/services/sql_instances_service/transports/grpc_asyncio.py +1895 -0
- google/cloud/sqladmin_v1beta4/services/sql_instances_service/transports/rest.py +9625 -0
- google/cloud/sqladmin_v1beta4/services/sql_instances_service/transports/rest_base.py +744 -0
- google/cloud/sqladmin_v1beta4/services/sql_operations_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_operations_service/async_client.py +585 -0
- google/cloud/sqladmin_v1beta4/services/sql_operations_service/client.py +867 -0
- google/cloud/sqladmin_v1beta4/services/sql_operations_service/pagers.py +197 -0
- google/cloud/sqladmin_v1beta4/services/sql_operations_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_operations_service/transports/base.py +210 -0
- google/cloud/sqladmin_v1beta4/services/sql_operations_service/transports/grpc.py +422 -0
- google/cloud/sqladmin_v1beta4/services/sql_operations_service/transports/grpc_asyncio.py +458 -0
- google/cloud/sqladmin_v1beta4/services/sql_operations_service/transports/rest.py +744 -0
- google/cloud/sqladmin_v1beta4/services/sql_operations_service/transports/rest_base.py +136 -0
- google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/async_client.py +672 -0
- google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/client.py +954 -0
- google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/transports/base.py +226 -0
- google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/transports/grpc.py +453 -0
- google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/transports/grpc_asyncio.py +497 -0
- google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/transports/rest.py +1036 -0
- google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/transports/rest_base.py +150 -0
- google/cloud/sqladmin_v1beta4/services/sql_tiers_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_tiers_service/async_client.py +393 -0
- google/cloud/sqladmin_v1beta4/services/sql_tiers_service/client.py +676 -0
- google/cloud/sqladmin_v1beta4/services/sql_tiers_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_tiers_service/transports/base.py +181 -0
- google/cloud/sqladmin_v1beta4/services/sql_tiers_service/transports/grpc.py +368 -0
- google/cloud/sqladmin_v1beta4/services/sql_tiers_service/transports/grpc_asyncio.py +392 -0
- google/cloud/sqladmin_v1beta4/services/sql_tiers_service/transports/rest.py +396 -0
- google/cloud/sqladmin_v1beta4/services/sql_tiers_service/transports/rest_base.py +107 -0
- google/cloud/sqladmin_v1beta4/services/sql_users_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_users_service/async_client.py +754 -0
- google/cloud/sqladmin_v1beta4/services/sql_users_service/client.py +1037 -0
- google/cloud/sqladmin_v1beta4/services/sql_users_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_users_service/transports/base.py +237 -0
- google/cloud/sqladmin_v1beta4/services/sql_users_service/transports/grpc.py +475 -0
- google/cloud/sqladmin_v1beta4/services/sql_users_service/transports/grpc_asyncio.py +524 -0
- google/cloud/sqladmin_v1beta4/services/sql_users_service/transports/rest.py +1249 -0
- google/cloud/sqladmin_v1beta4/services/sql_users_service/transports/rest_base.py +165 -0
- google/cloud/sqladmin_v1beta4/types/__init__.py +480 -0
- google/cloud/sqladmin_v1beta4/types/cloud_sql.py +2666 -0
- google/cloud/sqladmin_v1beta4/types/cloud_sql_connect.py +386 -0
- google/cloud/sqladmin_v1beta4/types/cloud_sql_data.py +339 -0
- google/cloud/sqladmin_v1beta4/types/cloud_sql_iam_policies.py +24 -0
- google/cloud/sqladmin_v1beta4/types/cloud_sql_resources.py +8111 -0
- google/cloud/sqladmin_v1beta4/types/cloud_sql_tiers.py +108 -0
- google/cloud/sqladmin_v1beta4/types/cloud_sql_users.py +573 -0
- google_cloud_sql-0.1.1.dist-info/METADATA +239 -0
- google_cloud_sql-0.1.1.dist-info/RECORD +274 -0
- google_cloud_sql-0.1.1.dist-info/WHEEL +5 -0
- google_cloud_sql-0.1.1.dist-info/licenses/LICENSE +202 -0
- google_cloud_sql-0.1.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,739 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright 2026 Google LLC
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
16
|
+
import json
|
|
17
|
+
import logging as std_logging
|
|
18
|
+
import os
|
|
19
|
+
import re
|
|
20
|
+
import warnings
|
|
21
|
+
from collections import OrderedDict
|
|
22
|
+
from http import HTTPStatus
|
|
23
|
+
from typing import (
|
|
24
|
+
Callable,
|
|
25
|
+
Dict,
|
|
26
|
+
Iterable,
|
|
27
|
+
Iterator,
|
|
28
|
+
Mapping,
|
|
29
|
+
MutableMapping,
|
|
30
|
+
MutableSequence,
|
|
31
|
+
Optional,
|
|
32
|
+
Sequence,
|
|
33
|
+
Tuple,
|
|
34
|
+
Type,
|
|
35
|
+
Union,
|
|
36
|
+
cast,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
import google.protobuf
|
|
40
|
+
from google.api_core import client_options as client_options_lib
|
|
41
|
+
from google.api_core import exceptions as core_exceptions
|
|
42
|
+
from google.api_core import gapic_v1
|
|
43
|
+
from google.api_core import retry as retries
|
|
44
|
+
from google.auth import credentials as ga_credentials # type: ignore
|
|
45
|
+
from google.auth.exceptions import MutualTLSChannelError # type: ignore
|
|
46
|
+
from google.auth.transport import mtls # type: ignore
|
|
47
|
+
from google.auth.transport.grpc import SslCredentials # type: ignore
|
|
48
|
+
from google.oauth2 import service_account # type: ignore
|
|
49
|
+
|
|
50
|
+
from google.cloud.sqladmin_v1beta4 import gapic_version as package_version
|
|
51
|
+
from google.cloud.sqladmin_v1beta4._compat import (
|
|
52
|
+
get_api_endpoint,
|
|
53
|
+
get_default_mtls_endpoint,
|
|
54
|
+
get_universe_domain,
|
|
55
|
+
read_environment_variables,
|
|
56
|
+
should_use_client_cert,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
try:
|
|
60
|
+
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None]
|
|
61
|
+
except AttributeError: # pragma: NO COVER
|
|
62
|
+
OptionalRetry = Union[retries.Retry, object, None] # type: ignore
|
|
63
|
+
|
|
64
|
+
try:
|
|
65
|
+
from google.api_core import client_logging # type: ignore
|
|
66
|
+
|
|
67
|
+
CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER
|
|
68
|
+
except ImportError: # pragma: NO COVER
|
|
69
|
+
CLIENT_LOGGING_SUPPORTED = False
|
|
70
|
+
|
|
71
|
+
_LOGGER = std_logging.getLogger(__name__)
|
|
72
|
+
|
|
73
|
+
from google.cloud.location import locations_pb2 # type: ignore
|
|
74
|
+
from google.longrunning import operations_pb2 # type: ignore
|
|
75
|
+
|
|
76
|
+
from google.cloud.sqladmin_v1beta4.types import cloud_sql_data
|
|
77
|
+
|
|
78
|
+
from .transports.base import DEFAULT_CLIENT_INFO, SqlDataServiceTransport
|
|
79
|
+
from .transports.grpc import SqlDataServiceGrpcTransport
|
|
80
|
+
from .transports.grpc_asyncio import SqlDataServiceGrpcAsyncIOTransport
|
|
81
|
+
from .transports.rest import SqlDataServiceRestTransport
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class SqlDataServiceClientMeta(type):
|
|
85
|
+
"""Metaclass for the SqlDataService client.
|
|
86
|
+
|
|
87
|
+
This provides class-level methods for building and retrieving
|
|
88
|
+
support objects (e.g. transport) without polluting the client instance
|
|
89
|
+
objects.
|
|
90
|
+
"""
|
|
91
|
+
|
|
92
|
+
_transport_registry = OrderedDict() # type: Dict[str, Type[SqlDataServiceTransport]]
|
|
93
|
+
_transport_registry["grpc"] = SqlDataServiceGrpcTransport
|
|
94
|
+
_transport_registry["grpc_asyncio"] = SqlDataServiceGrpcAsyncIOTransport
|
|
95
|
+
_transport_registry["rest"] = SqlDataServiceRestTransport
|
|
96
|
+
|
|
97
|
+
def get_transport_class(
|
|
98
|
+
cls,
|
|
99
|
+
label: Optional[str] = None,
|
|
100
|
+
) -> Type[SqlDataServiceTransport]:
|
|
101
|
+
"""Returns an appropriate transport class.
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
label: The name of the desired transport. If none is
|
|
105
|
+
provided, then the first transport in the registry is used.
|
|
106
|
+
|
|
107
|
+
Returns:
|
|
108
|
+
The transport class to use.
|
|
109
|
+
"""
|
|
110
|
+
# If a specific transport is requested, return that one.
|
|
111
|
+
if label:
|
|
112
|
+
return cls._transport_registry[label]
|
|
113
|
+
|
|
114
|
+
# No transport is requested; return the default (that is, the first one
|
|
115
|
+
# in the dictionary).
|
|
116
|
+
return next(iter(cls._transport_registry.values()))
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
class SqlDataServiceClient(metaclass=SqlDataServiceClientMeta):
|
|
120
|
+
"""Service for streaming data to and from Cloud SQL instances."""
|
|
121
|
+
|
|
122
|
+
# Note: DEFAULT_ENDPOINT is deprecated. Use _DEFAULT_ENDPOINT_TEMPLATE instead.
|
|
123
|
+
DEFAULT_ENDPOINT = "sqladmin.googleapis.com"
|
|
124
|
+
DEFAULT_MTLS_ENDPOINT = get_default_mtls_endpoint(DEFAULT_ENDPOINT)
|
|
125
|
+
|
|
126
|
+
_DEFAULT_ENDPOINT_TEMPLATE = "sqladmin.{UNIVERSE_DOMAIN}"
|
|
127
|
+
_DEFAULT_UNIVERSE = "googleapis.com"
|
|
128
|
+
|
|
129
|
+
@classmethod
|
|
130
|
+
def from_service_account_info(cls, info: dict, *args, **kwargs):
|
|
131
|
+
"""Creates an instance of this client using the provided credentials
|
|
132
|
+
info.
|
|
133
|
+
|
|
134
|
+
Args:
|
|
135
|
+
info (dict): The service account private key info.
|
|
136
|
+
args: Additional arguments to pass to the constructor.
|
|
137
|
+
kwargs: Additional arguments to pass to the constructor.
|
|
138
|
+
|
|
139
|
+
Returns:
|
|
140
|
+
SqlDataServiceClient: The constructed client.
|
|
141
|
+
"""
|
|
142
|
+
credentials = service_account.Credentials.from_service_account_info(info)
|
|
143
|
+
kwargs["credentials"] = credentials
|
|
144
|
+
return cls(*args, **kwargs)
|
|
145
|
+
|
|
146
|
+
@classmethod
|
|
147
|
+
def from_service_account_file(cls, filename: str, *args, **kwargs):
|
|
148
|
+
"""Creates an instance of this client using the provided credentials
|
|
149
|
+
file.
|
|
150
|
+
|
|
151
|
+
Args:
|
|
152
|
+
filename (str): The path to the service account private key json
|
|
153
|
+
file.
|
|
154
|
+
args: Additional arguments to pass to the constructor.
|
|
155
|
+
kwargs: Additional arguments to pass to the constructor.
|
|
156
|
+
|
|
157
|
+
Returns:
|
|
158
|
+
SqlDataServiceClient: The constructed client.
|
|
159
|
+
"""
|
|
160
|
+
credentials = service_account.Credentials.from_service_account_file(filename)
|
|
161
|
+
kwargs["credentials"] = credentials
|
|
162
|
+
return cls(*args, **kwargs)
|
|
163
|
+
|
|
164
|
+
from_service_account_json = from_service_account_file
|
|
165
|
+
|
|
166
|
+
@property
|
|
167
|
+
def transport(self) -> SqlDataServiceTransport:
|
|
168
|
+
"""Returns the transport used by the client instance.
|
|
169
|
+
|
|
170
|
+
Returns:
|
|
171
|
+
SqlDataServiceTransport: The transport used by the client
|
|
172
|
+
instance.
|
|
173
|
+
"""
|
|
174
|
+
return self._transport
|
|
175
|
+
|
|
176
|
+
@staticmethod
|
|
177
|
+
def instance_path(
|
|
178
|
+
project: str,
|
|
179
|
+
instance: str,
|
|
180
|
+
) -> str:
|
|
181
|
+
"""Returns a fully-qualified instance string."""
|
|
182
|
+
return "projects/{project}/instances/{instance}".format(
|
|
183
|
+
project=project,
|
|
184
|
+
instance=instance,
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
@staticmethod
|
|
188
|
+
def parse_instance_path(path: str) -> Dict[str, str]:
|
|
189
|
+
"""Parses a instance path into its component segments."""
|
|
190
|
+
m = re.match(r"^projects/(?P<project>.+?)/instances/(?P<instance>.+?)$", path)
|
|
191
|
+
return m.groupdict() if m else {}
|
|
192
|
+
|
|
193
|
+
@staticmethod
|
|
194
|
+
def common_billing_account_path(
|
|
195
|
+
billing_account: str,
|
|
196
|
+
) -> str:
|
|
197
|
+
"""Returns a fully-qualified billing_account string."""
|
|
198
|
+
return "billingAccounts/{billing_account}".format(
|
|
199
|
+
billing_account=billing_account,
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
@staticmethod
|
|
203
|
+
def parse_common_billing_account_path(path: str) -> Dict[str, str]:
|
|
204
|
+
"""Parse a billing_account path into its component segments."""
|
|
205
|
+
m = re.match(r"^billingAccounts/(?P<billing_account>.+?)$", path)
|
|
206
|
+
return m.groupdict() if m else {}
|
|
207
|
+
|
|
208
|
+
@staticmethod
|
|
209
|
+
def common_folder_path(
|
|
210
|
+
folder: str,
|
|
211
|
+
) -> str:
|
|
212
|
+
"""Returns a fully-qualified folder string."""
|
|
213
|
+
return "folders/{folder}".format(
|
|
214
|
+
folder=folder,
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
@staticmethod
|
|
218
|
+
def parse_common_folder_path(path: str) -> Dict[str, str]:
|
|
219
|
+
"""Parse a folder path into its component segments."""
|
|
220
|
+
m = re.match(r"^folders/(?P<folder>.+?)$", path)
|
|
221
|
+
return m.groupdict() if m else {}
|
|
222
|
+
|
|
223
|
+
@staticmethod
|
|
224
|
+
def common_organization_path(
|
|
225
|
+
organization: str,
|
|
226
|
+
) -> str:
|
|
227
|
+
"""Returns a fully-qualified organization string."""
|
|
228
|
+
return "organizations/{organization}".format(
|
|
229
|
+
organization=organization,
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
@staticmethod
|
|
233
|
+
def parse_common_organization_path(path: str) -> Dict[str, str]:
|
|
234
|
+
"""Parse a organization path into its component segments."""
|
|
235
|
+
m = re.match(r"^organizations/(?P<organization>.+?)$", path)
|
|
236
|
+
return m.groupdict() if m else {}
|
|
237
|
+
|
|
238
|
+
@staticmethod
|
|
239
|
+
def common_project_path(
|
|
240
|
+
project: str,
|
|
241
|
+
) -> str:
|
|
242
|
+
"""Returns a fully-qualified project string."""
|
|
243
|
+
return "projects/{project}".format(
|
|
244
|
+
project=project,
|
|
245
|
+
)
|
|
246
|
+
|
|
247
|
+
@staticmethod
|
|
248
|
+
def parse_common_project_path(path: str) -> Dict[str, str]:
|
|
249
|
+
"""Parse a project path into its component segments."""
|
|
250
|
+
m = re.match(r"^projects/(?P<project>.+?)$", path)
|
|
251
|
+
return m.groupdict() if m else {}
|
|
252
|
+
|
|
253
|
+
@staticmethod
|
|
254
|
+
def common_location_path(
|
|
255
|
+
project: str,
|
|
256
|
+
location: str,
|
|
257
|
+
) -> str:
|
|
258
|
+
"""Returns a fully-qualified location string."""
|
|
259
|
+
return "projects/{project}/locations/{location}".format(
|
|
260
|
+
project=project,
|
|
261
|
+
location=location,
|
|
262
|
+
)
|
|
263
|
+
|
|
264
|
+
@staticmethod
|
|
265
|
+
def parse_common_location_path(path: str) -> Dict[str, str]:
|
|
266
|
+
"""Parse a location path into its component segments."""
|
|
267
|
+
m = re.match(r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)$", path)
|
|
268
|
+
return m.groupdict() if m else {}
|
|
269
|
+
|
|
270
|
+
@classmethod
|
|
271
|
+
def get_mtls_endpoint_and_cert_source(
|
|
272
|
+
cls, client_options: Optional[client_options_lib.ClientOptions] = None
|
|
273
|
+
):
|
|
274
|
+
"""Deprecated. Return the API endpoint and client cert source for mutual TLS.
|
|
275
|
+
|
|
276
|
+
The client cert source is determined in the following order:
|
|
277
|
+
(1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the
|
|
278
|
+
client cert source is None.
|
|
279
|
+
(2) if `client_options.client_cert_source` is provided, use the provided one; if the
|
|
280
|
+
default client cert source exists, use the default one; otherwise the client cert
|
|
281
|
+
source is None.
|
|
282
|
+
|
|
283
|
+
The API endpoint is determined in the following order:
|
|
284
|
+
(1) if `client_options.api_endpoint` if provided, use the provided one.
|
|
285
|
+
(2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the
|
|
286
|
+
default mTLS endpoint; if the environment variable is "never", use the default API
|
|
287
|
+
endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise
|
|
288
|
+
use the default API endpoint.
|
|
289
|
+
|
|
290
|
+
More details can be found at https://google.aip.dev/auth/4114.
|
|
291
|
+
|
|
292
|
+
Args:
|
|
293
|
+
client_options (google.api_core.client_options.ClientOptions): Custom options for the
|
|
294
|
+
client. Only the `api_endpoint` and `client_cert_source` properties may be used
|
|
295
|
+
in this method.
|
|
296
|
+
|
|
297
|
+
Returns:
|
|
298
|
+
Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the
|
|
299
|
+
client cert source to use.
|
|
300
|
+
|
|
301
|
+
Raises:
|
|
302
|
+
google.auth.exceptions.MutualTLSChannelError: If any errors happen.
|
|
303
|
+
"""
|
|
304
|
+
|
|
305
|
+
warnings.warn(
|
|
306
|
+
"get_mtls_endpoint_and_cert_source is deprecated. Use the api_endpoint property instead.",
|
|
307
|
+
DeprecationWarning,
|
|
308
|
+
)
|
|
309
|
+
if client_options is None:
|
|
310
|
+
client_options = client_options_lib.ClientOptions()
|
|
311
|
+
use_client_cert = should_use_client_cert()
|
|
312
|
+
use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto")
|
|
313
|
+
if use_mtls_endpoint not in ("auto", "never", "always"):
|
|
314
|
+
raise MutualTLSChannelError(
|
|
315
|
+
"Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`"
|
|
316
|
+
)
|
|
317
|
+
|
|
318
|
+
# Figure out the client cert source to use.
|
|
319
|
+
client_cert_source = None
|
|
320
|
+
if use_client_cert:
|
|
321
|
+
if client_options.client_cert_source:
|
|
322
|
+
client_cert_source = client_options.client_cert_source
|
|
323
|
+
elif mtls.has_default_client_cert_source():
|
|
324
|
+
client_cert_source = mtls.default_client_cert_source()
|
|
325
|
+
|
|
326
|
+
# Figure out which api endpoint to use.
|
|
327
|
+
if client_options.api_endpoint is not None:
|
|
328
|
+
api_endpoint = client_options.api_endpoint
|
|
329
|
+
elif use_mtls_endpoint == "always" or (
|
|
330
|
+
use_mtls_endpoint == "auto" and client_cert_source
|
|
331
|
+
):
|
|
332
|
+
api_endpoint = cls.DEFAULT_MTLS_ENDPOINT # type: ignore
|
|
333
|
+
else:
|
|
334
|
+
api_endpoint = cls.DEFAULT_ENDPOINT
|
|
335
|
+
|
|
336
|
+
return api_endpoint, client_cert_source
|
|
337
|
+
|
|
338
|
+
@staticmethod
|
|
339
|
+
def _get_client_cert_source(provided_cert_source, use_cert_flag):
|
|
340
|
+
"""Return the client cert source to be used by the client.
|
|
341
|
+
|
|
342
|
+
Args:
|
|
343
|
+
provided_cert_source (bytes): The client certificate source provided.
|
|
344
|
+
use_cert_flag (bool): A flag indicating whether to use the client certificate.
|
|
345
|
+
|
|
346
|
+
Returns:
|
|
347
|
+
bytes or None: The client cert source to be used by the client.
|
|
348
|
+
"""
|
|
349
|
+
client_cert_source = None
|
|
350
|
+
if use_cert_flag:
|
|
351
|
+
if provided_cert_source:
|
|
352
|
+
client_cert_source = provided_cert_source
|
|
353
|
+
elif mtls.has_default_client_cert_source():
|
|
354
|
+
client_cert_source = mtls.default_client_cert_source()
|
|
355
|
+
return client_cert_source
|
|
356
|
+
|
|
357
|
+
def _validate_universe_domain(self):
|
|
358
|
+
"""Validates client's and credentials' universe domains are consistent.
|
|
359
|
+
|
|
360
|
+
Returns:
|
|
361
|
+
bool: True iff the configured universe domain is valid.
|
|
362
|
+
|
|
363
|
+
Raises:
|
|
364
|
+
ValueError: If the configured universe domain is not valid.
|
|
365
|
+
"""
|
|
366
|
+
|
|
367
|
+
# NOTE (b/349488459): universe validation is disabled until further notice.
|
|
368
|
+
return True
|
|
369
|
+
|
|
370
|
+
def _add_cred_info_for_auth_errors(
|
|
371
|
+
self, error: core_exceptions.GoogleAPICallError
|
|
372
|
+
) -> None:
|
|
373
|
+
"""Adds credential info string to error details for 401/403/404 errors.
|
|
374
|
+
|
|
375
|
+
Args:
|
|
376
|
+
error (google.api_core.exceptions.GoogleAPICallError): The error to add the cred info.
|
|
377
|
+
"""
|
|
378
|
+
if error.code not in [
|
|
379
|
+
HTTPStatus.UNAUTHORIZED,
|
|
380
|
+
HTTPStatus.FORBIDDEN,
|
|
381
|
+
HTTPStatus.NOT_FOUND,
|
|
382
|
+
]:
|
|
383
|
+
return
|
|
384
|
+
|
|
385
|
+
cred = self._transport._credentials
|
|
386
|
+
|
|
387
|
+
# get_cred_info is only available in google-auth>=2.35.0
|
|
388
|
+
if not hasattr(cred, "get_cred_info"):
|
|
389
|
+
return
|
|
390
|
+
|
|
391
|
+
# ignore the type check since pypy test fails when get_cred_info
|
|
392
|
+
# is not available
|
|
393
|
+
cred_info = cred.get_cred_info() # type: ignore
|
|
394
|
+
if cred_info and hasattr(error._details, "append"):
|
|
395
|
+
error._details.append(json.dumps(cred_info))
|
|
396
|
+
|
|
397
|
+
@property
|
|
398
|
+
def api_endpoint(self) -> str:
|
|
399
|
+
"""Return the API endpoint used by the client instance.
|
|
400
|
+
|
|
401
|
+
Returns:
|
|
402
|
+
str: The API endpoint used by the client instance.
|
|
403
|
+
"""
|
|
404
|
+
return self._api_endpoint
|
|
405
|
+
|
|
406
|
+
@property
|
|
407
|
+
def universe_domain(self) -> str:
|
|
408
|
+
"""Return the universe domain used by the client instance.
|
|
409
|
+
|
|
410
|
+
Returns:
|
|
411
|
+
str: The universe domain used by the client instance.
|
|
412
|
+
"""
|
|
413
|
+
return self._universe_domain
|
|
414
|
+
|
|
415
|
+
def __init__(
|
|
416
|
+
self,
|
|
417
|
+
*,
|
|
418
|
+
credentials: Optional[ga_credentials.Credentials] = None,
|
|
419
|
+
transport: Optional[
|
|
420
|
+
Union[str, SqlDataServiceTransport, Callable[..., SqlDataServiceTransport]]
|
|
421
|
+
] = None,
|
|
422
|
+
client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None,
|
|
423
|
+
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
|
|
424
|
+
) -> None:
|
|
425
|
+
"""Instantiates the sql data service client.
|
|
426
|
+
|
|
427
|
+
Args:
|
|
428
|
+
credentials (Optional[google.auth.credentials.Credentials]): The
|
|
429
|
+
authorization credentials to attach to requests. These
|
|
430
|
+
credentials identify the application to the service; if none
|
|
431
|
+
are specified, the client will attempt to ascertain the
|
|
432
|
+
credentials from the environment.
|
|
433
|
+
transport (Optional[Union[str,SqlDataServiceTransport,Callable[..., SqlDataServiceTransport]]]):
|
|
434
|
+
The transport to use, or a Callable that constructs and returns a new transport.
|
|
435
|
+
If a Callable is given, it will be called with the same set of initialization
|
|
436
|
+
arguments as used in the SqlDataServiceTransport constructor.
|
|
437
|
+
If set to None, a transport is chosen automatically.
|
|
438
|
+
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]):
|
|
439
|
+
Custom options for the client.
|
|
440
|
+
|
|
441
|
+
1. The ``api_endpoint`` property can be used to override the
|
|
442
|
+
default endpoint provided by the client when ``transport`` is
|
|
443
|
+
not explicitly provided. Only if this property is not set and
|
|
444
|
+
``transport`` was not explicitly provided, the endpoint is
|
|
445
|
+
determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment
|
|
446
|
+
variable, which have one of the following values:
|
|
447
|
+
"always" (always use the default mTLS endpoint), "never" (always
|
|
448
|
+
use the default regular endpoint) and "auto" (auto-switch to the
|
|
449
|
+
default mTLS endpoint if client certificate is present; this is
|
|
450
|
+
the default value).
|
|
451
|
+
|
|
452
|
+
2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
|
|
453
|
+
is "true", then the ``client_cert_source`` property can be used
|
|
454
|
+
to provide a client certificate for mTLS transport. If
|
|
455
|
+
not provided, the default SSL client certificate will be used if
|
|
456
|
+
present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not
|
|
457
|
+
set, no client certificate will be used.
|
|
458
|
+
|
|
459
|
+
3. The ``universe_domain`` property can be used to override the
|
|
460
|
+
default "googleapis.com" universe. Note that the ``api_endpoint``
|
|
461
|
+
property still takes precedence; and ``universe_domain`` is
|
|
462
|
+
currently not supported for mTLS.
|
|
463
|
+
|
|
464
|
+
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
|
|
465
|
+
The client info used to send a user-agent string along with
|
|
466
|
+
API requests. If ``None``, then default info will be used.
|
|
467
|
+
Generally, you only need to set this if you're developing
|
|
468
|
+
your own client library.
|
|
469
|
+
|
|
470
|
+
Raises:
|
|
471
|
+
google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport
|
|
472
|
+
creation failed for any reason.
|
|
473
|
+
"""
|
|
474
|
+
self._client_options = client_options
|
|
475
|
+
if isinstance(self._client_options, dict):
|
|
476
|
+
self._client_options = client_options_lib.from_dict(self._client_options)
|
|
477
|
+
if self._client_options is None:
|
|
478
|
+
self._client_options = client_options_lib.ClientOptions()
|
|
479
|
+
self._client_options = cast(
|
|
480
|
+
client_options_lib.ClientOptions, self._client_options
|
|
481
|
+
)
|
|
482
|
+
|
|
483
|
+
universe_domain_opt = getattr(self._client_options, "universe_domain", None)
|
|
484
|
+
|
|
485
|
+
self._use_client_cert, self._use_mtls_endpoint, self._universe_domain_env = (
|
|
486
|
+
read_environment_variables()
|
|
487
|
+
)
|
|
488
|
+
self._client_cert_source = SqlDataServiceClient._get_client_cert_source(
|
|
489
|
+
self._client_options.client_cert_source, self._use_client_cert
|
|
490
|
+
)
|
|
491
|
+
self._universe_domain = get_universe_domain(
|
|
492
|
+
universe_domain_opt,
|
|
493
|
+
self._universe_domain_env,
|
|
494
|
+
default_universe=SqlDataServiceClient._DEFAULT_UNIVERSE,
|
|
495
|
+
)
|
|
496
|
+
self._api_endpoint: str = "" # updated below, depending on `transport`
|
|
497
|
+
|
|
498
|
+
# Initialize the universe domain validation.
|
|
499
|
+
self._is_universe_domain_valid = False
|
|
500
|
+
|
|
501
|
+
if CLIENT_LOGGING_SUPPORTED: # pragma: NO COVER
|
|
502
|
+
# Setup logging.
|
|
503
|
+
client_logging.initialize_logging()
|
|
504
|
+
|
|
505
|
+
api_key_value = getattr(self._client_options, "api_key", None)
|
|
506
|
+
if api_key_value and credentials:
|
|
507
|
+
raise ValueError(
|
|
508
|
+
"client_options.api_key and credentials are mutually exclusive"
|
|
509
|
+
)
|
|
510
|
+
|
|
511
|
+
# Save or instantiate the transport.
|
|
512
|
+
# Ordinarily, we provide the transport, but allowing a custom transport
|
|
513
|
+
# instance provides an extensibility point for unusual situations.
|
|
514
|
+
transport_provided = isinstance(transport, SqlDataServiceTransport)
|
|
515
|
+
if transport_provided:
|
|
516
|
+
# transport is a SqlDataServiceTransport instance.
|
|
517
|
+
if credentials or self._client_options.credentials_file or api_key_value:
|
|
518
|
+
raise ValueError(
|
|
519
|
+
"When providing a transport instance, "
|
|
520
|
+
"provide its credentials directly."
|
|
521
|
+
)
|
|
522
|
+
if self._client_options.scopes:
|
|
523
|
+
raise ValueError(
|
|
524
|
+
"When providing a transport instance, provide its scopes directly."
|
|
525
|
+
)
|
|
526
|
+
self._transport = cast(SqlDataServiceTransport, transport)
|
|
527
|
+
self._api_endpoint = self._transport.host
|
|
528
|
+
|
|
529
|
+
self._api_endpoint = self._api_endpoint or get_api_endpoint(
|
|
530
|
+
api_override=self._client_options.api_endpoint,
|
|
531
|
+
universe_domain=self._universe_domain,
|
|
532
|
+
default_universe=SqlDataServiceClient._DEFAULT_UNIVERSE,
|
|
533
|
+
default_mtls_endpoint=SqlDataServiceClient.DEFAULT_MTLS_ENDPOINT,
|
|
534
|
+
default_endpoint_template=SqlDataServiceClient._DEFAULT_ENDPOINT_TEMPLATE,
|
|
535
|
+
use_mtls=self._use_mtls_endpoint == "always"
|
|
536
|
+
or (self._use_mtls_endpoint == "auto" and self._client_cert_source),
|
|
537
|
+
)
|
|
538
|
+
|
|
539
|
+
if not transport_provided:
|
|
540
|
+
import google.auth._default # type: ignore
|
|
541
|
+
|
|
542
|
+
if api_key_value and hasattr(
|
|
543
|
+
google.auth._default, "get_api_key_credentials"
|
|
544
|
+
):
|
|
545
|
+
credentials = google.auth._default.get_api_key_credentials(
|
|
546
|
+
api_key_value
|
|
547
|
+
)
|
|
548
|
+
|
|
549
|
+
transport_init: Union[
|
|
550
|
+
Type[SqlDataServiceTransport], Callable[..., SqlDataServiceTransport]
|
|
551
|
+
] = (
|
|
552
|
+
SqlDataServiceClient.get_transport_class(transport)
|
|
553
|
+
if isinstance(transport, str) or transport is None
|
|
554
|
+
else cast(Callable[..., SqlDataServiceTransport], transport)
|
|
555
|
+
)
|
|
556
|
+
# initialize with the provided callable or the passed in class
|
|
557
|
+
self._transport = transport_init(
|
|
558
|
+
credentials=credentials,
|
|
559
|
+
credentials_file=self._client_options.credentials_file,
|
|
560
|
+
host=self._api_endpoint,
|
|
561
|
+
scopes=self._client_options.scopes,
|
|
562
|
+
client_cert_source_for_mtls=self._client_cert_source,
|
|
563
|
+
quota_project_id=self._client_options.quota_project_id,
|
|
564
|
+
client_info=client_info,
|
|
565
|
+
always_use_jwt_access=True,
|
|
566
|
+
api_audience=self._client_options.api_audience,
|
|
567
|
+
)
|
|
568
|
+
|
|
569
|
+
if "async" not in str(self._transport):
|
|
570
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
571
|
+
std_logging.DEBUG
|
|
572
|
+
): # pragma: NO COVER
|
|
573
|
+
_LOGGER.debug(
|
|
574
|
+
"Created client `google.cloud.sql_v1beta4.SqlDataServiceClient`.",
|
|
575
|
+
extra={
|
|
576
|
+
"serviceName": "google.cloud.sql.v1beta4.SqlDataService",
|
|
577
|
+
"universeDomain": getattr(
|
|
578
|
+
self._transport._credentials, "universe_domain", ""
|
|
579
|
+
),
|
|
580
|
+
"credentialsType": f"{type(self._transport._credentials).__module__}.{type(self._transport._credentials).__qualname__}",
|
|
581
|
+
"credentialsInfo": getattr(
|
|
582
|
+
self.transport._credentials, "get_cred_info", lambda: None
|
|
583
|
+
)(),
|
|
584
|
+
}
|
|
585
|
+
if hasattr(self._transport, "_credentials")
|
|
586
|
+
else {
|
|
587
|
+
"serviceName": "google.cloud.sql.v1beta4.SqlDataService",
|
|
588
|
+
"credentialsType": None,
|
|
589
|
+
},
|
|
590
|
+
)
|
|
591
|
+
|
|
592
|
+
def stream_sql_data(
|
|
593
|
+
self,
|
|
594
|
+
requests: Optional[Iterator[cloud_sql_data.StreamSqlDataRequest]] = None,
|
|
595
|
+
*,
|
|
596
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
597
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
598
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
599
|
+
) -> Iterable[cloud_sql_data.StreamSqlDataResponse]:
|
|
600
|
+
r"""``StreamSqlData`` establishes a bidirectional stream to a Cloud
|
|
601
|
+
SQL instance, and then streams data to and from the instance.
|
|
602
|
+
|
|
603
|
+
The first message from the client MUST be a
|
|
604
|
+
``StreamSqlDataRequest`` request with configuration settings,
|
|
605
|
+
including required values for the ``connection_settings`` field.
|
|
606
|
+
Subsequent messages from the client may contain the ``payload``
|
|
607
|
+
field.
|
|
608
|
+
|
|
609
|
+
Messages from the server may contain the ``payload`` field.
|
|
610
|
+
|
|
611
|
+
The ``payload`` fields of the request and response streams
|
|
612
|
+
contain the raw data of the database's native wire protocol
|
|
613
|
+
(e.g., PostgreSQL wire protocol). The database client is
|
|
614
|
+
responsible for generating and parsing this data.
|
|
615
|
+
|
|
616
|
+
Any errors on initial connection (e.g., connection failure,
|
|
617
|
+
authorization issues, network problems) will result in the
|
|
618
|
+
stream being terminated with an appropriate RPC status
|
|
619
|
+
exception.
|
|
620
|
+
|
|
621
|
+
After a successful connection is made, if an error occurs, then
|
|
622
|
+
the server terminates connection and returns the appropriate RPC
|
|
623
|
+
status exception.
|
|
624
|
+
|
|
625
|
+
Add the request params headers to the request to ensure that the
|
|
626
|
+
streaming request is routed to the correct service for your
|
|
627
|
+
database.
|
|
628
|
+
|
|
629
|
+
Use this format for the request params header:
|
|
630
|
+
|
|
631
|
+
::
|
|
632
|
+
|
|
633
|
+
`x-goog-request-params`:
|
|
634
|
+
location_id={location_path}&instance_id={instance_path}`
|
|
635
|
+
|
|
636
|
+
``location_path`` is ``locations/{location_name}``
|
|
637
|
+
``instance_path`` is
|
|
638
|
+
``projects/{project_name}/instances/{instance_name}``
|
|
639
|
+
|
|
640
|
+
for example: ``x-goog-request-params``:
|
|
641
|
+
``location_id=locations/us-central1&instance_id=projects/myproject/instances/instancename``
|
|
642
|
+
|
|
643
|
+
.. code-block:: python
|
|
644
|
+
|
|
645
|
+
# This snippet has been automatically generated and should be regarded as a
|
|
646
|
+
# code template only.
|
|
647
|
+
# It will require modifications to work:
|
|
648
|
+
# - It may require correct/in-range values for request initialization.
|
|
649
|
+
# - It may require specifying regional endpoints when creating the service
|
|
650
|
+
# client as shown in:
|
|
651
|
+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
|
|
652
|
+
from google.cloud import sqladmin_v1beta4
|
|
653
|
+
|
|
654
|
+
def sample_stream_sql_data():
|
|
655
|
+
# Create a client
|
|
656
|
+
client = sqladmin_v1beta4.SqlDataServiceClient()
|
|
657
|
+
|
|
658
|
+
# Initialize request argument(s)
|
|
659
|
+
start_session = sqladmin_v1beta4.StartSession()
|
|
660
|
+
start_session.location_id = "location_id_value"
|
|
661
|
+
start_session.instance_id = "instance_id_value"
|
|
662
|
+
|
|
663
|
+
request = sqladmin_v1beta4.StreamSqlDataRequest(
|
|
664
|
+
start_session=start_session,
|
|
665
|
+
)
|
|
666
|
+
|
|
667
|
+
# This method expects an iterator which contains
|
|
668
|
+
# 'sqladmin_v1beta4.StreamSqlDataRequest' objects
|
|
669
|
+
# Here we create a generator that yields a single `request` for
|
|
670
|
+
# demonstrative purposes.
|
|
671
|
+
requests = [request]
|
|
672
|
+
|
|
673
|
+
def request_generator():
|
|
674
|
+
for request in requests:
|
|
675
|
+
yield request
|
|
676
|
+
|
|
677
|
+
# Make the request
|
|
678
|
+
stream = client.stream_sql_data(requests=request_generator())
|
|
679
|
+
|
|
680
|
+
# Handle the response
|
|
681
|
+
for response in stream:
|
|
682
|
+
print(response)
|
|
683
|
+
|
|
684
|
+
Args:
|
|
685
|
+
requests (Iterator[google.cloud.sqladmin_v1beta4.types.StreamSqlDataRequest]):
|
|
686
|
+
The request object iterator. Message sent from the client to ``SqlDataService``.
|
|
687
|
+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
|
|
688
|
+
should be retried.
|
|
689
|
+
timeout (float): The timeout for this request.
|
|
690
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
691
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
692
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
693
|
+
be of type `bytes`.
|
|
694
|
+
|
|
695
|
+
Returns:
|
|
696
|
+
Iterable[google.cloud.sqladmin_v1beta4.types.StreamSqlDataResponse]:
|
|
697
|
+
Message sent from SqlDataService back
|
|
698
|
+
to the client.
|
|
699
|
+
|
|
700
|
+
"""
|
|
701
|
+
|
|
702
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
703
|
+
# and friendly error handling.
|
|
704
|
+
rpc = self._transport._wrapped_methods[self._transport.stream_sql_data]
|
|
705
|
+
|
|
706
|
+
# Validate the universe domain.
|
|
707
|
+
self._validate_universe_domain()
|
|
708
|
+
|
|
709
|
+
# Send the request.
|
|
710
|
+
response = rpc(
|
|
711
|
+
requests,
|
|
712
|
+
retry=retry,
|
|
713
|
+
timeout=timeout,
|
|
714
|
+
metadata=metadata,
|
|
715
|
+
)
|
|
716
|
+
|
|
717
|
+
# Done; return the response.
|
|
718
|
+
return response
|
|
719
|
+
|
|
720
|
+
def __enter__(self) -> "SqlDataServiceClient":
|
|
721
|
+
return self
|
|
722
|
+
|
|
723
|
+
def __exit__(self, type, value, traceback):
|
|
724
|
+
"""Releases underlying transport's resources.
|
|
725
|
+
|
|
726
|
+
.. warning::
|
|
727
|
+
ONLY use as a context manager if the transport is NOT shared
|
|
728
|
+
with other clients! Exiting the with block will CLOSE the transport
|
|
729
|
+
and may cause errors in other clients!
|
|
730
|
+
"""
|
|
731
|
+
self.transport.close()
|
|
732
|
+
|
|
733
|
+
|
|
734
|
+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
|
|
735
|
+
gapic_version=package_version.__version__
|
|
736
|
+
)
|
|
737
|
+
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
|
|
738
|
+
|
|
739
|
+
__all__ = ("SqlDataServiceClient",)
|