diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/_meta.json b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/_meta.json index 6311bf2329d4..892d4bb070a0 100644 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/_meta.json +++ b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/_meta.json @@ -1,11 +1,11 @@ { - "commit": "f3245a566562790a4a0229cb53761fd1c4125e33", + "commit": "6199f2d442f6e76c6f11c8adc2934512e75be9ca", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.10.2", "use": [ - "@autorest/python@6.26.4", + "@autorest/python@6.27.4", "@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=/mnt/vss/_work/1/azure-sdk-for-python/sdk --tag=package-flexibleserver-2024-11-01-preview --use=@autorest/python@6.26.4 --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.27.4 --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 b7e3fe9c2713..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/2024-11-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 7ac5820914c2..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/2024-11-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 d1678bb8574d..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/2024-11-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 6424bd6ae624..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/2024-11-01-preview/examples/AdministratorsListByServer.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backup_create.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backup_create.py deleted file mode 100644 index 4887f279a5f6..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backup_create.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_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.backups.begin_create( - resource_group_name="TestGroup", - server_name="postgresqltestserver", - backup_name="backup_20210615T160516", - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/BackupCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backup_delete.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backup_delete.py deleted file mode 100644 index b8ba786ff17f..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/backup_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 backup_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.backups.begin_delete( - resource_group_name="TestGroup", - server_name="testserver", - backup_name="backup_20210615T160516", - ).result() - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/BackupDelete.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 b78397f8b393..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/2024-11-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 b35ebd7cfddd..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/2024-11-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 9731de3b893b..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="eastus", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-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 530f30c10402..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/2024-11-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 70e11988f557..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/2024-11-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 2245f4da8780..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/2024-11-01-preview/examples/CheckNameAvailabilityLocationBased.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/cluster_create.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/cluster_create.py deleted file mode 100644 index 0d4e04f2e2b8..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/cluster_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 cluster_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="pgtestcluster", - parameters={ - "location": "westus", - "properties": { - "administratorLogin": "cloudsa", - "administratorLoginPassword": "password", - "backup": {"backupRetentionDays": 7, "geoRedundantBackup": "Disabled"}, - "cluster": {"clusterSize": 2}, - "createMode": "Create", - "highAvailability": {"mode": "Disabled"}, - "network": {"publicNetworkAccess": "Disabled"}, - "storage": {"autoGrow": "Disabled", "storageSizeGB": 256, "tier": "P15"}, - "version": "16", - }, - "sku": {"name": "Standard_D4s_v3", "tier": "GeneralPurpose"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/ClusterCreate.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 57b2f938d1dc..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/2024-11-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 1652b93157e0..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/2024-11-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 0a96a9f7559d..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/2024-11-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 5b6f15a0b774..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/2024-11-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 dfc39f4c4f2f..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/2024-11-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 79812b9ef041..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/2024-11-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 7b96ebf0392b..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/2024-11-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 88952b7fcc27..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/2024-11-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 5fab4af58db6..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/2024-11-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 d21fb30944d3..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/2024-11-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 6f1f571a58aa..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/2024-11-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 baa03872b764..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/2024-11-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 2f5d959465c6..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/2024-11-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 a42801f73c61..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/2024-11-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 166ce0489bd7..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/2024-11-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 1779f44c43fb..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/2024-11-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 51dd4010ea11..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/2024-11-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 70654ef78112..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/2024-11-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 b935a8bfeb5d..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create.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 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"], - "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/2024-11-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 4796f3f9e3a4..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/2024-11-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 1b8858aaa934..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/2024-11-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_fully_qualified_domain_name.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_fully_qualified_domain_name.py deleted file mode 100644 index b6593b542da9..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/migrations_create_with_fully_qualified_domain_name.py +++ /dev/null @@ -1,58 +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_fully_qualified_domain_name.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", - "overwriteDbsInTarget": "True", - "secretParameters": { - "adminCredentials": {"sourceServerPassword": "xxxxxxxx", "targetServerPassword": "xxxxxxxx"} - }, - "sourceDbServerFullyQualifiedDomainName": "testsourcefqdn.example.com", - "sourceDbServerResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource", - "targetDbServerFullyQualifiedDomainName": "test-target-fqdn.example.com", - }, - }, - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/Migrations_Create_With_FullyQualifiedDomainName.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 7088bee3cfaa..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/2024-11-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 3a8df2f98588..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/2024-11-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 9eab0b4c5706..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/2024-11-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 1db5c9a32b9c..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/2024-11-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 9049f22f7f80..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/2024-11-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 1c65d6da373a..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/2024-11-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 1818d8e6c569..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/2024-11-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 045b4de24942..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/2024-11-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 2fd9062171c0..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/2024-11-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 43cda1e324bd..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/2024-11-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 a5ff29d1b820..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/2024-11-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 64182aaa4145..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/2024-11-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 6654b0f972c3..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/2024-11-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 3ccbd83ce719..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/2024-11-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 755352c487f9..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/2024-11-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 cc23c5f76de1..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/2024-11-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 cf2f7024dceb..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/2024-11-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 28205eb4b91f..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/2024-11-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 2d5eac1eaefa..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/2024-11-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 64a05ec461d2..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/2024-11-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 bd5d0274ef06..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/2024-11-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 0f52ef5f27a5..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/2024-11-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 a153890c7f5d..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/2024-11-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 5e2cb7f6fb1f..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/2024-11-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 23cca080405d..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/2024-11-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 440f85f1ab6c..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": "16", - }, - "sku": {"name": "Standard_D4s_v3", "tier": "GeneralPurpose"}, - "tags": {"ElasticServer": "1"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-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 bd70e264e5aa..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/2024-11-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 d03bc1ec49bb..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/2024-11-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 aefbf7ddc3c3..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/2024-11-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 749fbca2db0f..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/2024-11-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 7fb2252ff103..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/2024-11-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 8d12ee8fb08b..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/2024-11-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 9f596a215e32..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/2024-11-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 811539fe7c09..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/2024-11-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 f60325218c9e..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/2024-11-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 7506d9c3be9a..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/2024-11-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 83833d753d88..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/2024-11-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 e2c9a3a02ddb..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/2024-11-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 2429aae4d018..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/2024-11-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 27bd1fe74032..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/2024-11-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 b4e2e88828b4..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/2024-11-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 47b7453ce791..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/2024-11-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 c3e4db3028ae..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/2024-11-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 88e8850420d1..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/2024-11-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 4f13fb635c5e..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/2024-11-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 660d4f9984f9..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/2024-11-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 467b05f56b76..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/2024-11-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 58bb3acf1da3..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/2024-11-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 7556b8ccdc83..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/2024-11-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 fefad4024138..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/2024-11-01-preview/examples/ServerUpdateWithMajorVersionUpgrade.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_get_filtered_recommended_indexes.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_get_filtered_recommended_indexes.py deleted file mode 100644 index 730f9cb79cd7..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_get_filtered_recommended_indexes.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 tuning_get_filtered_recommended_indexes.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.tuning_options.list_recommendations( - resource_group_name="testrg", - server_name="pgtestrecs", - tuning_option="index", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/Tuning_GetFilteredRecommendedIndexes.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_get_recommended_indexes.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_get_recommended_indexes.py deleted file mode 100644 index cf74a17135fa..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_get_recommended_indexes.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 tuning_get_recommended_indexes.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.tuning_options.list_recommendations( - resource_group_name="testrg", - server_name="pgtestsvc4", - tuning_option="index", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/Tuning_GetRecommendedIndexes.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_get_tuning_option.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_get_tuning_option.py deleted file mode 100644 index f9c44b059f30..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_get_tuning_option.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 tuning_get_tuning_option.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.tuning_options.get( - resource_group_name="testrg", - server_name="testserver", - tuning_option="index", - ) - print(response) - - -# x-ms-original-file: specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/2024-11-01-preview/examples/Tuning_GetTuningOption.json -if __name__ == "__main__": - main() diff --git a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_list_tuning_options.py b/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_list_tuning_options.py deleted file mode 100644 index 1dbcee95b168..000000000000 --- a/sdk/postgresqlflexibleservers/azure-mgmt-postgresqlflexibleservers/generated_samples/tuning_list_tuning_options.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 tuning_list_tuning_options.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.tuning_options.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/2024-11-01-preview/examples/Tuning_ListTuningOptions.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 2a0edce787bd..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/2024-11-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 0bd8d46f467a..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/2024-11-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 66c1efab3712..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/2024-11-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 b622cbdba33b..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/2024-11-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 cb32e8f4c8ef..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/2024-11-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 c9656ca731a9..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/2024-11-01-preview/examples/VirtualNetworkSubnetUsage.json -if __name__ == "__main__": - main()