From e35c3f79d4f43564c1262cc2d439e3e0428fcaec Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 8 Oct 2024 02:35:46 +0000 Subject: [PATCH] CodeGen from PR 30900 in Azure/azure-rest-api-specs Merge 5d2164a053914d0b3792baf975f039cb9ac11667 into 012021c786c360e0c34faf7af888c7fd7dbe2df5 --- .../_meta.json | 4 +- .../generated_samples/administrator_add.py | 50 ------------- .../generated_samples/administrator_delete.py | 42 ----------- .../generated_samples/administrator_get.py | 43 ----------- .../administrators_list_by_server.py | 43 ----------- .../generated_samples/backup_get.py | 43 ----------- .../backup_list_by_server.py | 43 ----------- .../capabilities_by_location.py | 42 ----------- .../check_migration_name_availability.py | 44 ----------- .../check_name_availability.py | 41 ---------- .../check_name_availability_location_based.py | 42 ----------- .../generated_samples/configuration_get.py | 43 ----------- .../configuration_list_by_server.py | 43 ----------- .../generated_samples/configuration_update.py | 45 ----------- .../generated_samples/database_create.py | 44 ----------- .../generated_samples/database_delete.py | 42 ----------- .../generated_samples/database_get.py | 43 ----------- .../databases_list_by_server.py | 43 ----------- .../generated_samples/firewall_rule_create.py | 44 ----------- .../generated_samples/firewall_rule_delete.py | 42 ----------- .../generated_samples/firewall_rule_get.py | 43 ----------- .../firewall_rule_list_by_server.py | 43 ----------- .../get_private_dns_zone_suffix.py | 39 ---------- .../log_files_list_by_server.py | 43 ----------- .../long_term_retention_backup.py | 43 ----------- .../long_term_retention_operation_get.py | 43 ----------- ...term_retention_operation_list_by_server.py | 43 ----------- .../long_term_retention_pre_backup.py | 43 ----------- .../generated_samples/migrations_cancel.py | 45 ----------- .../generated_samples/migrations_create.py | 57 -------------- ...ate_other_source_types_validate_migrate.py | 59 --------------- .../migrations_create_validate_only.py | 57 -------------- .../migrations_create_with_other_users.py | 57 -------------- ...ns_create_with_private_endpoint_servers.py | 57 -------------- .../migrations_create_with_roles.py | 57 -------------- .../generated_samples/migrations_delete.py | 43 ----------- .../generated_samples/migrations_get.py | 44 ----------- ...ith_successful_validation_and_migration.py | 44 ----------- ...essful_validation_but_migration_failure.py | 44 ----------- ...gration_with_successful_validation_only.py | 44 ----------- ..._get_migration_with_validation_failures.py | 44 ----------- .../migrations_list_by_target_server.py | 44 ----------- .../generated_samples/migrations_update.py | 45 ----------- .../generated_samples/operation_list.py | 39 ---------- .../private_endpoint_connection_delete.py | 42 ----------- .../private_endpoint_connection_get.py | 43 ----------- .../private_endpoint_connection_list.py | 43 ----------- .../private_endpoint_connection_update.py | 51 ------------- .../private_link_resources_get.py | 43 ----------- .../private_link_resources_list.py | 43 ----------- ...ote_replica_as_forced_standalone_server.py | 43 ----------- .../promote_replica_as_forced_switchover.py | 43 ----------- ...te_replica_as_planned_standalone_server.py | 43 ----------- .../promote_replica_as_planned_switchover.py | 43 ----------- .../quota_usages_for_flexible_servers.py | 42 ----------- .../replicas_list_by_server.py | 43 ----------- .../generated_samples/server_capabilities.py | 43 ----------- .../generated_samples/server_create.py | 61 --------------- ...eo_restore_with_data_encryption_enabled.py | 64 ---------------- .../server_create_point_in_time_restore.py | 50 ------------- .../server_create_replica.py | 63 ---------------- .../server_create_revive_dropped.py | 50 ------------- .../server_create_with_aad_auth_enabled.py | 67 ----------------- ...ver_create_with_data_encryption_enabled.py | 74 ------------------- .../generated_samples/server_delete.py | 41 ---------- .../generated_samples/server_get.py | 42 ----------- .../server_get_with_private_endpoints.py | 42 ----------- .../generated_samples/server_get_with_vnet.py | 42 ----------- .../generated_samples/server_list.py | 40 ---------- .../server_list_by_resource_group.py | 42 ----------- .../generated_samples/server_restart.py | 41 ---------- .../server_restart_with_failover.py | 41 ---------- .../generated_samples/server_start.py | 41 ---------- .../generated_samples/server_stop.py | 41 ---------- ...at_protection_settings_create_or_update.py | 44 ----------- .../server_threat_protection_settings_get.py | 43 ----------- ...reat_protection_settings_list_by_server.py | 43 ----------- .../generated_samples/server_update.py | 51 ------------- .../server_update_with_aad_auth_enabled.py | 56 -------------- ...update_with_customer_maintenance_window.py | 48 ------------ ...ver_update_with_data_encryption_enabled.py | 64 ---------------- ...erver_update_with_major_version_upgrade.py | 43 ----------- .../virtual_endpoint_create.py | 44 ----------- .../virtual_endpoint_delete.py | 42 ----------- .../virtual_endpoint_update.py | 44 ----------- .../virtual_endpoints_get.py | 43 ----------- .../virtual_endpoints_list_by_server.py | 43 ----------- .../virtual_network_subnet_usage.py | 44 ----------- 88 files changed, 2 insertions(+), 4003 deletions(-) delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrator_add.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrator_delete.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrator_get.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrators_list_by_server.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backup_get.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backup_list_by_server.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/capabilities_by_location.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/check_migration_name_availability.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/check_name_availability.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/check_name_availability_location_based.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configuration_get.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configuration_list_by_server.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configuration_update.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/database_create.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/database_delete.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/database_get.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/databases_list_by_server.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rule_create.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rule_delete.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rule_get.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rule_list_by_server.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/get_private_dns_zone_suffix.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/log_files_list_by_server.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/long_term_retention_backup.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/long_term_retention_operation_get.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/long_term_retention_operation_list_by_server.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/long_term_retention_pre_backup.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_cancel.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_other_source_types_validate_migrate.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_validate_only.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_other_users.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_private_endpoint_servers.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_roles.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_delete.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_and_migration.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_but_migration_failure.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_only.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_validation_failures.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_list_by_target_server.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_update.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/operation_list.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connection_delete.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connection_get.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connection_list.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connection_update.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_link_resources_get.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_link_resources_list.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/promote_replica_as_forced_standalone_server.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/promote_replica_as_forced_switchover.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/promote_replica_as_planned_standalone_server.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/promote_replica_as_planned_switchover.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/quota_usages_for_flexible_servers.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/replicas_list_by_server.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_capabilities.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_geo_restore_with_data_encryption_enabled.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_point_in_time_restore.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_replica.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_revive_dropped.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_with_aad_auth_enabled.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_with_data_encryption_enabled.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_delete.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_get.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_get_with_private_endpoints.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_get_with_vnet.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_list.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_list_by_resource_group.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_restart.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_restart_with_failover.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_start.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_stop.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_threat_protection_settings_create_or_update.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_threat_protection_settings_get.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_threat_protection_settings_list_by_server.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_update.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_update_with_aad_auth_enabled.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_update_with_customer_maintenance_window.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_update_with_data_encryption_enabled.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_update_with_major_version_upgrade.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_create.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_delete.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_update.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoints_get.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoints_list_by_server.py delete mode 100644 sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_network_subnet_usage.py diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/_meta.json b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/_meta.json index 48fd1a2e543c..78b1c70cfe17 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/_meta.json +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/_meta.json @@ -1,11 +1,11 @@ { - "commit": "d85634405ec3b905f1b0bfc350e47cb704aedb61", + "commit": "ef4c07981cd6561126a74518caa50c2f5d8f1028", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.10.2", "use": [ "@autorest/python@6.19.0", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/postgresql/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --tag=package-flexibleserver-2023-12-01-preview --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", + "autorest_command": "autorest specification/postgresql/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", "readme": "specification/postgresql/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrator_add.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrator_add.py deleted file mode 100644 index 348a392fd575..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrator_add.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python administrator_add.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.administrators.begin_create( - resource_group_name="testrg", - server_name="testserver", - object_id="oooooooo-oooo-oooo-oooo-oooooooooooo", - parameters={ - "properties": { - "principalName": "testuser1@microsoft.com", - "principalType": "User", - "tenantId": "tttttttt-tttt-tttt-tttt-tttttttttttt", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/AdministratorAdd.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrator_delete.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrator_delete.py deleted file mode 100644 index 3bebdaa14c1e..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrator_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python administrator_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - client.administrators.begin_delete( - resource_group_name="testrg", - server_name="testserver", - object_id="oooooooo-oooo-oooo-oooo-oooooooooooo", - ).result() - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/AdministratorDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrator_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrator_get.py deleted file mode 100644 index 56ac6154b867..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrator_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python administrator_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.administrators.get( - resource_group_name="testrg", - server_name="pgtestsvc1", - object_id="oooooooo-oooo-oooo-oooo-oooooooooooo", - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/AdministratorGet.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrators_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrators_list_by_server.py deleted file mode 100644 index dacc08008e5a..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/administrators_list_by_server.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python administrators_list_by_server.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.administrators.list_by_server( - resource_group_name="testrg", - server_name="pgtestsvc1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/AdministratorsListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backup_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backup_get.py deleted file mode 100644 index 46eeff175101..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backup_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python backup_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.backups.get( - resource_group_name="TestGroup", - server_name="postgresqltestserver", - backup_name="daily_20210615T160516", - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/BackupGet.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backup_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backup_list_by_server.py deleted file mode 100644 index ae0b20a0e8c7..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backup_list_by_server.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python backup_list_by_server.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.backups.list_by_server( - resource_group_name="TestGroup", - server_name="postgresqltestserver", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/BackupListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/capabilities_by_location.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/capabilities_by_location.py deleted file mode 100644 index d06035ba1802..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/capabilities_by_location.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python capabilities_by_location.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.location_based_capabilities.execute( - location_name="westus", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/CapabilitiesByLocation.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/check_migration_name_availability.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/check_migration_name_availability.py deleted file mode 100644 index 4520d681dbe9..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/check_migration_name_availability.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python check_migration_name_availability.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.check_migration_name_availability( - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - resource_group_name="testrg", - target_db_server_name="testtarget", - parameters={"name": "name1", "type": "Microsoft.DBforPostgreSQL/flexibleServers/migrations"}, - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/CheckMigrationNameAvailability.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/check_name_availability.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/check_name_availability.py deleted file mode 100644 index 43cc32612f1b..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/check_name_availability.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python check_name_availability.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.check_name_availability.execute( - name_availability_request={"name": "name1", "type": "Microsoft.DBforPostgreSQL/flexibleServers"}, - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/CheckNameAvailability.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/check_name_availability_location_based.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/check_name_availability_location_based.py deleted file mode 100644 index c637b931b7ca..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/check_name_availability_location_based.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python check_name_availability_location_based.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.check_name_availability_with_location.execute( - location_name="westus", - name_availability_request={"name": "name1", "type": "Microsoft.DBforPostgreSQL/flexibleServers"}, - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/CheckNameAvailabilityLocationBased.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configuration_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configuration_get.py deleted file mode 100644 index ccc7e4e914a1..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configuration_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python configuration_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.configurations.get( - resource_group_name="testrg", - server_name="testserver", - configuration_name="array_nulls", - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ConfigurationGet.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configuration_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configuration_list_by_server.py deleted file mode 100644 index ab503478d87a..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configuration_list_by_server.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python configuration_list_by_server.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.configurations.list_by_server( - resource_group_name="testrg", - server_name="testserver", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ConfigurationListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configuration_update.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configuration_update.py deleted file mode 100644 index 3bd63841203b..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/configuration_update.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python configuration_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.configurations.begin_put( - resource_group_name="testrg", - server_name="testserver", - configuration_name="event_scheduler", - parameters={"properties": {"source": "user-override", "value": "on"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ConfigurationUpdate.json -if __name__ == "__main__": - main() -() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/database_create.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/database_create.py deleted file mode 100644 index 8b126877bf28..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/database_create.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python database_create.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.databases.begin_create( - resource_group_name="TestGroup", - server_name="testserver", - database_name="db1", - parameters={"properties": {"charset": "utf8", "collation": "en_US.utf8"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/DatabaseCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/database_delete.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/database_delete.py deleted file mode 100644 index 1af3fbe3a488..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/database_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python database_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - client.databases.begin_delete( - resource_group_name="TestGroup", - server_name="testserver", - database_name="db1", - ).result() - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/DatabaseDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/database_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/database_get.py deleted file mode 100644 index c7658079d662..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/database_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python database_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.databases.get( - resource_group_name="TestGroup", - server_name="testserver", - database_name="db1", - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/DatabaseGet.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/databases_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/databases_list_by_server.py deleted file mode 100644 index f6ee2ed08786..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/databases_list_by_server.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python databases_list_by_server.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.databases.list_by_server( - resource_group_name="TestGroup", - server_name="testserver", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/DatabasesListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rule_create.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rule_create.py deleted file mode 100644 index 3be7c250024e..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rule_create.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python firewall_rule_create.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.firewall_rules.begin_create_or_update( - resource_group_name="testrg", - server_name="testserver", - firewall_rule_name="rule1", - parameters={"properties": {"endIpAddress": "255.255.255.255", "startIpAddress": "0.0.0.0"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/FirewallRuleCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rule_delete.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rule_delete.py deleted file mode 100644 index f9d22bee4a9c..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rule_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python firewall_rule_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - client.firewall_rules.begin_delete( - resource_group_name="testrg", - server_name="testserver", - firewall_rule_name="rule1", - ).result() - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/FirewallRuleDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rule_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rule_get.py deleted file mode 100644 index f874961e5e7b..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rule_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python firewall_rule_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.firewall_rules.get( - resource_group_name="testrg", - server_name="testserver", - firewall_rule_name="rule1", - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/FirewallRuleGet.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rule_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rule_list_by_server.py deleted file mode 100644 index a014fdf895db..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/firewall_rule_list_by_server.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python firewall_rule_list_by_server.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.firewall_rules.list_by_server( - resource_group_name="testrg", - server_name="testserver", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/FirewallRuleListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/get_private_dns_zone_suffix.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/get_private_dns_zone_suffix.py deleted file mode 100644 index 63c378aaed05..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/get_private_dns_zone_suffix.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python get_private_dns_zone_suffix.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.get_private_dns_zone_suffix.execute() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/GetPrivateDnsZoneSuffix.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/log_files_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/log_files_list_by_server.py deleted file mode 100644 index 5fc14946c70d..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/log_files_list_by_server.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python log_files_list_by_server.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.log_files.list_by_server( - resource_group_name="testrg", - server_name="postgresqltestsvc1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/LogFilesListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/long_term_retention_backup.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/long_term_retention_backup.py deleted file mode 100644 index 7de66e2e5f12..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/long_term_retention_backup.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python long_term_retention_backup.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.flexible_server.begin_start_ltr_backup( - resource_group_name="rgLongTermRetention", - server_name="pgsqlltrtestserver", - parameters={"backupSettings": {"backupName": "backup1"}, "targetDetails": {"sasUriList": ["sasuri"]}}, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/LongTermRetentionBackup.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/long_term_retention_operation_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/long_term_retention_operation_get.py deleted file mode 100644 index 95e10c61f55c..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/long_term_retention_operation_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python long_term_retention_operation_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.ltr_backup_operations.get( - resource_group_name="rgLongTermRetention", - server_name="pgsqlltrtestserver", - backup_name="backup1", - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/LongTermRetentionOperationGet.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/long_term_retention_operation_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/long_term_retention_operation_list_by_server.py deleted file mode 100644 index 2192fe0eee21..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/long_term_retention_operation_list_by_server.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python long_term_retention_operation_list_by_server.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.ltr_backup_operations.list_by_server( - resource_group_name="rgLongTermRetention", - server_name="pgsqlltrtestserver", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/LongTermRetentionOperationListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/long_term_retention_pre_backup.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/long_term_retention_pre_backup.py deleted file mode 100644 index 1a40ee9b990d..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/long_term_retention_pre_backup.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python long_term_retention_pre_backup.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.flexible_server.trigger_ltr_pre_backup( - resource_group_name="rgLongTermRetention", - server_name="pgsqlltrtestserver", - parameters={"backupSettings": {"backupName": "backup1"}}, - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/LongTermRetentionPreBackup.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_cancel.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_cancel.py deleted file mode 100644 index 20aaa6149f7c..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_cancel.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python migrations_cancel.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.migrations.update( - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - resource_group_name="testrg", - target_db_server_name="testtarget", - migration_name="testmigration", - parameters={"properties": {"cancel": "True"}}, - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Cancel.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create.py deleted file mode 100644 index a9c27243c8cf..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python migrations_create.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.migrations.create( - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - resource_group_name="testrg", - target_db_server_name="testtarget", - migration_name="testmigration", - parameters={ - "location": "westus", - "properties": { - "dbsToMigrate": ["db1", "db2", "db3", "db4"], - "migrationInstanceResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testsourcemigration", - "migrationMode": "Offline", - "overwriteDbsInTarget": "True", - "secretParameters": { - "adminCredentials": {"sourceServerPassword": "xxxxxxxx", "targetServerPassword": "xxxxxxxx"} - }, - "sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource", - }, - }, - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_other_source_types_validate_migrate.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_other_source_types_validate_migrate.py deleted file mode 100644 index 5ef0489ef679..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_other_source_types_validate_migrate.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python migrations_create_other_source_types_validate_migrate.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.migrations.create( - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - resource_group_name="testrg", - target_db_server_name="testtarget", - migration_name="testmigration", - parameters={ - "location": "westus", - "properties": { - "dbsToMigrate": ["db1", "db2", "db3", "db4"], - "migrationMode": "Offline", - "migrationOption": "ValidateAndMigrate", - "overwriteDbsInTarget": "True", - "secretParameters": { - "adminCredentials": {"sourceServerPassword": "xxxxxxxx", "targetServerPassword": "xxxxxxxx"} - }, - "sourceDbServerResourceId": "testsource:5432@pguser", - "sourceType": "OnPremises", - "sslMode": "Prefer", - }, - }, - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create_Other_SourceTypes_Validate_Migrate.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_validate_only.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_validate_only.py deleted file mode 100644 index 528d21a1394e..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_validate_only.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python migrations_create_validate_only.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.migrations.create( - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - resource_group_name="testrg", - target_db_server_name="testtarget", - migration_name="testmigration", - parameters={ - "location": "westus", - "properties": { - "dbsToMigrate": ["db1", "db2", "db3", "db4"], - "migrationMode": "Offline", - "migrationOption": "Validate", - "overwriteDbsInTarget": "True", - "secretParameters": { - "adminCredentials": {"sourceServerPassword": "xxxxxxxx", "targetServerPassword": "xxxxxxxx"} - }, - "sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource", - }, - }, - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create_Validate_Only.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_other_users.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_other_users.py deleted file mode 100644 index 780591a8fc1f..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_other_users.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python migrations_create_with_other_users.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.migrations.create( - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - resource_group_name="testrg", - target_db_server_name="testtarget", - migration_name="testmigration", - parameters={ - "location": "westus", - "properties": { - "dbsToMigrate": ["db1", "db2", "db3", "db4"], - "migrationMode": "Offline", - "secretParameters": { - "adminCredentials": {"sourceServerPassword": "xxxxxxxx", "targetServerPassword": "xxxxxxxx"}, - "sourceServerUsername": "newadmin@testsource", - "targetServerUsername": "targetadmin", - }, - "sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource", - }, - }, - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create_With_Other_Users.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_private_endpoint_servers.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_private_endpoint_servers.py deleted file mode 100644 index e65699ab1c7d..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_private_endpoint_servers.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python migrations_create_with_private_endpoint_servers.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.migrations.create( - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - resource_group_name="testrg", - target_db_server_name="testtarget", - migration_name="testmigration", - parameters={ - "location": "westus", - "properties": { - "dbsToMigrate": ["db1", "db2", "db3", "db4"], - "migrationInstanceResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/flexibleServers/testsourcemigration", - "migrationMode": "Offline", - "overwriteDbsInTarget": "True", - "secretParameters": { - "adminCredentials": {"sourceServerPassword": "xxxxxxxx", "targetServerPassword": "xxxxxxxx"} - }, - "sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource", - }, - }, - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create_With_PrivateEndpoint_Servers.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_roles.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_roles.py deleted file mode 100644 index 7a5e27ba4c29..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_roles.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python migrations_create_with_roles.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.migrations.create( - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - resource_group_name="testrg", - target_db_server_name="testtarget", - migration_name="testmigration", - parameters={ - "location": "westus", - "properties": { - "dbsToMigrate": ["db1", "db2", "db3", "db4"], - "migrateRoles": "True", - "migrationMode": "Offline", - "overwriteDbsInTarget": "True", - "secretParameters": { - "adminCredentials": {"sourceServerPassword": "xxxxxxxx", "targetServerPassword": "xxxxxxxx"} - }, - "sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource", - }, - }, - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Create_With_Roles.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_delete.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_delete.py deleted file mode 100644 index 892643f1f966..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_delete.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python migrations_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - client.migrations.delete( - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - resource_group_name="testrg", - target_db_server_name="testtarget", - migration_name="testmigration", - ) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get.py deleted file mode 100644 index d7679dcb3fff..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python migrations_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.migrations.get( - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - resource_group_name="testrg", - target_db_server_name="testtarget", - migration_name="testmigration", - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_and_migration.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_and_migration.py deleted file mode 100644 index 71198fd2b145..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_and_migration.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python migrations_get_migration_with_successful_validation_and_migration.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.migrations.get( - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - resource_group_name="testrg", - target_db_server_name="testtarget", - migration_name="testmigrationwithsuccessfulvalidationandmigration", - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationAndMigration.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_but_migration_failure.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_but_migration_failure.py deleted file mode 100644 index 915ef47d10d2..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_but_migration_failure.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python migrations_get_migration_with_successful_validation_but_migration_failure.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.migrations.get( - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - resource_group_name="testrg", - target_db_server_name="testtarget", - migration_name="testmigrationwithsuccessfulvalidationbutmigrationfailure", - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationButMigrationFailure.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_only.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_only.py deleted file mode 100644 index 52a711477420..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_successful_validation_only.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python migrations_get_migration_with_successful_validation_only.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.migrations.get( - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - resource_group_name="testrg", - target_db_server_name="testtarget", - migration_name="testmigrationwithsuccessfulvalidationonly", - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_GetMigrationWithSuccessfulValidationOnly.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_validation_failures.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_validation_failures.py deleted file mode 100644 index c055f621b973..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_get_migration_with_validation_failures.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python migrations_get_migration_with_validation_failures.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.migrations.get( - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - resource_group_name="testrg", - target_db_server_name="testtarget", - migration_name="testmigrationwithvalidationfailure", - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_GetMigrationWithValidationFailures.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_list_by_target_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_list_by_target_server.py deleted file mode 100644 index 4df72e1d5825..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_list_by_target_server.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python migrations_list_by_target_server.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.migrations.list_by_target_server( - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - resource_group_name="testrg", - target_db_server_name="testtarget", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_ListByTargetServer.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_update.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_update.py deleted file mode 100644 index deca519eb8a1..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_update.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python migrations_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.migrations.update( - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - resource_group_name="testrg", - target_db_server_name="testtarget", - migration_name="testmigration", - parameters={"properties": {"setupLogicalReplicationOnSourceDbIfNeeded": "True"}}, - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/Migrations_Update.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/operation_list.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/operation_list.py deleted file mode 100644 index 0baefc3e6bcd..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/operation_list.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python operation_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.operations.list() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/OperationList.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connection_delete.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connection_delete.py deleted file mode 100644 index 83453fee0320..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connection_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python private_endpoint_connection_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - client.private_endpoint_connection.begin_delete( - resource_group_name="Default", - server_name="test-svr", - private_endpoint_connection_name="private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", - ).result() - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PrivateEndpointConnectionDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connection_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connection_get.py deleted file mode 100644 index fa68594420d8..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connection_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python private_endpoint_connection_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.private_endpoint_connections.get( - resource_group_name="Default", - server_name="test-svr", - private_endpoint_connection_name="private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PrivateEndpointConnectionGet.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connection_list.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connection_list.py deleted file mode 100644 index 53bb934edc1a..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connection_list.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python private_endpoint_connection_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.private_endpoint_connections.list_by_server( - resource_group_name="Default", - server_name="test-svr", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PrivateEndpointConnectionList.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connection_update.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connection_update.py deleted file mode 100644 index ea9930682c9d..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_endpoint_connection_update.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python private_endpoint_connection_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.private_endpoint_connection.begin_update( - resource_group_name="Default", - server_name="test-svr", - private_endpoint_connection_name="private-endpoint-connection-name.1fa229cd-bf3f-47f0-8c49-afb36723997e", - parameters={ - "properties": { - "privateLinkServiceConnectionState": { - "description": "Approved by johndoe@contoso.com", - "status": "Approved", - } - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PrivateEndpointConnectionUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_link_resources_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_link_resources_get.py deleted file mode 100644 index 7bb60d80d554..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_link_resources_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python private_link_resources_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.private_link_resources.get( - resource_group_name="Default", - server_name="test-svr", - group_name="plr", - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PrivateLinkResourcesGet.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_link_resources_list.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_link_resources_list.py deleted file mode 100644 index 094e49c1945f..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/private_link_resources_list.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python private_link_resources_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.private_link_resources.list_by_server( - resource_group_name="Default", - server_name="test-svr", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PrivateLinkResourcesList.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/promote_replica_as_forced_standalone_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/promote_replica_as_forced_standalone_server.py deleted file mode 100644 index 50c38f75a73b..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/promote_replica_as_forced_standalone_server.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python promote_replica_as_forced_standalone_server.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.servers.begin_update( - resource_group_name="testResourceGroup", - server_name="pgtestsvc4-replica", - parameters={"properties": {"replica": {"promoteMode": "standalone", "promoteOption": "forced"}}}, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PromoteReplicaAsForcedStandaloneServer.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/promote_replica_as_forced_switchover.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/promote_replica_as_forced_switchover.py deleted file mode 100644 index b90e4cc1551f..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/promote_replica_as_forced_switchover.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python promote_replica_as_forced_switchover.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.servers.begin_update( - resource_group_name="testResourceGroup", - server_name="pgtestsvc4-replica", - parameters={"properties": {"replica": {"promoteMode": "switchover", "promoteOption": "forced"}}}, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PromoteReplicaAsForcedSwitchover.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/promote_replica_as_planned_standalone_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/promote_replica_as_planned_standalone_server.py deleted file mode 100644 index df677edb4bad..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/promote_replica_as_planned_standalone_server.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python promote_replica_as_planned_standalone_server.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.servers.begin_update( - resource_group_name="testResourceGroup", - server_name="pgtestsvc4-replica", - parameters={"properties": {"replica": {"promoteMode": "standalone", "promoteOption": "planned"}}}, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PromoteReplicaAsPlannedStandaloneServer.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/promote_replica_as_planned_switchover.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/promote_replica_as_planned_switchover.py deleted file mode 100644 index 1900115c7954..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/promote_replica_as_planned_switchover.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python promote_replica_as_planned_switchover.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.servers.begin_update( - resource_group_name="testResourceGroup", - server_name="pgtestsvc4-replica", - parameters={"properties": {"replica": {"promoteMode": "switchover", "promoteOption": "planned"}}}, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/PromoteReplicaAsPlannedSwitchover.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/quota_usages_for_flexible_servers.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/quota_usages_for_flexible_servers.py deleted file mode 100644 index 41fa0977b2e1..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/quota_usages_for_flexible_servers.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python quota_usages_for_flexible_servers.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.quota_usages.list( - location_name="westus", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/QuotaUsagesForFlexibleServers.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/replicas_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/replicas_list_by_server.py deleted file mode 100644 index e31f8cbd0a12..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/replicas_list_by_server.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python replicas_list_by_server.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.replicas.list_by_server( - resource_group_name="testrg", - server_name="sourcepgservername", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ReplicasListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_capabilities.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_capabilities.py deleted file mode 100644 index dd671a3068d2..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_capabilities.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_capabilities.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.server_capabilities.list( - resource_group_name="testrg", - server_name="pgtestsvc4", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCapabilities.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create.py deleted file mode 100644 index 5faf9e2df937..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_create.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.servers.begin_create( - resource_group_name="testrg", - server_name="pgtestsvc4", - parameters={ - "location": "westus", - "properties": { - "administratorLogin": "cloudsa", - "administratorLoginPassword": "password", - "availabilityZone": "1", - "backup": {"backupRetentionDays": 7, "geoRedundantBackup": "Disabled"}, - "createMode": "Create", - "highAvailability": {"mode": "ZoneRedundant"}, - "network": { - "delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet", - "privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com", - }, - "storage": {"autoGrow": "Disabled", "storageSizeGB": 512, "tier": "P20"}, - "version": "12", - }, - "sku": {"name": "Standard_D4s_v3", "tier": "GeneralPurpose"}, - "tags": {"ElasticServer": "1"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_geo_restore_with_data_encryption_enabled.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_geo_restore_with_data_encryption_enabled.py deleted file mode 100644 index 27faf04b8070..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_geo_restore_with_data_encryption_enabled.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_create_geo_restore_with_data_encryption_enabled.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.servers.begin_create( - resource_group_name="testrg", - server_name="pgtestsvc5geo", - parameters={ - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity": {}, - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {}, - }, - }, - "location": "eastus", - "properties": { - "createMode": "GeoRestore", - "dataEncryption": { - "geoBackupKeyURI": "https://test-geo-kv.vault.azure.net/keys/test-key1/66f57315bab34b0189daa113fbc78787", - "geoBackupUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity", - "primaryKeyURI": "https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787", - "primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", - "type": "AzureKeyVault", - }, - "pointInTimeUTC": "2021-06-27T00:04:59.4078005+00:00", - "sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername", - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreateGeoRestoreWithDataEncryptionEnabled.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_point_in_time_restore.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_point_in_time_restore.py deleted file mode 100644 index 2c573c140c89..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_point_in_time_restore.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_create_point_in_time_restore.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.servers.begin_create( - resource_group_name="testrg", - server_name="pgtestsvc5", - parameters={ - "location": "westus", - "properties": { - "createMode": "PointInTimeRestore", - "pointInTimeUTC": "2021-06-27T00:04:59.4078005+00:00", - "sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername", - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreatePointInTimeRestore.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_replica.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_replica.py deleted file mode 100644 index 416ece1df084..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_replica.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_create_replica.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.servers.begin_create( - resource_group_name="testrg", - server_name="pgtestsvc5rep", - parameters={ - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {} - }, - }, - "location": "westus", - "properties": { - "createMode": "Replica", - "dataEncryption": { - "geoBackupKeyURI": "", - "geoBackupUserAssignedIdentityId": "", - "primaryKeyURI": "https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787", - "primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", - "type": "AzureKeyVault", - }, - "pointInTimeUTC": "2021-06-27T00:04:59.4078005+00:00", - "sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/sourcepgservername", - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreateReplica.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_revive_dropped.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_revive_dropped.py deleted file mode 100644 index 04c6afdf6ac2..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_revive_dropped.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_create_revive_dropped.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.servers.begin_create( - resource_group_name="testrg", - server_name="pgtestsvc5-rev", - parameters={ - "location": "westus", - "properties": { - "createMode": "ReviveDropped", - "pointInTimeUTC": "2023-04-27T00:04:59.4078005+00:00", - "sourceServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/pgtestsvc5", - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreateReviveDropped.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_with_aad_auth_enabled.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_with_aad_auth_enabled.py deleted file mode 100644 index 16419edfaf41..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_with_aad_auth_enabled.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_create_with_aad_auth_enabled.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.servers.begin_create( - resource_group_name="testrg", - server_name="pgtestsvc4", - parameters={ - "location": "westus", - "properties": { - "administratorLogin": "cloudsa", - "administratorLoginPassword": "password", - "authConfig": { - "activeDirectoryAuth": "Enabled", - "passwordAuth": "Enabled", - "tenantId": "tttttt-tttt-tttt-tttt-tttttttttttt", - }, - "availabilityZone": "1", - "backup": {"backupRetentionDays": 7, "geoRedundantBackup": "Disabled"}, - "createMode": "Create", - "dataEncryption": {"type": "SystemManaged"}, - "highAvailability": {"mode": "ZoneRedundant"}, - "network": { - "delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet", - "privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com", - }, - "storage": {"autoGrow": "Disabled", "storageSizeGB": 512, "tier": "P20"}, - "version": "12", - }, - "sku": {"name": "Standard_D4s_v3", "tier": "GeneralPurpose"}, - "tags": {"ElasticServer": "1"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreateWithAadAuthEnabled.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_with_data_encryption_enabled.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_with_data_encryption_enabled.py deleted file mode 100644 index 1124d3629d42..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_create_with_data_encryption_enabled.py +++ /dev/null @@ -1,74 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_create_with_data_encryption_enabled.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.servers.begin_create( - resource_group_name="testrg", - server_name="pgtestsvc4", - parameters={ - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {} - }, - }, - "location": "westus", - "properties": { - "administratorLogin": "cloudsa", - "administratorLoginPassword": "password", - "availabilityZone": "1", - "backup": {"backupRetentionDays": 7, "geoRedundantBackup": "Disabled"}, - "createMode": "Create", - "dataEncryption": { - "geoBackupKeyURI": "", - "geoBackupUserAssignedIdentityId": "", - "primaryKeyURI": "https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787", - "primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", - "type": "AzureKeyVault", - }, - "highAvailability": {"mode": "ZoneRedundant"}, - "network": { - "delegatedSubnetResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/test-vnet-subnet", - "privateDnsZoneArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourcegroups/testrg/providers/Microsoft.Network/privateDnsZones/test-private-dns-zone.postgres.database.azure.com", - }, - "storage": {"autoGrow": "Disabled", "storageSizeGB": 512}, - "version": "12", - }, - "sku": {"name": "Standard_D4s_v3", "tier": "GeneralPurpose"}, - "tags": {"ElasticServer": "1"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerCreateWithDataEncryptionEnabled.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_delete.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_delete.py deleted file mode 100644 index edef98b9941a..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_delete.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - client.servers.begin_delete( - resource_group_name="testrg", - server_name="testserver", - ).result() - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_get.py deleted file mode 100644 index 1de2c0be6d85..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_get.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.servers.get( - resource_group_name="testrg", - server_name="pgtestsvc1", - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerGet.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_get_with_private_endpoints.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_get_with_private_endpoints.py deleted file mode 100644 index 13b7ea41f8aa..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_get_with_private_endpoints.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_get_with_private_endpoints.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.servers.get( - resource_group_name="testrg", - server_name="pgtestsvc2", - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerGetWithPrivateEndpoints.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_get_with_vnet.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_get_with_vnet.py deleted file mode 100644 index 977171db13ad..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_get_with_vnet.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_get_with_vnet.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.servers.get( - resource_group_name="testrg", - server_name="pgtestsvc4", - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerGetWithVnet.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_list.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_list.py deleted file mode 100644 index da96cc874101..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_list.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.servers.list() - for item in response: - print(item) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerList.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_list_by_resource_group.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_list_by_resource_group.py deleted file mode 100644 index 3f71e2b8d723..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_list_by_resource_group.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_list_by_resource_group.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.servers.list_by_resource_group( - resource_group_name="testrg", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerListByResourceGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_restart.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_restart.py deleted file mode 100644 index 41da133a0212..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_restart.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_restart.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - client.servers.begin_restart( - resource_group_name="testrg", - server_name="testserver", - ).result() - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerRestart.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_restart_with_failover.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_restart_with_failover.py deleted file mode 100644 index b94dc2b8c263..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_restart_with_failover.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_restart_with_failover.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - client.servers.begin_restart( - resource_group_name="testrg", - server_name="testserver", - ).result() - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerRestartWithFailover.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_start.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_start.py deleted file mode 100644 index 5fb912645611..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_start.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_start.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - client.servers.begin_start( - resource_group_name="testrg", - server_name="testserver", - ).result() - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerStart.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_stop.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_stop.py deleted file mode 100644 index b60afcd4ca36..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_stop.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_stop.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - client.servers.begin_stop( - resource_group_name="testrg", - server_name="testserver", - ).result() - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerStop.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_threat_protection_settings_create_or_update.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_threat_protection_settings_create_or_update.py deleted file mode 100644 index f804575a7011..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_threat_protection_settings_create_or_update.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_threat_protection_settings_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_threat_protection_settings.begin_create_or_update( - resource_group_name="threatprotection-4799", - server_name="threatprotection-6440", - threat_protection_name="Default", - parameters={"properties": {"state": "Enabled"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerThreatProtectionSettingsCreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_threat_protection_settings_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_threat_protection_settings_get.py deleted file mode 100644 index ebb1f25c99c1..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_threat_protection_settings_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_threat_protection_settings_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_threat_protection_settings.get( - resource_group_name="threatprotection-6852", - server_name="threatprotection-2080", - threat_protection_name="Default", - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerThreatProtectionSettingsGet.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_threat_protection_settings_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_threat_protection_settings_list_by_server.py deleted file mode 100644 index 8bf116a67c7d..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_threat_protection_settings_list_by_server.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_threat_protection_settings_list_by_server.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.server_threat_protection_settings.list_by_server( - resource_group_name="threatprotection-6852", - server_name="threatprotection-2080", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerThreatProtectionSettingsListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_update.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_update.py deleted file mode 100644 index 8307d793be17..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_update.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.servers.begin_update( - resource_group_name="TestGroup", - server_name="pgtestsvc4", - parameters={ - "properties": { - "administratorLoginPassword": "newpassword", - "backup": {"backupRetentionDays": 20}, - "createMode": "Update", - "storage": {"autoGrow": "Enabled", "storageSizeGB": 1024, "tier": "P30"}, - }, - "sku": {"name": "Standard_D8s_v3", "tier": "GeneralPurpose"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_update_with_aad_auth_enabled.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_update_with_aad_auth_enabled.py deleted file mode 100644 index 5b8de744dc99..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_update_with_aad_auth_enabled.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_update_with_aad_auth_enabled.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.servers.begin_update( - resource_group_name="TestGroup", - server_name="pgtestsvc4", - parameters={ - "properties": { - "administratorLoginPassword": "newpassword", - "authConfig": { - "activeDirectoryAuth": "Enabled", - "passwordAuth": "Enabled", - "tenantId": "tttttt-tttt-tttt-tttt-tttttttttttt", - }, - "backup": {"backupRetentionDays": 20}, - "createMode": "Update", - "storage": {"autoGrow": "Disabled", "storageSizeGB": 1024, "tier": "P30"}, - }, - "sku": {"name": "Standard_D8s_v3", "tier": "GeneralPurpose"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerUpdateWithAadAuthEnabled.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_update_with_customer_maintenance_window.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_update_with_customer_maintenance_window.py deleted file mode 100644 index d86eb5df8e4a..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_update_with_customer_maintenance_window.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_update_with_customer_maintenance_window.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.servers.begin_update( - resource_group_name="testrg", - server_name="pgtestsvc4", - parameters={ - "properties": { - "createMode": "Update", - "maintenanceWindow": {"customWindow": "Enabled", "dayOfWeek": 0, "startHour": 8, "startMinute": 0}, - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerUpdateWithCustomerMaintenanceWindow.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_update_with_data_encryption_enabled.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_update_with_data_encryption_enabled.py deleted file mode 100644 index 6903d0be0423..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_update_with_data_encryption_enabled.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_update_with_data_encryption_enabled.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.servers.begin_update( - resource_group_name="TestGroup", - server_name="pgtestsvc4", - parameters={ - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity": {}, - "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity": {}, - }, - }, - "properties": { - "administratorLoginPassword": "newpassword", - "backup": {"backupRetentionDays": 20}, - "createMode": "Update", - "dataEncryption": { - "geoBackupKeyURI": "https://test-geo-kv.vault.azure.net/keys/test-key1/66f57315bab34b0189daa113fbc78787", - "geoBackupUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity", - "primaryKeyURI": "https://test-kv.vault.azure.net/keys/test-key1/77f57315bab34b0189daa113fbc78787", - "primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity", - "type": "AzureKeyVault", - }, - }, - "sku": {"name": "Standard_D8s_v3", "tier": "GeneralPurpose"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerUpdateWithDataEncryptionEnabled.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_update_with_major_version_upgrade.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_update_with_major_version_upgrade.py deleted file mode 100644 index 3e3a751550f9..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/server_update_with_major_version_upgrade.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python server_update_with_major_version_upgrade.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.servers.begin_update( - resource_group_name="testrg", - server_name="pgtestsvc4", - parameters={"properties": {"createMode": "Update", "version": "14"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/ServerUpdateWithMajorVersionUpgrade.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_create.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_create.py deleted file mode 100644 index 3dab5333aa39..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_create.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python virtual_endpoint_create.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.virtual_endpoints.begin_create( - resource_group_name="testrg", - server_name="pgtestsvc4", - virtual_endpoint_name="pgVirtualEndpoint1", - parameters={"properties": {"endpointType": "ReadWrite", "members": ["testPrimary1"]}}, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualEndpointCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_delete.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_delete.py deleted file mode 100644 index a3f7d9fcdbde..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python virtual_endpoint_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - client.virtual_endpoints.begin_delete( - resource_group_name="testrg", - server_name="pgtestsvc4", - virtual_endpoint_name="pgVirtualEndpoint1", - ).result() - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualEndpointDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_update.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_update.py deleted file mode 100644 index f839bb569830..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoint_update.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python virtual_endpoint_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.virtual_endpoints.begin_update( - resource_group_name="testrg", - server_name="pgtestsvc4", - virtual_endpoint_name="pgVirtualEndpoint1", - parameters={"properties": {"endpointType": "ReadWrite", "members": ["testReplica1"]}}, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualEndpointUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoints_get.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoints_get.py deleted file mode 100644 index 3ba5638220ce..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoints_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python virtual_endpoints_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.virtual_endpoints.get( - resource_group_name="testrg", - server_name="pgtestsvc4", - virtual_endpoint_name="pgVirtualEndpoint1", - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualEndpointsGet.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoints_list_by_server.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoints_list_by_server.py deleted file mode 100644 index 5498208e5134..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_endpoints_list_by_server.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python virtual_endpoints_list_by_server.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.virtual_endpoints.list_by_server( - resource_group_name="testrg", - server_name="pgtestsvc4", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualEndpointsListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_network_subnet_usage.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_network_subnet_usage.py deleted file mode 100644 index 094d96121fa3..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/virtual_network_subnet_usage.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.postgresqlflexibleservers import PostgreSQLManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-postgresqlflexibleservers -# USAGE - python virtual_network_subnet_usage.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = PostgreSQLManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.virtual_network_subnet_usage.execute( - location_name="westus", - parameters={ - "virtualNetworkArmResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/testvnet" - }, - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-12-01-preview/examples/VirtualNetworkSubnetUsage.json -if __name__ == "__main__": - main()