From ad18a808b54e309cb3f5e47d51b242a83deeda47 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 6 Feb 2018 19:39:48 +0000 Subject: [PATCH 1/7] Generated from e072add9cc736005f96f74ac2625652134849205 Correct create properties parameter --- .../azure/mgmt/rdbms/mysql/build.json | 183 ------ .../azure/mgmt/rdbms/mysql/models/__init__.py | 6 - .../models/my_sql_management_client_enums.py | 9 - .../rdbms/mysql/models/name_availability.py | 1 + .../mysql/models/name_availability_request.py | 1 + .../mgmt/rdbms/mysql/models/operation.py | 1 + .../rdbms/mysql/models/operation_display.py | 1 + .../mysql/models/operation_list_result.py | 1 + .../models/performance_tier_properties.py | 1 + ...rformance_tier_service_level_objectives.py | 1 + .../mgmt/rdbms/mysql/models/proxy_resource.py | 1 + .../rdbms/mysql/models/server_for_create.py | 1 + .../models/server_properties_for_create.py | 1 + .../mysql/models/server_update_parameters.py | 1 + .../azure/mgmt/rdbms/mysql/models/sku.py | 1 + .../mysql/models/virtual_network_rule.py | 60 -- .../rdbms/mysql/my_sql_management_client.py | 9 +- .../mgmt/rdbms/mysql/operations/__init__.py | 2 - .../check_name_availability_operations.py | 4 +- .../operations/configurations_operations.py | 112 ++-- .../mysql/operations/databases_operations.py | 195 +++--- .../operations/firewall_rules_operations.py | 199 +++--- ...ation_based_performance_tier_operations.py | 4 +- .../mysql/operations/log_files_operations.py | 4 +- .../mgmt/rdbms/mysql/operations/operations.py | 4 +- .../performance_tiers_operations.py | 4 +- .../mysql/operations/servers_operations.py | 285 +++++---- .../azure/mgmt/rdbms/mysql/version.py | 2 +- .../azure/mgmt/rdbms/postgres/__init__.py | 18 + .../mgmt/rdbms/postgres/models/__init__.py | 78 +++ .../rdbms/postgres/models/configuration.py | 70 +++ .../models/configuration_paged.py} | 8 +- .../mgmt/rdbms/postgres/models/database.py | 50 ++ .../rdbms/postgres/models/database_paged.py | 27 + .../rdbms/postgres/models/firewall_rule.py | 54 ++ .../postgres/models/firewall_rule_paged.py | 27 + .../mgmt/rdbms/postgres/models/log_file.py | 66 ++ .../rdbms/postgres/models/log_file_paged.py | 27 + .../postgres/models/name_availability.py | 36 ++ .../models/name_availability_request.py | 36 ++ .../mgmt/rdbms/postgres/models/operation.py | 53 ++ .../postgres/models/operation_display.py | 50 ++ .../postgres/models/operation_list_result.py | 28 + .../models/performance_tier_properties.py | 39 ++ .../performance_tier_properties_paged.py | 27 + ...rformance_tier_service_level_objectives.py | 42 ++ .../postgre_sql_management_client_enums.py | 44 ++ .../rdbms/postgres/models/proxy_resource.py | 45 ++ .../mgmt/rdbms/postgres/models/server.py | 85 +++ .../postgres/models/server_for_create.py | 46 ++ .../rdbms/postgres/models/server_paged.py | 27 + .../models/server_properties_for_create.py | 55 ++ .../server_properties_for_default_create.py | 57 ++ .../models/server_properties_for_restore.py | 55 ++ .../models/server_update_parameters.py | 56 ++ .../azure/mgmt/rdbms/postgres/models/sku.py | 51 ++ .../rdbms/postgres/models/tracked_resource.py | 51 ++ .../rdbms/postgres/operations/__init__.py | 32 + .../check_name_availability_operations.py | 103 ++++ .../operations/configurations_operations.py | 306 +++++++++ .../operations/databases_operations.py} | 290 +++++---- .../operations/firewall_rules_operations.py | 414 +++++++++++++ ...ation_based_performance_tier_operations.py | 106 ++++ .../operations/log_files_operations.py | 110 ++++ .../rdbms/postgres/operations/operations.py | 89 +++ .../performance_tiers_operations.py | 102 +++ .../postgres/operations/servers_operations.py | 579 ++++++++++++++++++ .../postgres/postgre_sql_management_client.py | 123 ++++ .../azure/mgmt/rdbms/postgres/version.py | 13 + 69 files changed, 3987 insertions(+), 682 deletions(-) delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/build.json delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/virtual_network_rule.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/__init__.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/__init__.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/configuration.py rename azure-mgmt-rdbms/azure/mgmt/rdbms/{mysql/models/virtual_network_rule_paged.py => postgres/models/configuration_paged.py} (67%) create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/database.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/database_paged.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/firewall_rule.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/firewall_rule_paged.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/log_file.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/log_file_paged.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/name_availability.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/name_availability_request.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation_display.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation_list_result.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_properties.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_properties_paged.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_service_level_objectives.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/postgre_sql_management_client_enums.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/proxy_resource.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_for_create.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_paged.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_create.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_default_create.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_restore.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_update_parameters.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/sku.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/tracked_resource.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/__init__.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/check_name_availability_operations.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/configurations_operations.py rename azure-mgmt-rdbms/azure/mgmt/rdbms/{mysql/operations/virtual_network_rules_operations.py => postgres/operations/databases_operations.py} (68%) create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/firewall_rules_operations.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/location_based_performance_tier_operations.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/log_files_operations.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/operations.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/performance_tiers_operations.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/servers_operations.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/postgre_sql_management_client.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/version.py diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/build.json b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/build.json deleted file mode 100644 index 7876f4a3ab8d..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/build.json +++ /dev/null @@ -1,183 +0,0 @@ -{ - "autorest": [ - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest-core", - "version": "2.0.4168", - "engines": { - "node": ">=7.10.0" - }, - "dependencies": {}, - "optionalDependencies": {}, - "devDependencies": { - "@microsoft.azure/async-io": "~1.0.22", - "@microsoft.azure/extension": "~1.2.12", - "@types/commonmark": "^0.27.0", - "@types/jsonpath": "^0.1.29", - "@types/node": "^8.0.28", - "@types/pify": "0.0.28", - "@types/source-map": "^0.5.0", - "@types/yargs": "^8.0.2", - "commonmark": "^0.27.0", - "file-url": "^2.0.2", - "get-uri": "^2.0.0", - "jsonpath": "^0.2.11", - "linq-es2015": "^2.4.25", - "mocha": "3.4.2", - "mocha-typescript": "1.1.5", - "pify": "^3.0.0", - "safe-eval": "^0.3.0", - "shx": "^0.2.2", - "source-map": "^0.5.6", - "source-map-support": "^0.4.15", - "strip-bom": "^3.0.0", - "typescript": "2.5.3", - "untildify": "^3.0.2", - "urijs": "^1.18.10", - "vscode-jsonrpc": "^3.3.1", - "yaml-ast-parser": "https://github.com/olydis/yaml-ast-parser/releases/download/0.0.34/yaml-ast-parser-0.0.34.tgz", - "yargs": "^8.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "_shasum": "33813111fc9bfa488bd600fbba48bc53cc9182c7", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest-core@2.0.4168", - "_from": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "_where": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest.modeler", - "version": "2.1.22", - "dependencies": { - "dotnet-2.0.0": "^1.4.4" - }, - "optionalDependencies": {}, - "devDependencies": { - "coffee-script": "^1.11.1", - "dotnet-sdk-2.0.0": "^1.4.4", - "gulp": "^3.9.1", - "gulp-filter": "^5.0.0", - "gulp-line-ending-corrector": "^1.0.1", - "iced-coffee-script": "^108.0.11", - "marked": "^0.3.6", - "marked-terminal": "^2.0.0", - "moment": "^2.17.1", - "run-sequence": "*", - "shx": "^0.2.2", - "through2-parallel": "^0.1.3", - "yargs": "^8.0.2", - "yarn": "^1.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "_shasum": "ca425289fa38a210d279729048a4a91673f09c67", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest.modeler@2.1.22", - "_from": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "_where": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest.python", - "version": "2.0.17", - "dependencies": { - "dotnet-2.0.0": "^1.4.4" - }, - "optionalDependencies": {}, - "devDependencies": { - "@microsoft.azure/autorest.testserver": "^1.9.0", - "autorest": "^2.0.0", - "coffee-script": "^1.11.1", - "dotnet-sdk-2.0.0": "^1.4.4", - "gulp": "^3.9.1", - "gulp-filter": "^5.0.0", - "gulp-line-ending-corrector": "^1.0.1", - "iced-coffee-script": "^108.0.11", - "marked": "^0.3.6", - "marked-terminal": "^2.0.0", - "moment": "^2.17.1", - "run-sequence": "*", - "shx": "^0.2.2", - "through2-parallel": "^0.1.3", - "yargs": "^8.0.2", - "yarn": "^1.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest.python@2.0.17/node_modules/@microsoft.azure/autorest.python", - "_shasum": "84a951c19c502343726cfe33cf43cefa76219b39", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest.python@2.0.17", - "_from": "file:/root/.autorest/@microsoft.azure_autorest.python@2.0.17/node_modules/@microsoft.azure/autorest.python", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest.python@2.0.17/node_modules/@microsoft.azure/autorest.python", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest.python@2.0.17/node_modules/@microsoft.azure/autorest.python", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.python@2.0.17/node_modules/@microsoft.azure/autorest.python", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.python@2.0.17/node_modules/@microsoft.azure/autorest.python" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest.python@2.0.17/node_modules/@microsoft.azure/autorest.python", - "_where": "/root/.autorest/@microsoft.azure_autorest.python@2.0.17/node_modules/@microsoft.azure/autorest.python" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - } - ], - "autorest_bootstrap": { - "dependencies": { - "autorest": { - "version": "2.0.4147", - "from": "autorest@latest", - "resolved": "https://registry.npmjs.org/autorest/-/autorest-2.0.4147.tgz" - } - } - }, - "date": "2017-10-16T17:40:20Z" -} \ No newline at end of file diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/__init__.py index c5ef4fa123b8..3a4c02db18cd 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/__init__.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/__init__.py @@ -19,7 +19,6 @@ from .server_for_create import ServerForCreate from .server_update_parameters import ServerUpdateParameters from .firewall_rule import FirewallRule -from .virtual_network_rule import VirtualNetworkRule from .database import Database from .configuration import Configuration from .operation_display import OperationDisplay @@ -32,7 +31,6 @@ from .name_availability import NameAvailability from .server_paged import ServerPaged from .firewall_rule_paged import FirewallRulePaged -from .virtual_network_rule_paged import VirtualNetworkRulePaged from .database_paged import DatabasePaged from .configuration_paged import ConfigurationPaged from .log_file_paged import LogFilePaged @@ -42,7 +40,6 @@ SslEnforcementEnum, ServerState, SkuTier, - VirtualNetworkRuleState, OperationOrigin, ) @@ -57,7 +54,6 @@ 'ServerForCreate', 'ServerUpdateParameters', 'FirewallRule', - 'VirtualNetworkRule', 'Database', 'Configuration', 'OperationDisplay', @@ -70,7 +66,6 @@ 'NameAvailability', 'ServerPaged', 'FirewallRulePaged', - 'VirtualNetworkRulePaged', 'DatabasePaged', 'ConfigurationPaged', 'LogFilePaged', @@ -79,6 +74,5 @@ 'SslEnforcementEnum', 'ServerState', 'SkuTier', - 'VirtualNetworkRuleState', 'OperationOrigin', ] diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/my_sql_management_client_enums.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/my_sql_management_client_enums.py index 99e13ed2e1b3..4ab8a535a65d 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/my_sql_management_client_enums.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/my_sql_management_client_enums.py @@ -37,15 +37,6 @@ class SkuTier(Enum): standard = "Standard" -class VirtualNetworkRuleState(Enum): - - initializing = "Initializing" - in_progress = "InProgress" - ready = "Ready" - deleting = "Deleting" - unknown = "Unknown" - - class OperationOrigin(Enum): not_specified = "NotSpecified" diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/name_availability.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/name_availability.py index ec2551404d3b..b7759d8d4726 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/name_availability.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/name_availability.py @@ -30,6 +30,7 @@ class NameAvailability(Model): } def __init__(self, message=None, name_available=None, reason=None): + super(NameAvailability, self).__init__() self.message = message self.name_available = name_available self.reason = reason diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/name_availability_request.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/name_availability_request.py index 94a863c3554b..715b87ea3676 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/name_availability_request.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/name_availability_request.py @@ -31,5 +31,6 @@ class NameAvailabilityRequest(Model): } def __init__(self, name, type=None): + super(NameAvailabilityRequest, self).__init__() self.name = name self.type = type diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/operation.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/operation.py index 4e2cb42e17e6..d177c6129f38 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/operation.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/operation.py @@ -46,6 +46,7 @@ class Operation(Model): } def __init__(self): + super(Operation, self).__init__() self.name = None self.display = None self.origin = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/operation_display.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/operation_display.py index 968daf77edd3..66b7f736d293 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/operation_display.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/operation_display.py @@ -43,6 +43,7 @@ class OperationDisplay(Model): } def __init__(self): + super(OperationDisplay, self).__init__() self.provider = None self.resource = None self.operation = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/operation_list_result.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/operation_list_result.py index 4576b7f2f9a7..55da5a63aa3d 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/operation_list_result.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/operation_list_result.py @@ -24,4 +24,5 @@ class OperationListResult(Model): } def __init__(self, value=None): + super(OperationListResult, self).__init__() self.value = value diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/performance_tier_properties.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/performance_tier_properties.py index 56f5996290f3..473d0b73ffc4 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/performance_tier_properties.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/performance_tier_properties.py @@ -33,6 +33,7 @@ class PerformanceTierProperties(Model): } def __init__(self, id=None, backup_retention_days=None, service_level_objectives=None): + super(PerformanceTierProperties, self).__init__() self.id = id self.backup_retention_days = backup_retention_days self.service_level_objectives = service_level_objectives diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/performance_tier_service_level_objectives.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/performance_tier_service_level_objectives.py index 72c5b74be4b1..7e2c98d7e24a 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/performance_tier_service_level_objectives.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/performance_tier_service_level_objectives.py @@ -35,6 +35,7 @@ class PerformanceTierServiceLevelObjectives(Model): } def __init__(self, id=None, edition=None, dtu=None, storage_mb=None): + super(PerformanceTierServiceLevelObjectives, self).__init__() self.id = id self.edition = edition self.dtu = dtu diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/proxy_resource.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/proxy_resource.py index c71c9458d454..b982916c5e5b 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/proxy_resource.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/proxy_resource.py @@ -39,6 +39,7 @@ class ProxyResource(Model): } def __init__(self): + super(ProxyResource, self).__init__() self.id = None self.name = None self.type = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_for_create.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_for_create.py index ba6b0adf1e5a..2de6f910be19 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_for_create.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_for_create.py @@ -38,6 +38,7 @@ class ServerForCreate(Model): } def __init__(self, properties, location, sku=None, tags=None): + super(ServerForCreate, self).__init__() self.sku = sku self.properties = properties self.location = location diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_create.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_create.py index 4146e8a44c16..04b1aa2b9648 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_create.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_create.py @@ -48,6 +48,7 @@ class ServerPropertiesForCreate(Model): } def __init__(self, storage_mb=None, version=None, ssl_enforcement=None): + super(ServerPropertiesForCreate, self).__init__() self.storage_mb = storage_mb self.version = version self.ssl_enforcement = ssl_enforcement diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_update_parameters.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_update_parameters.py index b70b5542d3bc..182c974b2c4e 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_update_parameters.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_update_parameters.py @@ -47,6 +47,7 @@ class ServerUpdateParameters(Model): } def __init__(self, sku=None, storage_mb=None, administrator_login_password=None, version=None, ssl_enforcement=None, tags=None): + super(ServerUpdateParameters, self).__init__() self.sku = sku self.storage_mb = storage_mb self.administrator_login_password = administrator_login_password diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/sku.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/sku.py index 33140f04ad9d..2ac58be3f25d 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/sku.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/sku.py @@ -43,6 +43,7 @@ class Sku(Model): } def __init__(self, name=None, tier=None, capacity=None, size=None, family=None): + super(Sku, self).__init__() self.name = name self.tier = tier self.capacity = capacity diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/virtual_network_rule.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/virtual_network_rule.py deleted file mode 100644 index 42553474ddd0..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/virtual_network_rule.py +++ /dev/null @@ -1,60 +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 .proxy_resource import ProxyResource - - -class VirtualNetworkRule(ProxyResource): - """A virtual network rule. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param virtual_network_subnet_id: The ARM resource id of the virtual - network subnet. - :type virtual_network_subnet_id: str - :param ignore_missing_vnet_service_endpoint: Create firewall rule before - the virtual network has vnet service endpoint enabled. - :type ignore_missing_vnet_service_endpoint: bool - :ivar state: Virtual Network Rule State. Possible values include: - 'Initializing', 'InProgress', 'Ready', 'Deleting', 'Unknown' - :vartype state: str or - ~azure.mgmt.rdbms.mysql.models.VirtualNetworkRuleState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'virtual_network_subnet_id': {'required': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'virtual_network_subnet_id': {'key': 'properties.virtualNetworkSubnetId', 'type': 'str'}, - 'ignore_missing_vnet_service_endpoint': {'key': 'properties.ignoreMissingVnetServiceEndpoint', 'type': 'bool'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - } - - def __init__(self, virtual_network_subnet_id, ignore_missing_vnet_service_endpoint=None): - super(VirtualNetworkRule, self).__init__() - self.virtual_network_subnet_id = virtual_network_subnet_id - self.ignore_missing_vnet_service_endpoint = ignore_missing_vnet_service_endpoint - self.state = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/my_sql_management_client.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/my_sql_management_client.py index 011bb63cb449..3bccabe8ba76 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/my_sql_management_client.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/my_sql_management_client.py @@ -15,7 +15,6 @@ from .version import VERSION from .operations.servers_operations import ServersOperations from .operations.firewall_rules_operations import FirewallRulesOperations -from .operations.virtual_network_rules_operations import VirtualNetworkRulesOperations from .operations.databases_operations import DatabasesOperations from .operations.configurations_operations import ConfigurationsOperations from .operations.log_files_operations import LogFilesOperations @@ -52,7 +51,7 @@ def __init__( super(MySQLManagementClientConfiguration, self).__init__(base_url) - self.add_user_agent('mysqlmanagementclient/{}'.format(VERSION)) + self.add_user_agent('azure-mgmt-rdbms/{}'.format(VERSION)) self.add_user_agent('Azure-SDK-For-Python') self.credentials = credentials @@ -60,7 +59,7 @@ def __init__( class MySQLManagementClient(object): - """The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations. + """The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, log files and configurations. :ivar config: Configuration for client. :vartype config: MySQLManagementClientConfiguration @@ -69,8 +68,6 @@ class MySQLManagementClient(object): :vartype servers: azure.mgmt.rdbms.mysql.operations.ServersOperations :ivar firewall_rules: FirewallRules operations :vartype firewall_rules: azure.mgmt.rdbms.mysql.operations.FirewallRulesOperations - :ivar virtual_network_rules: VirtualNetworkRules operations - :vartype virtual_network_rules: azure.mgmt.rdbms.mysql.operations.VirtualNetworkRulesOperations :ivar databases: Databases operations :vartype databases: azure.mgmt.rdbms.mysql.operations.DatabasesOperations :ivar configurations: Configurations operations @@ -110,8 +107,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.firewall_rules = FirewallRulesOperations( self._client, self.config, self._serialize, self._deserialize) - self.virtual_network_rules = VirtualNetworkRulesOperations( - self._client, self.config, self._serialize, self._deserialize) self.databases = DatabasesOperations( self._client, self.config, self._serialize, self._deserialize) self.configurations = ConfigurationsOperations( diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/__init__.py index 970bb5f9b83e..b45b52cd35c1 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/__init__.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/__init__.py @@ -11,7 +11,6 @@ from .servers_operations import ServersOperations from .firewall_rules_operations import FirewallRulesOperations -from .virtual_network_rules_operations import VirtualNetworkRulesOperations from .databases_operations import DatabasesOperations from .configurations_operations import ConfigurationsOperations from .log_files_operations import LogFilesOperations @@ -23,7 +22,6 @@ __all__ = [ 'ServersOperations', 'FirewallRulesOperations', - 'VirtualNetworkRulesOperations', 'DatabasesOperations', 'ConfigurationsOperations', 'LogFilesOperations', diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/check_name_availability_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/check_name_availability_operations.py index 8807ec21c411..f16c1b618b74 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/check_name_availability_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/check_name_availability_operations.py @@ -26,6 +26,8 @@ class CheckNameAvailabilityOperations(object): :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -82,7 +84,7 @@ def execute( # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/configurations_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/configurations_operations.py index dcc504e7cd8b..3bba375da8a6 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/configurations_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/configurations_operations.py @@ -12,6 +12,7 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError +from msrest.exceptions import DeserializationError from msrestazure.azure_operation import AzureOperationPoller from .. import models @@ -27,6 +28,8 @@ class ConfigurationsOperations(object): :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -36,32 +39,9 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def create_or_update( - self, resource_group_name, server_name, configuration_name, value=None, source=None, custom_headers=None, raw=False, **operation_config): - """Updates a configuration of a server. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param configuration_name: The name of the server configuration. - :type configuration_name: str - :param value: Value of the configuration. - :type value: str - :param source: Source of the configuration. - :type source: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - Configuration or ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mysql.models.Configuration] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _create_or_update_initial( + self, resource_group_name, server_name, configuration_name, value=None, source=None, custom_headers=None, raw=False, **operation_config): parameters = models.Configuration(value=value, source=source) # Construct URL @@ -92,19 +72,78 @@ def create_or_update( body_content = self._serialize.body(parameters, 'Configuration') # Construct and send request - def long_running_send(): + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - request = self._client.put(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Configuration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, server_name, configuration_name, value=None, source=None, custom_headers=None, raw=False, **operation_config): + """Updates a configuration of a server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param configuration_name: The name of the server configuration. + :type configuration_name: str + :param value: Value of the configuration. + :type value: str + :param source: Source of the configuration. + :type source: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns + Configuration or ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mysql.models.Configuration] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + configuration_name=configuration_name, + value=value, + source=source, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] return self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): @@ -113,10 +152,7 @@ def get_long_running_output(response): exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Configuration', response) + deserialized = self._deserialize('Configuration', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -124,10 +160,6 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -183,7 +215,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -254,7 +286,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/databases_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/databases_operations.py index 69c6ed6cc1a8..511955374415 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/databases_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/databases_operations.py @@ -12,6 +12,7 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError +from msrest.exceptions import DeserializationError from msrestazure.azure_operation import AzureOperationPoller from .. import models @@ -27,6 +28,8 @@ class DatabasesOperations(object): :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -36,32 +39,9 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def create_or_update( - self, resource_group_name, server_name, database_name, charset=None, collation=None, custom_headers=None, raw=False, **operation_config): - """Creates a new database or updates an existing database. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param charset: The charset of the database. - :type charset: str - :param collation: The collation of the database. - :type collation: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Database or - ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mysql.models.Database] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _create_or_update_initial( + self, resource_group_name, server_name, database_name, charset=None, collation=None, custom_headers=None, raw=False, **operation_config): parameters = models.Database(charset=charset, collation=collation) # Construct URL @@ -92,19 +72,80 @@ def create_or_update( body_content = self._serialize.body(parameters, 'Database') # Construct and send request - def long_running_send(): + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - request = self._client.put(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Database', response) + if response.status_code == 201: + deserialized = self._deserialize('Database', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, server_name, database_name, charset=None, collation=None, custom_headers=None, raw=False, **operation_config): + """Creates a new database or updates an existing database. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param charset: The charset of the database. + :type charset: str + :param collation: The collation of the database. + :type collation: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns Database or + ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mysql.models.Database] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + charset=charset, + collation=collation, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] return self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): @@ -113,12 +154,7 @@ def get_long_running_output(response): exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Database', response) - if response.status_code == 201: - deserialized = self._deserialize('Database', response) + deserialized = self._deserialize('Database', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -126,10 +162,6 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -137,27 +169,9 @@ def get_long_running_output(response): long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) - def delete( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - """Deletes a database. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _delete_initial( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/databases/{databaseName}' path_format_arguments = { @@ -183,18 +197,63 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - def long_running_send(): + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """Deletes a database. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns None or + ClientRawResponse if raw=true + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result - request = self._client.delete(url, query_parameters) - return self._client.send(request, header_parameters, **operation_config) + # Construct and send request + def long_running_send(): + return raw_result.response def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] return self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): @@ -207,10 +266,6 @@ def get_long_running_output(response): client_raw_response = ClientRawResponse(None, response) return client_raw_response - if raw: - response = long_running_send() - return get_long_running_output(response) - long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -266,7 +321,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -337,7 +392,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/firewall_rules_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/firewall_rules_operations.py index 6154ffec6de3..f4ec781d3f3f 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/firewall_rules_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/firewall_rules_operations.py @@ -12,6 +12,7 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError +from msrest.exceptions import DeserializationError from msrestazure.azure_operation import AzureOperationPoller from .. import models @@ -27,6 +28,8 @@ class FirewallRulesOperations(object): :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -36,34 +39,9 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def create_or_update( - self, resource_group_name, server_name, firewall_rule_name, start_ip_address, end_ip_address, custom_headers=None, raw=False, **operation_config): - """Creates a new firewall rule or updates an existing firewall rule. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param firewall_rule_name: The name of the server firewall rule. - :type firewall_rule_name: str - :param start_ip_address: The start IP address of the server firewall - rule. Must be IPv4 format. - :type start_ip_address: str - :param end_ip_address: The end IP address of the server firewall rule. - Must be IPv4 format. - :type end_ip_address: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns FirewallRule - or ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mysql.models.FirewallRule] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _create_or_update_initial( + self, resource_group_name, server_name, firewall_rule_name, start_ip_address, end_ip_address, custom_headers=None, raw=False, **operation_config): parameters = models.FirewallRule(start_ip_address=start_ip_address, end_ip_address=end_ip_address) # Construct URL @@ -94,19 +72,82 @@ def create_or_update( body_content = self._serialize.body(parameters, 'FirewallRule') # Construct and send request - def long_running_send(): + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - request = self._client.put(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('FirewallRule', response) + if response.status_code == 201: + deserialized = self._deserialize('FirewallRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, server_name, firewall_rule_name, start_ip_address, end_ip_address, custom_headers=None, raw=False, **operation_config): + """Creates a new firewall rule or updates an existing firewall rule. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param firewall_rule_name: The name of the server firewall rule. + :type firewall_rule_name: str + :param start_ip_address: The start IP address of the server firewall + rule. Must be IPv4 format. + :type start_ip_address: str + :param end_ip_address: The end IP address of the server firewall rule. + Must be IPv4 format. + :type end_ip_address: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns FirewallRule + or ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mysql.models.FirewallRule] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + firewall_rule_name=firewall_rule_name, + start_ip_address=start_ip_address, + end_ip_address=end_ip_address, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] return self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): @@ -115,12 +156,7 @@ def get_long_running_output(response): exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('FirewallRule', response) - if response.status_code == 201: - deserialized = self._deserialize('FirewallRule', response) + deserialized = self._deserialize('FirewallRule', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -128,10 +164,6 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -139,27 +171,9 @@ def get_long_running_output(response): long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) - def delete( - self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): - """Deletes a server firewall rule. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param firewall_rule_name: The name of the server firewall rule. - :type firewall_rule_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _delete_initial( + self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/firewallRules/{firewallRuleName}' path_format_arguments = { @@ -185,18 +199,63 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - def long_running_send(): + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) - request = self._client.delete(url, query_parameters) - return self._client.send(request, header_parameters, **operation_config) + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): + """Deletes a server firewall rule. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param firewall_rule_name: The name of the server firewall rule. + :type firewall_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns None or + ClientRawResponse if raw=true + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + firewall_rule_name=firewall_rule_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] return self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): @@ -209,10 +268,6 @@ def get_long_running_output(response): client_raw_response = ClientRawResponse(None, response) return client_raw_response - if raw: - response = long_running_send() - return get_long_running_output(response) - long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -268,7 +323,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -339,7 +394,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/location_based_performance_tier_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/location_based_performance_tier_operations.py index 972259dd4192..9e558d349a76 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/location_based_performance_tier_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/location_based_performance_tier_operations.py @@ -26,6 +26,8 @@ class LocationBasedPerformanceTierOperations(object): :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -84,7 +86,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/log_files_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/log_files_operations.py index 9d96941eb9ff..a174a8dede20 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/log_files_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/log_files_operations.py @@ -26,6 +26,8 @@ class LogFilesOperations(object): :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -88,7 +90,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/operations.py index 55acc7ac587b..886dbb2ca71e 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/operations.py @@ -26,6 +26,8 @@ class Operations(object): :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -68,7 +70,7 @@ def list( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/performance_tiers_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/performance_tiers_operations.py index ec508f423582..03b5bdec4176 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/performance_tiers_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/performance_tiers_operations.py @@ -26,6 +26,8 @@ class PerformanceTiersOperations(object): :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -80,7 +82,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/servers_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/servers_operations.py index 6d6c9a4eca98..3d24e85f3588 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/servers_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/servers_operations.py @@ -12,6 +12,7 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError +from msrest.exceptions import DeserializationError from msrestazure.azure_operation import AzureOperationPoller from .. import models @@ -27,6 +28,8 @@ class ServersOperations(object): :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -36,30 +39,9 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def create_or_update( - self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): - """Creates a new server or updates an existing server. The update action - will overwrite the existing server. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param parameters: The required parameters for creating or updating a - server. - :type parameters: ~azure.mgmt.rdbms.mysql.models.ServerForCreate - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Server or - ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mysql.models.Server] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _create_or_update_initial( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}' path_format_arguments = { @@ -87,19 +69,76 @@ def create_or_update( body_content = self._serialize.body(parameters, 'ServerForCreate') # Construct and send request - def long_running_send(): + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - request = self._client.put(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Server', response) + if response.status_code == 201: + deserialized = self._deserialize('Server', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates a new server or updates an existing server. The update action + will overwrite the existing server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param parameters: The required parameters for creating or updating a + server. + :type parameters: ~azure.mgmt.rdbms.mysql.models.ServerForCreate + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns Server or + ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mysql.models.Server] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] return self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): @@ -108,12 +147,7 @@ def get_long_running_output(response): exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Server', response) - if response.status_code == 201: - deserialized = self._deserialize('Server', response) + deserialized = self._deserialize('Server', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -121,10 +155,6 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -132,30 +162,9 @@ def get_long_running_output(response): long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) - def update( - self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): - """Updates an existing server. The request body can contain one to many of - the properties present in the normal server definition. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param parameters: The required parameters for updating a server. - :type parameters: - ~azure.mgmt.rdbms.mysql.models.ServerUpdateParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Server or - ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mysql.models.Server] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _update_initial( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}' path_format_arguments = { @@ -183,19 +192,74 @@ def update( body_content = self._serialize.body(parameters, 'ServerUpdateParameters') # Construct and send request - def long_running_send(): + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - request = self._client.patch(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Server', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): + """Updates an existing server. The request body can contain one to many of + the properties present in the normal server definition. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param parameters: The required parameters for updating a server. + :type parameters: + ~azure.mgmt.rdbms.mysql.models.ServerUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns Server or + ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mysql.models.Server] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] return self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): @@ -204,10 +268,7 @@ def get_long_running_output(response): exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Server', response) + deserialized = self._deserialize('Server', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -215,10 +276,6 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -226,25 +283,9 @@ def get_long_running_output(response): long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) - def delete( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """Deletes a server. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _delete_initial( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}' path_format_arguments = { @@ -269,18 +310,60 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - def long_running_send(): + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """Deletes a server. - request = self._client.delete(url, query_parameters) - return self._client.send(request, header_parameters, **operation_config) + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns None or + ClientRawResponse if raw=true + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] return self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): @@ -293,10 +376,6 @@ def get_long_running_output(response): client_raw_response = ClientRawResponse(None, response) return client_raw_response - if raw: - response = long_running_send() - return get_long_running_output(response) - long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -349,7 +428,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -417,7 +496,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -481,7 +560,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/version.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/version.py index e0ec669828cb..3c14a627134c 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/version.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "2017-04-30-preview" diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/__init__.py new file mode 100644 index 000000000000..41ac8ae569f2 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/__init__.py @@ -0,0 +1,18 @@ +# 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 .postgre_sql_management_client import PostgreSQLManagementClient +from .version import VERSION + +__all__ = ['PostgreSQLManagementClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/__init__.py new file mode 100644 index 000000000000..9bc07a61b9c2 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/__init__.py @@ -0,0 +1,78 @@ +# 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 .proxy_resource import ProxyResource +from .tracked_resource import TrackedResource +from .server_properties_for_create import ServerPropertiesForCreate +from .server_properties_for_default_create import ServerPropertiesForDefaultCreate +from .server_properties_for_restore import ServerPropertiesForRestore +from .sku import Sku +from .server import Server +from .server_for_create import ServerForCreate +from .server_update_parameters import ServerUpdateParameters +from .firewall_rule import FirewallRule +from .database import Database +from .configuration import Configuration +from .operation_display import OperationDisplay +from .operation import Operation +from .operation_list_result import OperationListResult +from .log_file import LogFile +from .performance_tier_service_level_objectives import PerformanceTierServiceLevelObjectives +from .performance_tier_properties import PerformanceTierProperties +from .name_availability_request import NameAvailabilityRequest +from .name_availability import NameAvailability +from .server_paged import ServerPaged +from .firewall_rule_paged import FirewallRulePaged +from .database_paged import DatabasePaged +from .configuration_paged import ConfigurationPaged +from .log_file_paged import LogFilePaged +from .performance_tier_properties_paged import PerformanceTierPropertiesPaged +from .postgre_sql_management_client_enums import ( + ServerVersion, + SslEnforcementEnum, + ServerState, + SkuTier, + OperationOrigin, +) + +__all__ = [ + 'ProxyResource', + 'TrackedResource', + 'ServerPropertiesForCreate', + 'ServerPropertiesForDefaultCreate', + 'ServerPropertiesForRestore', + 'Sku', + 'Server', + 'ServerForCreate', + 'ServerUpdateParameters', + 'FirewallRule', + 'Database', + 'Configuration', + 'OperationDisplay', + 'Operation', + 'OperationListResult', + 'LogFile', + 'PerformanceTierServiceLevelObjectives', + 'PerformanceTierProperties', + 'NameAvailabilityRequest', + 'NameAvailability', + 'ServerPaged', + 'FirewallRulePaged', + 'DatabasePaged', + 'ConfigurationPaged', + 'LogFilePaged', + 'PerformanceTierPropertiesPaged', + 'ServerVersion', + 'SslEnforcementEnum', + 'ServerState', + 'SkuTier', + 'OperationOrigin', +] diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/configuration.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/configuration.py new file mode 100644 index 000000000000..958b4df22372 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/configuration.py @@ -0,0 +1,70 @@ +# 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 .proxy_resource import ProxyResource + + +class Configuration(ProxyResource): + """Represents a Configuration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param value: Value of the configuration. + :type value: str + :ivar description: Description of the configuration. + :vartype description: str + :ivar default_value: Default value of the configuration. + :vartype default_value: str + :ivar data_type: Data type of the configuration. + :vartype data_type: str + :ivar allowed_values: Allowed values of the configuration. + :vartype allowed_values: str + :param source: Source of the configuration. + :type source: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'default_value': {'readonly': True}, + 'data_type': {'readonly': True}, + 'allowed_values': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'default_value': {'key': 'properties.defaultValue', 'type': 'str'}, + 'data_type': {'key': 'properties.dataType', 'type': 'str'}, + 'allowed_values': {'key': 'properties.allowedValues', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + } + + def __init__(self, value=None, source=None): + super(Configuration, self).__init__() + self.value = value + self.description = None + self.default_value = None + self.data_type = None + self.allowed_values = None + self.source = source diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/virtual_network_rule_paged.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/configuration_paged.py similarity index 67% rename from azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/virtual_network_rule_paged.py rename to azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/configuration_paged.py index a7eaf18d22bc..c8f0925967f6 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/virtual_network_rule_paged.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/configuration_paged.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class VirtualNetworkRulePaged(Paged): +class ConfigurationPaged(Paged): """ - A paging container for iterating over a list of :class:`VirtualNetworkRule ` object + A paging container for iterating over a list of :class:`Configuration ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[VirtualNetworkRule]'} + 'current_page': {'key': 'value', 'type': '[Configuration]'} } def __init__(self, *args, **kwargs): - super(VirtualNetworkRulePaged, self).__init__(*args, **kwargs) + super(ConfigurationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/database.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/database.py new file mode 100644 index 000000000000..f4e129302c9d --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/database.py @@ -0,0 +1,50 @@ +# 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 .proxy_resource import ProxyResource + + +class Database(ProxyResource): + """Represents a Database. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param charset: The charset of the database. + :type charset: str + :param collation: The collation of the database. + :type collation: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'charset': {'key': 'properties.charset', 'type': 'str'}, + 'collation': {'key': 'properties.collation', 'type': 'str'}, + } + + def __init__(self, charset=None, collation=None): + super(Database, self).__init__() + self.charset = charset + self.collation = collation diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/database_paged.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/database_paged.py new file mode 100644 index 000000000000..bbbe51643acf --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/database_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class DatabasePaged(Paged): + """ + A paging container for iterating over a list of :class:`Database ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Database]'} + } + + def __init__(self, *args, **kwargs): + + super(DatabasePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/firewall_rule.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/firewall_rule.py new file mode 100644 index 000000000000..ed7b9c13a026 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/firewall_rule.py @@ -0,0 +1,54 @@ +# 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 .proxy_resource import ProxyResource + + +class FirewallRule(ProxyResource): + """Represents a server firewall rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param start_ip_address: The start IP address of the server firewall rule. + Must be IPv4 format. + :type start_ip_address: str + :param end_ip_address: The end IP address of the server firewall rule. + Must be IPv4 format. + :type end_ip_address: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'start_ip_address': {'required': True, 'pattern': r'^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$'}, + 'end_ip_address': {'required': True, 'pattern': r'^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$'}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_ip_address': {'key': 'properties.startIpAddress', 'type': 'str'}, + 'end_ip_address': {'key': 'properties.endIpAddress', 'type': 'str'}, + } + + def __init__(self, start_ip_address, end_ip_address): + super(FirewallRule, self).__init__() + self.start_ip_address = start_ip_address + self.end_ip_address = end_ip_address diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/firewall_rule_paged.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/firewall_rule_paged.py new file mode 100644 index 000000000000..02a72ebeb415 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/firewall_rule_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class FirewallRulePaged(Paged): + """ + A paging container for iterating over a list of :class:`FirewallRule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[FirewallRule]'} + } + + def __init__(self, *args, **kwargs): + + super(FirewallRulePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/log_file.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/log_file.py new file mode 100644 index 000000000000..3ec6e29b9c51 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/log_file.py @@ -0,0 +1,66 @@ +# 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 .proxy_resource import ProxyResource + + +class LogFile(ProxyResource): + """Represents a log file. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param log_file_name: Log file name. + :type log_file_name: str + :param size_in_kb: Size of the log file. + :type size_in_kb: long + :param created_time: Creation timestamp of the log file. + :type created_time: datetime + :param last_modified_time: Last modified timestamp of the log file. + :type last_modified_time: datetime + :param log_file_type: Type of the log file. + :type log_file_type: str + :param url: The url to download the log file from. + :type url: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'log_file_name': {'key': 'properties.name', 'type': 'str'}, + 'size_in_kb': {'key': 'properties.sizeInKB', 'type': 'long'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'log_file_type': {'key': 'properties.type', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + } + + def __init__(self, log_file_name=None, size_in_kb=None, created_time=None, last_modified_time=None, log_file_type=None, url=None): + super(LogFile, self).__init__() + self.log_file_name = log_file_name + self.size_in_kb = size_in_kb + self.created_time = created_time + self.last_modified_time = last_modified_time + self.log_file_type = log_file_type + self.url = url diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/log_file_paged.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/log_file_paged.py new file mode 100644 index 000000000000..4e2eda696fc5 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/log_file_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class LogFilePaged(Paged): + """ + A paging container for iterating over a list of :class:`LogFile ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[LogFile]'} + } + + def __init__(self, *args, **kwargs): + + super(LogFilePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/name_availability.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/name_availability.py new file mode 100644 index 000000000000..b7759d8d4726 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/name_availability.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class NameAvailability(Model): + """Represents a resource name availability. + + :param message: Error Message. + :type message: str + :param name_available: Indicates whether the resource name is available. + :type name_available: bool + :param reason: Reason for name being unavailable. + :type reason: str + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__(self, message=None, name_available=None, reason=None): + super(NameAvailability, self).__init__() + self.message = message + self.name_available = name_available + self.reason = reason diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/name_availability_request.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/name_availability_request.py new file mode 100644 index 000000000000..715b87ea3676 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/name_availability_request.py @@ -0,0 +1,36 @@ +# 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 msrest.serialization import Model + + +class NameAvailabilityRequest(Model): + """Request from client to check resource name availability. + + :param name: Resource name to verify. + :type name: str + :param type: Resource type used for verification. + :type type: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, name, type=None): + super(NameAvailabilityRequest, self).__init__() + self.name = name + self.type = type diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation.py new file mode 100644 index 000000000000..a162fa66ce7f --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation.py @@ -0,0 +1,53 @@ +# 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 msrest.serialization import Model + + +class Operation(Model): + """REST API operation definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the operation being performed on this particular + object. + :vartype name: str + :ivar display: The localized display information for this particular + operation or action. + :vartype display: ~azure.mgmt.rdbms.postgres.models.OperationDisplay + :ivar origin: The intended executor of the operation. Possible values + include: 'NotSpecified', 'user', 'system' + :vartype origin: str or ~azure.mgmt.rdbms.postgres.models.OperationOrigin + :ivar properties: Additional descriptions for the operation. + :vartype properties: dict[str, object] + """ + + _validation = { + 'name': {'readonly': True}, + 'display': {'readonly': True}, + 'origin': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{object}'}, + } + + def __init__(self): + super(Operation, self).__init__() + self.name = None + self.display = None + self.origin = None + self.properties = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation_display.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation_display.py new file mode 100644 index 000000000000..66b7f736d293 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation_display.py @@ -0,0 +1,50 @@ +# 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 msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Operation resource provider name. + :vartype provider: str + :ivar resource: Resource on which the operation is performed. + :vartype resource: str + :ivar operation: Localized friendly name for the operation. + :vartype operation: str + :ivar description: Operation description. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self): + super(OperationDisplay, self).__init__() + self.provider = None + self.resource = None + self.operation = None + self.description = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation_list_result.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation_list_result.py new file mode 100644 index 000000000000..04f9aa792ad7 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation_list_result.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class OperationListResult(Model): + """A list of resource provider operations. + + :param value: The list of resource provider operations. + :type value: list[~azure.mgmt.rdbms.postgres.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__(self, value=None): + super(OperationListResult, self).__init__() + self.value = value diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_properties.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_properties.py new file mode 100644 index 000000000000..9d7f38812e4d --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_properties.py @@ -0,0 +1,39 @@ +# 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 msrest.serialization import Model + + +class PerformanceTierProperties(Model): + """Performance tier properties. + + :param id: ID of the performance tier. + :type id: str + :param backup_retention_days: Backup retention in days for the performance + tier edition + :type backup_retention_days: int + :param service_level_objectives: Service level objectives associated with + the performance tier + :type service_level_objectives: + list[~azure.mgmt.rdbms.postgres.models.PerformanceTierServiceLevelObjectives] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'}, + 'service_level_objectives': {'key': 'serviceLevelObjectives', 'type': '[PerformanceTierServiceLevelObjectives]'}, + } + + def __init__(self, id=None, backup_retention_days=None, service_level_objectives=None): + super(PerformanceTierProperties, self).__init__() + self.id = id + self.backup_retention_days = backup_retention_days + self.service_level_objectives = service_level_objectives diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_properties_paged.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_properties_paged.py new file mode 100644 index 000000000000..ea2d29a85f6a --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_properties_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class PerformanceTierPropertiesPaged(Paged): + """ + A paging container for iterating over a list of :class:`PerformanceTierProperties ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PerformanceTierProperties]'} + } + + def __init__(self, *args, **kwargs): + + super(PerformanceTierPropertiesPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_service_level_objectives.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_service_level_objectives.py new file mode 100644 index 000000000000..7e2c98d7e24a --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_service_level_objectives.py @@ -0,0 +1,42 @@ +# 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 msrest.serialization import Model + + +class PerformanceTierServiceLevelObjectives(Model): + """Service level objectives for performance tier. + + :param id: ID for the service level objective. + :type id: str + :param edition: Edition of the performance tier. + :type edition: str + :param dtu: Database throughput unit associated with the service level + objective + :type dtu: int + :param storage_mb: Maximum storage in MB associated with the service level + objective + :type storage_mb: int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'edition': {'key': 'edition', 'type': 'str'}, + 'dtu': {'key': 'dtu', 'type': 'int'}, + 'storage_mb': {'key': 'storageMB', 'type': 'int'}, + } + + def __init__(self, id=None, edition=None, dtu=None, storage_mb=None): + super(PerformanceTierServiceLevelObjectives, self).__init__() + self.id = id + self.edition = edition + self.dtu = dtu + self.storage_mb = storage_mb diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/postgre_sql_management_client_enums.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/postgre_sql_management_client_enums.py new file mode 100644 index 000000000000..d539086044e1 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/postgre_sql_management_client_enums.py @@ -0,0 +1,44 @@ +# 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 enum import Enum + + +class ServerVersion(Enum): + + nine_full_stop_five = "9.5" + nine_full_stop_six = "9.6" + + +class SslEnforcementEnum(Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class ServerState(Enum): + + ready = "Ready" + dropping = "Dropping" + disabled = "Disabled" + + +class SkuTier(Enum): + + basic = "Basic" + standard = "Standard" + + +class OperationOrigin(Enum): + + not_specified = "NotSpecified" + user = "user" + system = "system" diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/proxy_resource.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/proxy_resource.py new file mode 100644 index 000000000000..b982916c5e5b --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/proxy_resource.py @@ -0,0 +1,45 @@ +# 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 msrest.serialization import Model + + +class ProxyResource(Model): + """Resource properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self): + super(ProxyResource, self).__init__() + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server.py new file mode 100644 index 000000000000..5a53ae461473 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server.py @@ -0,0 +1,85 @@ +# 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 .tracked_resource import TrackedResource + + +class Server(TrackedResource): + """Represents a server. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: The location the resource resides in. + :type location: str + :param tags: Application-specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :param sku: The SKU (pricing tier) of the server. + :type sku: ~azure.mgmt.rdbms.postgres.models.Sku + :param administrator_login: The administrator's login name of a server. + Can only be specified when the server is being created (and is required + for creation). + :type administrator_login: str + :param storage_mb: The maximum storage allowed for a server. + :type storage_mb: long + :param version: Server version. Possible values include: '9.5', '9.6' + :type version: str or ~azure.mgmt.rdbms.postgres.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.postgres.models.SslEnforcementEnum + :param user_visible_state: A state of a server that is visible to user. + Possible values include: 'Ready', 'Dropping', 'Disabled' + :type user_visible_state: str or + ~azure.mgmt.rdbms.postgres.models.ServerState + :param fully_qualified_domain_name: The fully qualified domain name of a + server. + :type fully_qualified_domain_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'storage_mb': {'minimum': 1024}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, + 'storage_mb': {'key': 'properties.storageMB', 'type': 'long'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'properties.sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'user_visible_state': {'key': 'properties.userVisibleState', 'type': 'str'}, + 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, + } + + def __init__(self, location, tags=None, sku=None, administrator_login=None, storage_mb=None, version=None, ssl_enforcement=None, user_visible_state=None, fully_qualified_domain_name=None): + super(Server, self).__init__(location=location, tags=tags) + self.sku = sku + self.administrator_login = administrator_login + self.storage_mb = storage_mb + self.version = version + self.ssl_enforcement = ssl_enforcement + self.user_visible_state = user_visible_state + self.fully_qualified_domain_name = fully_qualified_domain_name diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_for_create.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_for_create.py new file mode 100644 index 000000000000..16b0de4fd924 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_for_create.py @@ -0,0 +1,46 @@ +# 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 msrest.serialization import Model + + +class ServerForCreate(Model): + """Represents a server to be created. + + :param sku: The SKU (pricing tier) of the server. + :type sku: ~azure.mgmt.rdbms.postgres.models.Sku + :param properties: Properties of the server. + :type properties: + ~azure.mgmt.rdbms.postgres.models.ServerPropertiesForCreate + :param location: The location the resource resides in. + :type location: str + :param tags: Application-specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'properties': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'properties': {'key': 'properties', 'type': 'ServerPropertiesForCreate'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, properties, location, sku=None, tags=None): + super(ServerForCreate, self).__init__() + self.sku = sku + self.properties = properties + self.location = location + self.tags = tags diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_paged.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_paged.py new file mode 100644 index 000000000000..07cf2ada666e --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class ServerPaged(Paged): + """ + A paging container for iterating over a list of :class:`Server ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Server]'} + } + + def __init__(self, *args, **kwargs): + + super(ServerPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_create.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_create.py new file mode 100644 index 000000000000..3d843e572ae9 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_create.py @@ -0,0 +1,55 @@ +# 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 msrest.serialization import Model + + +class ServerPropertiesForCreate(Model): + """The properties used to create a new server. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ServerPropertiesForDefaultCreate, + ServerPropertiesForRestore + + :param storage_mb: The maximum storage allowed for a server. + :type storage_mb: long + :param version: Server version. Possible values include: '9.5', '9.6' + :type version: str or ~azure.mgmt.rdbms.postgres.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.postgres.models.SslEnforcementEnum + :param create_mode: Constant filled by server. + :type create_mode: str + """ + + _validation = { + 'storage_mb': {'minimum': 1024}, + 'create_mode': {'required': True}, + } + + _attribute_map = { + 'storage_mb': {'key': 'storageMB', 'type': 'long'}, + 'version': {'key': 'version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + } + + _subtype_map = { + 'create_mode': {'Default': 'ServerPropertiesForDefaultCreate', 'PointInTimeRestore': 'ServerPropertiesForRestore'} + } + + def __init__(self, storage_mb=None, version=None, ssl_enforcement=None): + super(ServerPropertiesForCreate, self).__init__() + self.storage_mb = storage_mb + self.version = version + self.ssl_enforcement = ssl_enforcement + self.create_mode = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_default_create.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_default_create.py new file mode 100644 index 000000000000..c3cea4b6d341 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_default_create.py @@ -0,0 +1,57 @@ +# 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 .server_properties_for_create import ServerPropertiesForCreate + + +class ServerPropertiesForDefaultCreate(ServerPropertiesForCreate): + """The properties used to create a new server. + + :param storage_mb: The maximum storage allowed for a server. + :type storage_mb: long + :param version: Server version. Possible values include: '9.5', '9.6' + :type version: str or ~azure.mgmt.rdbms.postgres.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.postgres.models.SslEnforcementEnum + :param create_mode: Constant filled by server. + :type create_mode: str + :param administrator_login: The administrator's login name of a server. + Can only be specified when the server is being created (and is required + for creation). + :type administrator_login: str + :param administrator_login_password: The password of the administrator + login. + :type administrator_login_password: str + """ + + _validation = { + 'storage_mb': {'minimum': 1024}, + 'create_mode': {'required': True}, + 'administrator_login': {'required': True}, + 'administrator_login_password': {'required': True}, + } + + _attribute_map = { + 'storage_mb': {'key': 'storageMB', 'type': 'long'}, + 'version': {'key': 'version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'administrator_login': {'key': 'administratorLogin', 'type': 'str'}, + 'administrator_login_password': {'key': 'administratorLoginPassword', 'type': 'str'}, + } + + def __init__(self, administrator_login, administrator_login_password, storage_mb=None, version=None, ssl_enforcement=None): + super(ServerPropertiesForDefaultCreate, self).__init__(storage_mb=storage_mb, version=version, ssl_enforcement=ssl_enforcement) + self.administrator_login = administrator_login + self.administrator_login_password = administrator_login_password + self.create_mode = 'Default' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_restore.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_restore.py new file mode 100644 index 000000000000..dd1ccf7b32e2 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_restore.py @@ -0,0 +1,55 @@ +# 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 .server_properties_for_create import ServerPropertiesForCreate + + +class ServerPropertiesForRestore(ServerPropertiesForCreate): + """The properties to a new server by restoring from a backup. + + :param storage_mb: The maximum storage allowed for a server. + :type storage_mb: long + :param version: Server version. Possible values include: '9.5', '9.6' + :type version: str or ~azure.mgmt.rdbms.postgres.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.postgres.models.SslEnforcementEnum + :param create_mode: Constant filled by server. + :type create_mode: str + :param source_server_id: The source server id to restore from. + :type source_server_id: str + :param restore_point_in_time: Restore point creation time (ISO8601 + format), specifying the time to restore from. + :type restore_point_in_time: datetime + """ + + _validation = { + 'storage_mb': {'minimum': 1024}, + 'create_mode': {'required': True}, + 'source_server_id': {'required': True}, + 'restore_point_in_time': {'required': True}, + } + + _attribute_map = { + 'storage_mb': {'key': 'storageMB', 'type': 'long'}, + 'version': {'key': 'version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'source_server_id': {'key': 'sourceServerId', 'type': 'str'}, + 'restore_point_in_time': {'key': 'restorePointInTime', 'type': 'iso-8601'}, + } + + def __init__(self, source_server_id, restore_point_in_time, storage_mb=None, version=None, ssl_enforcement=None): + super(ServerPropertiesForRestore, self).__init__(storage_mb=storage_mb, version=version, ssl_enforcement=ssl_enforcement) + self.source_server_id = source_server_id + self.restore_point_in_time = restore_point_in_time + self.create_mode = 'PointInTimeRestore' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_update_parameters.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_update_parameters.py new file mode 100644 index 000000000000..25cfd01ae0c1 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_update_parameters.py @@ -0,0 +1,56 @@ +# 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 msrest.serialization import Model + + +class ServerUpdateParameters(Model): + """Parameters allowd to update for a server. + + :param sku: The SKU (pricing tier) of the server. + :type sku: ~azure.mgmt.rdbms.postgres.models.Sku + :param storage_mb: The max storage allowed for a server. + :type storage_mb: long + :param administrator_login_password: The password of the administrator + login. + :type administrator_login_password: str + :param version: The version of a server. Possible values include: '9.5', + '9.6' + :type version: str or ~azure.mgmt.rdbms.postgres.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.postgres.models.SslEnforcementEnum + :param tags: Application-specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'storage_mb': {'minimum': 1024}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'storage_mb': {'key': 'properties.storageMB', 'type': 'long'}, + 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'properties.sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, sku=None, storage_mb=None, administrator_login_password=None, version=None, ssl_enforcement=None, tags=None): + super(ServerUpdateParameters, self).__init__() + self.sku = sku + self.storage_mb = storage_mb + self.administrator_login_password = administrator_login_password + self.version = version + self.ssl_enforcement = ssl_enforcement + self.tags = tags diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/sku.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/sku.py new file mode 100644 index 000000000000..c8779e322ba6 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/sku.py @@ -0,0 +1,51 @@ +# 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 msrest.serialization import Model + + +class Sku(Model): + """Billing information related properties of a server. + + :param name: The name of the sku, typically, a letter + Number code, e.g. + P3. + :type name: str + :param tier: The tier of the particular SKU, e.g. Basic. Possible values + include: 'Basic', 'Standard' + :type tier: str or ~azure.mgmt.rdbms.postgres.models.SkuTier + :param capacity: The scale up/out capacity, representing server's compute + units. + :type capacity: int + :param size: The size code, to be interpreted by resource as appropriate. + :type size: str + :param family: The family of hardware. + :type family: str + """ + + _validation = { + 'capacity': {'minimum': 0}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + } + + def __init__(self, name=None, tier=None, capacity=None, size=None, family=None): + super(Sku, self).__init__() + self.name = name + self.tier = tier + self.capacity = capacity + self.size = size + self.family = family diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/tracked_resource.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/tracked_resource.py new file mode 100644 index 000000000000..0d199e6f6f97 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/tracked_resource.py @@ -0,0 +1,51 @@ +# 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 .proxy_resource import ProxyResource + + +class TrackedResource(ProxyResource): + """Resource properties including location and tags for track resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: The location the resource resides in. + :type location: str + :param tags: Application-specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, location, tags=None): + super(TrackedResource, self).__init__() + self.location = location + self.tags = tags diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/__init__.py new file mode 100644 index 000000000000..b45b52cd35c1 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/__init__.py @@ -0,0 +1,32 @@ +# 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 .servers_operations import ServersOperations +from .firewall_rules_operations import FirewallRulesOperations +from .databases_operations import DatabasesOperations +from .configurations_operations import ConfigurationsOperations +from .log_files_operations import LogFilesOperations +from .performance_tiers_operations import PerformanceTiersOperations +from .location_based_performance_tier_operations import LocationBasedPerformanceTierOperations +from .check_name_availability_operations import CheckNameAvailabilityOperations +from .operations import Operations + +__all__ = [ + 'ServersOperations', + 'FirewallRulesOperations', + 'DatabasesOperations', + 'ConfigurationsOperations', + 'LogFilesOperations', + 'PerformanceTiersOperations', + 'LocationBasedPerformanceTierOperations', + 'CheckNameAvailabilityOperations', + 'Operations', +] diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/check_name_availability_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/check_name_availability_operations.py new file mode 100644 index 000000000000..40158b09d21d --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/check_name_availability_operations.py @@ -0,0 +1,103 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class CheckNameAvailabilityOperations(object): + """CheckNameAvailabilityOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-04-30-preview" + + self.config = config + + def execute( + self, name, type=None, custom_headers=None, raw=False, **operation_config): + """Check the availability of name for resource. + + :param name: Resource name to verify. + :type name: str + :param type: Resource type used for verification. + :type type: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NameAvailability or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.rdbms.postgres.models.NameAvailability or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + name_availability_request = models.NameAvailabilityRequest(name=name, type=type) + + # Construct URL + url = '/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/checkNameAvailability' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(name_availability_request, 'NameAvailabilityRequest') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NameAvailability', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/configurations_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/configurations_operations.py new file mode 100644 index 000000000000..03a73cfef7e7 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/configurations_operations.py @@ -0,0 +1,306 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.exceptions import DeserializationError +from msrestazure.azure_operation import AzureOperationPoller + +from .. import models + + +class ConfigurationsOperations(object): + """ConfigurationsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-04-30-preview" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, server_name, configuration_name, value=None, source=None, custom_headers=None, raw=False, **operation_config): + parameters = models.Configuration(value=value, source=source) + + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/configurations/{configurationName}' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'Configuration') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Configuration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, server_name, configuration_name, value=None, source=None, custom_headers=None, raw=False, **operation_config): + """Updates a configuration of a server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param configuration_name: The name of the server configuration. + :type configuration_name: str + :param value: Value of the configuration. + :type value: str + :param source: Source of the configuration. + :type source: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns + Configuration or ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgres.models.Configuration] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + configuration_name=configuration_name, + value=value, + source=source, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = self._deserialize('Configuration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + + def get( + self, resource_group_name, server_name, configuration_name, custom_headers=None, raw=False, **operation_config): + """Gets information about a configuration of server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param configuration_name: The name of the server configuration. + :type configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Configuration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.rdbms.postgres.models.Configuration or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/configurations/{configurationName}' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Configuration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def list_by_server( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """List all the configurations in a given server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Configuration + :rtype: + ~azure.mgmt.rdbms.postgres.models.ConfigurationPaged[~azure.mgmt.rdbms.postgres.models.Configuration] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/configurations' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ConfigurationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/virtual_network_rules_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/databases_operations.py similarity index 68% rename from azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/virtual_network_rules_operations.py rename to azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/databases_operations.py index 365809856bb8..df1f95eaf0f9 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/virtual_network_rules_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/databases_operations.py @@ -12,13 +12,14 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError +from msrest.exceptions import DeserializationError from msrestazure.azure_operation import AzureOperationPoller from .. import models -class VirtualNetworkRulesOperations(object): - """VirtualNetworkRulesOperations operations. +class DatabasesOperations(object): + """DatabasesOperations operations. :param client: Client for service requests. :param config: Configuration of service client. @@ -27,6 +28,8 @@ class VirtualNetworkRulesOperations(object): :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -36,36 +39,18 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def get( - self, resource_group_name, server_name, virtual_network_rule_name, custom_headers=None, raw=False, **operation_config): - """Gets a virtual network rule. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param virtual_network_rule_name: The name of the virtual network - rule. - :type virtual_network_rule_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: VirtualNetworkRule or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.rdbms.mysql.models.VirtualNetworkRule or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _create_or_update_initial( + self, resource_group_name, server_name, database_name, charset=None, collation=None, custom_headers=None, raw=False, **operation_config): + parameters = models.Database(charset=charset, collation=collation) + # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}' + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases/{databaseName}' path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'virtualNetworkRuleName': self._serialize.url("virtual_network_rule_name", virtual_network_rule_name, 'str') + 'databaseName': self._serialize.url("database_name", database_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -83,11 +68,15 @@ def get( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + # Construct body + body_content = self._serialize.body(parameters, 'Database') + # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 201, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -95,7 +84,9 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('VirtualNetworkRule', response) + deserialized = self._deserialize('Database', response) + if response.status_code == 201: + deserialized = self._deserialize('Database', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -104,8 +95,8 @@ def get( return deserialized def create_or_update( - self, resource_group_name, server_name, virtual_network_rule_name, virtual_network_subnet_id, ignore_missing_vnet_service_endpoint=None, custom_headers=None, raw=False, **operation_config): - """Creates or updates an existing virtual network rule. + self, resource_group_name, server_name, database_name, charset=None, collation=None, custom_headers=None, raw=False, **operation_config): + """Creates a new database or updates an existing database. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -113,34 +104,81 @@ def create_or_update( :type resource_group_name: str :param server_name: The name of the server. :type server_name: str - :param virtual_network_rule_name: The name of the virtual network - rule. - :type virtual_network_rule_name: str - :param virtual_network_subnet_id: The ARM resource id of the virtual - network subnet. - :type virtual_network_subnet_id: str - :param ignore_missing_vnet_service_endpoint: Create firewall rule - before the virtual network has vnet service endpoint enabled. - :type ignore_missing_vnet_service_endpoint: bool + :param database_name: The name of the database. + :type database_name: str + :param charset: The charset of the database. + :type charset: str + :param collation: The collation of the database. + :type collation: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkRule or ClientRawResponse if raw=true + :return: An instance of AzureOperationPoller that returns Database or + ClientRawResponse if raw=true :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mysql.models.VirtualNetworkRule] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgres.models.Database] or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - parameters = models.VirtualNetworkRule(virtual_network_subnet_id=virtual_network_subnet_id, ignore_missing_vnet_service_endpoint=ignore_missing_vnet_service_endpoint) + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + charset=charset, + collation=collation, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = self._deserialize('Database', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + + + def _delete_initial( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}' + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases/{databaseName}' path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'virtualNetworkRuleName': self._serialize.url("virtual_network_rule_name", virtual_network_rule_name, 'str') + 'databaseName': self._serialize.url("database_name", database_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -158,48 +196,76 @@ def create_or_update( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - # Construct body - body_content = self._serialize.body(parameters, 'VirtualNetworkRule') + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """Deletes a database. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns None or + ClientRawResponse if raw=true + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result # Construct and send request def long_running_send(): - - request = self._client.put(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + return raw_result.response def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] return self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - if response.status_code not in [200, 202, 201]: + if response.status_code not in [200, 202, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('VirtualNetworkRule', response) - if response.status_code == 201: - deserialized = self._deserialize('VirtualNetworkRule', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - return deserialized - - if raw: - response = long_running_send() - return get_long_running_output(response) - long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -207,9 +273,9 @@ def get_long_running_output(response): long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) - def delete( - self, resource_group_name, server_name, virtual_network_rule_name, custom_headers=None, raw=False, **operation_config): - """Deletes the virtual network rule with the given name. + def get( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """Gets information about a database. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -217,25 +283,25 @@ def delete( :type resource_group_name: str :param server_name: The name of the server. :type server_name: str - :param virtual_network_rule_name: The name of the virtual network - rule. - :type virtual_network_rule_name: str + :param database_name: The name of the database. + :type database_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Database or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.rdbms.postgres.models.Database or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}' + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases/{databaseName}' path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'virtualNetworkRuleName': self._serialize.url("virtual_network_rule_name", virtual_network_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'databaseName': self._serialize.url("database_name", database_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -254,44 +320,28 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - def long_running_send(): - - request = self._client.delete(url, query_parameters) - return self._client.send(request, header_parameters, **operation_config) - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) - def get_long_running_output(response): + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + deserialized = None - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + if response.status_code == 200: + deserialized = self._deserialize('Database', response) if raw: - response = long_running_send() - return get_long_running_output(response) + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response - long_running_operation_timeout = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + return deserialized def list_by_server( self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """Gets a list of virtual network rules in a server. + """List all the databases in a given server. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -304,20 +354,20 @@ def list_by_server( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of VirtualNetworkRule + :return: An iterator like instance of Database :rtype: - ~azure.mgmt.rdbms.mysql.models.VirtualNetworkRulePaged[~azure.mgmt.rdbms.mysql.models.VirtualNetworkRule] + ~azure.mgmt.rdbms.postgres.models.DatabasePaged[~azure.mgmt.rdbms.postgres.models.Database] :raises: :class:`CloudError` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/virtualNetworkRules' + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases' path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'serverName': self._serialize.url("server_name", server_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -342,7 +392,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -352,11 +402,11 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.VirtualNetworkRulePaged(internal_paging, self._deserialize.dependencies) + deserialized = models.DatabasePaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.VirtualNetworkRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.DatabasePaged(internal_paging, self._deserialize.dependencies, header_dict) return client_raw_response return deserialized diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/firewall_rules_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/firewall_rules_operations.py new file mode 100644 index 000000000000..8d9dae43fa4a --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/firewall_rules_operations.py @@ -0,0 +1,414 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.exceptions import DeserializationError +from msrestazure.azure_operation import AzureOperationPoller + +from .. import models + + +class FirewallRulesOperations(object): + """FirewallRulesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-04-30-preview" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, server_name, firewall_rule_name, start_ip_address, end_ip_address, custom_headers=None, raw=False, **operation_config): + parameters = models.FirewallRule(start_ip_address=start_ip_address, end_ip_address=end_ip_address) + + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'FirewallRule') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('FirewallRule', response) + if response.status_code == 201: + deserialized = self._deserialize('FirewallRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, server_name, firewall_rule_name, start_ip_address, end_ip_address, custom_headers=None, raw=False, **operation_config): + """Creates a new firewall rule or updates an existing firewall rule. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param firewall_rule_name: The name of the server firewall rule. + :type firewall_rule_name: str + :param start_ip_address: The start IP address of the server firewall + rule. Must be IPv4 format. + :type start_ip_address: str + :param end_ip_address: The end IP address of the server firewall rule. + Must be IPv4 format. + :type end_ip_address: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns FirewallRule + or ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgres.models.FirewallRule] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + firewall_rule_name=firewall_rule_name, + start_ip_address=start_ip_address, + end_ip_address=end_ip_address, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = self._deserialize('FirewallRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + + + def _delete_initial( + self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): + """Deletes a server firewall rule. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param firewall_rule_name: The name of the server firewall rule. + :type firewall_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns None or + ClientRawResponse if raw=true + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + firewall_rule_name=firewall_rule_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + + def get( + self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): + """Gets information about a server firewall rule. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param firewall_rule_name: The name of the server firewall rule. + :type firewall_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: FirewallRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.rdbms.postgres.models.FirewallRule or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('FirewallRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def list_by_server( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """List all the firewall rules in a given server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of FirewallRule + :rtype: + ~azure.mgmt.rdbms.postgres.models.FirewallRulePaged[~azure.mgmt.rdbms.postgres.models.FirewallRule] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.FirewallRulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.FirewallRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/location_based_performance_tier_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/location_based_performance_tier_operations.py new file mode 100644 index 000000000000..b60199cfcb1f --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/location_based_performance_tier_operations.py @@ -0,0 +1,106 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class LocationBasedPerformanceTierOperations(object): + """LocationBasedPerformanceTierOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-04-30-preview" + + self.config = config + + def list( + self, location_name, custom_headers=None, raw=False, **operation_config): + """List all the performance tiers at specified location in a given + subscription. + + :param location_name: The name of the location. + :type location_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PerformanceTierProperties + :rtype: + ~azure.mgmt.rdbms.postgres.models.PerformanceTierPropertiesPaged[~azure.mgmt.rdbms.postgres.models.PerformanceTierProperties] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/performanceTiers' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'locationName': self._serialize.url("location_name", location_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PerformanceTierPropertiesPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PerformanceTierPropertiesPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/log_files_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/log_files_operations.py new file mode 100644 index 000000000000..676712bb0e85 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/log_files_operations.py @@ -0,0 +1,110 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class LogFilesOperations(object): + """LogFilesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-04-30-preview" + + self.config = config + + def list_by_server( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """List all the log files in a given server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of LogFile + :rtype: + ~azure.mgmt.rdbms.postgres.models.LogFilePaged[~azure.mgmt.rdbms.postgres.models.LogFile] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/logFiles' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.LogFilePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.LogFilePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/operations.py new file mode 100644 index 000000000000..4b04c106d89c --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/operations.py @@ -0,0 +1,89 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-04-30-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available REST API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.rdbms.postgres.models.OperationListResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = '/providers/Microsoft.DBforPostgreSQL/operations' + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/performance_tiers_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/performance_tiers_operations.py new file mode 100644 index 000000000000..49f897316d2e --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/performance_tiers_operations.py @@ -0,0 +1,102 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class PerformanceTiersOperations(object): + """PerformanceTiersOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-04-30-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List all the performance tiers in a given subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PerformanceTierProperties + :rtype: + ~azure.mgmt.rdbms.postgres.models.PerformanceTierPropertiesPaged[~azure.mgmt.rdbms.postgres.models.PerformanceTierProperties] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/performanceTiers' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.PerformanceTierPropertiesPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PerformanceTierPropertiesPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/servers_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/servers_operations.py new file mode 100644 index 000000000000..5ada82de6d44 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/servers_operations.py @@ -0,0 +1,579 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.exceptions import DeserializationError +from msrestazure.azure_operation import AzureOperationPoller + +from .. import models + + +class ServersOperations(object): + """ServersOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-04-30-preview" + + self.config = config + + + def _create_initial( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ServerForCreate') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Server', response) + if response.status_code == 201: + deserialized = self._deserialize('Server', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates a new server, or will overwrite an existing server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param parameters: The required parameters for creating or updating a + server. + :type parameters: ~azure.mgmt.rdbms.postgres.models.ServerForCreate + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns Server or + ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgres.models.Server] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + server_name=server_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = self._deserialize('Server', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + + + def _update_initial( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ServerUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Server', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): + """Updates an existing server. The request body can contain one to many of + the properties present in the normal server definition. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param parameters: The required parameters for updating a server. + :type parameters: + ~azure.mgmt.rdbms.postgres.models.ServerUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns Server or + ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgres.models.Server] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = self._deserialize('Server', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + + + def _delete_initial( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """Deletes a server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns None or + ClientRawResponse if raw=true + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + + def get( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """Gets information about a server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Server or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.rdbms.postgres.models.Server or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Server', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """List all the servers in a given resource group. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Server + :rtype: + ~azure.mgmt.rdbms.postgres.models.ServerPaged[~azure.mgmt.rdbms.postgres.models.Server] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ServerPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ServerPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List all the servers in a given subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Server + :rtype: + ~azure.mgmt.rdbms.postgres.models.ServerPaged[~azure.mgmt.rdbms.postgres.models.Server] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/servers' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ServerPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ServerPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/postgre_sql_management_client.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/postgre_sql_management_client.py new file mode 100644 index 000000000000..c4fca7fa5c09 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/postgre_sql_management_client.py @@ -0,0 +1,123 @@ +# 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 msrest.service_client import ServiceClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.servers_operations import ServersOperations +from .operations.firewall_rules_operations import FirewallRulesOperations +from .operations.databases_operations import DatabasesOperations +from .operations.configurations_operations import ConfigurationsOperations +from .operations.log_files_operations import LogFilesOperations +from .operations.performance_tiers_operations import PerformanceTiersOperations +from .operations.location_based_performance_tier_operations import LocationBasedPerformanceTierOperations +from .operations.check_name_availability_operations import CheckNameAvailabilityOperations +from .operations.operations import Operations +from . import models + + +class PostgreSQLManagementClientConfiguration(AzureConfiguration): + """Configuration for PostgreSQLManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The subscription ID that identifies an Azure + subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(PostgreSQLManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-rdbms/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class PostgreSQLManagementClient(object): + """The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, log files and configurations. + + :ivar config: Configuration for client. + :vartype config: PostgreSQLManagementClientConfiguration + + :ivar servers: Servers operations + :vartype servers: azure.mgmt.rdbms.postgres.operations.ServersOperations + :ivar firewall_rules: FirewallRules operations + :vartype firewall_rules: azure.mgmt.rdbms.postgres.operations.FirewallRulesOperations + :ivar databases: Databases operations + :vartype databases: azure.mgmt.rdbms.postgres.operations.DatabasesOperations + :ivar configurations: Configurations operations + :vartype configurations: azure.mgmt.rdbms.postgres.operations.ConfigurationsOperations + :ivar log_files: LogFiles operations + :vartype log_files: azure.mgmt.rdbms.postgres.operations.LogFilesOperations + :ivar performance_tiers: PerformanceTiers operations + :vartype performance_tiers: azure.mgmt.rdbms.postgres.operations.PerformanceTiersOperations + :ivar location_based_performance_tier: LocationBasedPerformanceTier operations + :vartype location_based_performance_tier: azure.mgmt.rdbms.postgres.operations.LocationBasedPerformanceTierOperations + :ivar check_name_availability: CheckNameAvailability operations + :vartype check_name_availability: azure.mgmt.rdbms.postgres.operations.CheckNameAvailabilityOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.rdbms.postgres.operations.Operations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The subscription ID that identifies an Azure + subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = PostgreSQLManagementClientConfiguration(credentials, subscription_id, base_url) + self._client = ServiceClient(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2017-04-30-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.servers = ServersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.firewall_rules = FirewallRulesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.databases = DatabasesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.configurations = ConfigurationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.log_files = LogFilesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.performance_tiers = PerformanceTiersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.location_based_performance_tier = LocationBasedPerformanceTierOperations( + self._client, self.config, self._serialize, self._deserialize) + self.check_name_availability = CheckNameAvailabilityOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/version.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/version.py new file mode 100644 index 000000000000..3c14a627134c --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "2017-04-30-preview" + From 4ea26e8c4ddd54734b067eaf40985ce30ea63a69 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 7 Feb 2018 08:23:11 +0000 Subject: [PATCH 2/7] Generated from e2f7f820f44e3a7848c5c0fa21e7a1e4c15cb57e Correct PG namespace and some other comment --- .../azure/mgmt/rdbms/postgresql/build.json | 183 --------- .../mgmt/rdbms/postgresql/models/__init__.py | 6 - .../postgresql/models/name_availability.py | 1 + .../models/name_availability_request.py | 1 + .../mgmt/rdbms/postgresql/models/operation.py | 1 + .../postgresql/models/operation_display.py | 1 + .../models/operation_list_result.py | 1 + .../models/performance_tier_properties.py | 1 + ...rformance_tier_service_level_objectives.py | 1 + .../postgre_sql_management_client_enums.py | 9 - .../rdbms/postgresql/models/proxy_resource.py | 1 + .../postgresql/models/server_for_create.py | 1 + .../models/server_properties_for_create.py | 1 + .../models/server_update_parameters.py | 1 + .../azure/mgmt/rdbms/postgresql/models/sku.py | 1 + .../postgresql/models/virtual_network_rule.py | 60 --- .../models/virtual_network_rule_paged.py | 27 -- .../rdbms/postgresql/operations/__init__.py | 2 - .../check_name_availability_operations.py | 4 +- .../operations/configurations_operations.py | 112 ++++-- .../operations/databases_operations.py | 195 ++++++---- .../operations/firewall_rules_operations.py | 199 ++++++---- ...ation_based_performance_tier_operations.py | 4 +- .../operations/log_files_operations.py | 4 +- .../rdbms/postgresql/operations/operations.py | 4 +- .../performance_tiers_operations.py | 4 +- .../operations/servers_operations.py | 283 +++++++++----- .../virtual_network_rules_operations.py | 362 ------------------ .../postgre_sql_management_client.py | 9 +- .../azure/mgmt/rdbms/postgresql/version.py | 2 +- 30 files changed, 535 insertions(+), 946 deletions(-) delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/build.json delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/virtual_network_rule.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/virtual_network_rule_paged.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/virtual_network_rules_operations.py diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/build.json b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/build.json deleted file mode 100644 index 49b3d941d03a..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/build.json +++ /dev/null @@ -1,183 +0,0 @@ -{ - "autorest": [ - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest-core", - "version": "2.0.4168", - "engines": { - "node": ">=7.10.0" - }, - "dependencies": {}, - "optionalDependencies": {}, - "devDependencies": { - "@microsoft.azure/async-io": "~1.0.22", - "@microsoft.azure/extension": "~1.2.12", - "@types/commonmark": "^0.27.0", - "@types/jsonpath": "^0.1.29", - "@types/node": "^8.0.28", - "@types/pify": "0.0.28", - "@types/source-map": "^0.5.0", - "@types/yargs": "^8.0.2", - "commonmark": "^0.27.0", - "file-url": "^2.0.2", - "get-uri": "^2.0.0", - "jsonpath": "^0.2.11", - "linq-es2015": "^2.4.25", - "mocha": "3.4.2", - "mocha-typescript": "1.1.5", - "pify": "^3.0.0", - "safe-eval": "^0.3.0", - "shx": "^0.2.2", - "source-map": "^0.5.6", - "source-map-support": "^0.4.15", - "strip-bom": "^3.0.0", - "typescript": "2.5.3", - "untildify": "^3.0.2", - "urijs": "^1.18.10", - "vscode-jsonrpc": "^3.3.1", - "yaml-ast-parser": "https://github.com/olydis/yaml-ast-parser/releases/download/0.0.34/yaml-ast-parser-0.0.34.tgz", - "yargs": "^8.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "_shasum": "33813111fc9bfa488bd600fbba48bc53cc9182c7", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest-core@2.0.4168", - "_from": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "_where": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest.modeler", - "version": "2.1.22", - "dependencies": { - "dotnet-2.0.0": "^1.4.4" - }, - "optionalDependencies": {}, - "devDependencies": { - "coffee-script": "^1.11.1", - "dotnet-sdk-2.0.0": "^1.4.4", - "gulp": "^3.9.1", - "gulp-filter": "^5.0.0", - "gulp-line-ending-corrector": "^1.0.1", - "iced-coffee-script": "^108.0.11", - "marked": "^0.3.6", - "marked-terminal": "^2.0.0", - "moment": "^2.17.1", - "run-sequence": "*", - "shx": "^0.2.2", - "through2-parallel": "^0.1.3", - "yargs": "^8.0.2", - "yarn": "^1.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "_shasum": "ca425289fa38a210d279729048a4a91673f09c67", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest.modeler@2.1.22", - "_from": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "_where": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest.python", - "version": "2.0.17", - "dependencies": { - "dotnet-2.0.0": "^1.4.4" - }, - "optionalDependencies": {}, - "devDependencies": { - "@microsoft.azure/autorest.testserver": "^1.9.0", - "autorest": "^2.0.0", - "coffee-script": "^1.11.1", - "dotnet-sdk-2.0.0": "^1.4.4", - "gulp": "^3.9.1", - "gulp-filter": "^5.0.0", - "gulp-line-ending-corrector": "^1.0.1", - "iced-coffee-script": "^108.0.11", - "marked": "^0.3.6", - "marked-terminal": "^2.0.0", - "moment": "^2.17.1", - "run-sequence": "*", - "shx": "^0.2.2", - "through2-parallel": "^0.1.3", - "yargs": "^8.0.2", - "yarn": "^1.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest.python@2.0.17/node_modules/@microsoft.azure/autorest.python", - "_shasum": "84a951c19c502343726cfe33cf43cefa76219b39", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest.python@2.0.17", - "_from": "file:/root/.autorest/@microsoft.azure_autorest.python@2.0.17/node_modules/@microsoft.azure/autorest.python", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest.python@2.0.17/node_modules/@microsoft.azure/autorest.python", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest.python@2.0.17/node_modules/@microsoft.azure/autorest.python", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.python@2.0.17/node_modules/@microsoft.azure/autorest.python", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.python@2.0.17/node_modules/@microsoft.azure/autorest.python" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest.python@2.0.17/node_modules/@microsoft.azure/autorest.python", - "_where": "/root/.autorest/@microsoft.azure_autorest.python@2.0.17/node_modules/@microsoft.azure/autorest.python" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - } - ], - "autorest_bootstrap": { - "dependencies": { - "autorest": { - "version": "2.0.4147", - "from": "autorest@latest", - "resolved": "https://registry.npmjs.org/autorest/-/autorest-2.0.4147.tgz" - } - } - }, - "date": "2017-10-16T17:40:39Z" -} \ No newline at end of file diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/__init__.py index 34b91001489f..9bc07a61b9c2 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/__init__.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/__init__.py @@ -19,7 +19,6 @@ from .server_for_create import ServerForCreate from .server_update_parameters import ServerUpdateParameters from .firewall_rule import FirewallRule -from .virtual_network_rule import VirtualNetworkRule from .database import Database from .configuration import Configuration from .operation_display import OperationDisplay @@ -32,7 +31,6 @@ from .name_availability import NameAvailability from .server_paged import ServerPaged from .firewall_rule_paged import FirewallRulePaged -from .virtual_network_rule_paged import VirtualNetworkRulePaged from .database_paged import DatabasePaged from .configuration_paged import ConfigurationPaged from .log_file_paged import LogFilePaged @@ -42,7 +40,6 @@ SslEnforcementEnum, ServerState, SkuTier, - VirtualNetworkRuleState, OperationOrigin, ) @@ -57,7 +54,6 @@ 'ServerForCreate', 'ServerUpdateParameters', 'FirewallRule', - 'VirtualNetworkRule', 'Database', 'Configuration', 'OperationDisplay', @@ -70,7 +66,6 @@ 'NameAvailability', 'ServerPaged', 'FirewallRulePaged', - 'VirtualNetworkRulePaged', 'DatabasePaged', 'ConfigurationPaged', 'LogFilePaged', @@ -79,6 +74,5 @@ 'SslEnforcementEnum', 'ServerState', 'SkuTier', - 'VirtualNetworkRuleState', 'OperationOrigin', ] diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/name_availability.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/name_availability.py index ec2551404d3b..b7759d8d4726 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/name_availability.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/name_availability.py @@ -30,6 +30,7 @@ class NameAvailability(Model): } def __init__(self, message=None, name_available=None, reason=None): + super(NameAvailability, self).__init__() self.message = message self.name_available = name_available self.reason = reason diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/name_availability_request.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/name_availability_request.py index 94a863c3554b..715b87ea3676 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/name_availability_request.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/name_availability_request.py @@ -31,5 +31,6 @@ class NameAvailabilityRequest(Model): } def __init__(self, name, type=None): + super(NameAvailabilityRequest, self).__init__() self.name = name self.type = type diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/operation.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/operation.py index ce4bb43004a3..c0ad896a743e 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/operation.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/operation.py @@ -47,6 +47,7 @@ class Operation(Model): } def __init__(self): + super(Operation, self).__init__() self.name = None self.display = None self.origin = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/operation_display.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/operation_display.py index 968daf77edd3..66b7f736d293 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/operation_display.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/operation_display.py @@ -43,6 +43,7 @@ class OperationDisplay(Model): } def __init__(self): + super(OperationDisplay, self).__init__() self.provider = None self.resource = None self.operation = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/operation_list_result.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/operation_list_result.py index 36521fedd9ed..b6521d80d2be 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/operation_list_result.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/operation_list_result.py @@ -24,4 +24,5 @@ class OperationListResult(Model): } def __init__(self, value=None): + super(OperationListResult, self).__init__() self.value = value diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/performance_tier_properties.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/performance_tier_properties.py index edc6dbb15572..96211f7f17ec 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/performance_tier_properties.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/performance_tier_properties.py @@ -33,6 +33,7 @@ class PerformanceTierProperties(Model): } def __init__(self, id=None, backup_retention_days=None, service_level_objectives=None): + super(PerformanceTierProperties, self).__init__() self.id = id self.backup_retention_days = backup_retention_days self.service_level_objectives = service_level_objectives diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/performance_tier_service_level_objectives.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/performance_tier_service_level_objectives.py index 72c5b74be4b1..7e2c98d7e24a 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/performance_tier_service_level_objectives.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/performance_tier_service_level_objectives.py @@ -35,6 +35,7 @@ class PerformanceTierServiceLevelObjectives(Model): } def __init__(self, id=None, edition=None, dtu=None, storage_mb=None): + super(PerformanceTierServiceLevelObjectives, self).__init__() self.id = id self.edition = edition self.dtu = dtu diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/postgre_sql_management_client_enums.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/postgre_sql_management_client_enums.py index 0ad7b32a369c..d539086044e1 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/postgre_sql_management_client_enums.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/postgre_sql_management_client_enums.py @@ -37,15 +37,6 @@ class SkuTier(Enum): standard = "Standard" -class VirtualNetworkRuleState(Enum): - - initializing = "Initializing" - in_progress = "InProgress" - ready = "Ready" - deleting = "Deleting" - unknown = "Unknown" - - class OperationOrigin(Enum): not_specified = "NotSpecified" diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/proxy_resource.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/proxy_resource.py index c71c9458d454..b982916c5e5b 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/proxy_resource.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/proxy_resource.py @@ -39,6 +39,7 @@ class ProxyResource(Model): } def __init__(self): + super(ProxyResource, self).__init__() self.id = None self.name = None self.type = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_for_create.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_for_create.py index 5878e34ed66b..3b28a60b632a 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_for_create.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_for_create.py @@ -39,6 +39,7 @@ class ServerForCreate(Model): } def __init__(self, properties, location, sku=None, tags=None): + super(ServerForCreate, self).__init__() self.sku = sku self.properties = properties self.location = location diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_create.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_create.py index e27fe44e5612..06d96cec5008 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_create.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_create.py @@ -48,6 +48,7 @@ class ServerPropertiesForCreate(Model): } def __init__(self, storage_mb=None, version=None, ssl_enforcement=None): + super(ServerPropertiesForCreate, self).__init__() self.storage_mb = storage_mb self.version = version self.ssl_enforcement = ssl_enforcement diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_update_parameters.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_update_parameters.py index f149b2080b10..568d5b11c290 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_update_parameters.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_update_parameters.py @@ -47,6 +47,7 @@ class ServerUpdateParameters(Model): } def __init__(self, sku=None, storage_mb=None, administrator_login_password=None, version=None, ssl_enforcement=None, tags=None): + super(ServerUpdateParameters, self).__init__() self.sku = sku self.storage_mb = storage_mb self.administrator_login_password = administrator_login_password diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/sku.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/sku.py index b08828ed1a03..f4e2846463ec 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/sku.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/sku.py @@ -43,6 +43,7 @@ class Sku(Model): } def __init__(self, name=None, tier=None, capacity=None, size=None, family=None): + super(Sku, self).__init__() self.name = name self.tier = tier self.capacity = capacity diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/virtual_network_rule.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/virtual_network_rule.py deleted file mode 100644 index 9e76bc7002ac..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/virtual_network_rule.py +++ /dev/null @@ -1,60 +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 .proxy_resource import ProxyResource - - -class VirtualNetworkRule(ProxyResource): - """A virtual network rule. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param virtual_network_subnet_id: The ARM resource id of the virtual - network subnet. - :type virtual_network_subnet_id: str - :param ignore_missing_vnet_service_endpoint: Create firewall rule before - the virtual network has vnet service endpoint enabled. - :type ignore_missing_vnet_service_endpoint: bool - :ivar state: Virtual Network Rule State. Possible values include: - 'Initializing', 'InProgress', 'Ready', 'Deleting', 'Unknown' - :vartype state: str or - ~azure.mgmt.rdbms.postgresql.models.VirtualNetworkRuleState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'virtual_network_subnet_id': {'required': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'virtual_network_subnet_id': {'key': 'properties.virtualNetworkSubnetId', 'type': 'str'}, - 'ignore_missing_vnet_service_endpoint': {'key': 'properties.ignoreMissingVnetServiceEndpoint', 'type': 'bool'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - } - - def __init__(self, virtual_network_subnet_id, ignore_missing_vnet_service_endpoint=None): - super(VirtualNetworkRule, self).__init__() - self.virtual_network_subnet_id = virtual_network_subnet_id - self.ignore_missing_vnet_service_endpoint = ignore_missing_vnet_service_endpoint - self.state = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/virtual_network_rule_paged.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/virtual_network_rule_paged.py deleted file mode 100644 index df6f247ff1a9..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/virtual_network_rule_paged.py +++ /dev/null @@ -1,27 +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 msrest.paging import Paged - - -class VirtualNetworkRulePaged(Paged): - """ - A paging container for iterating over a list of :class:`VirtualNetworkRule ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[VirtualNetworkRule]'} - } - - def __init__(self, *args, **kwargs): - - super(VirtualNetworkRulePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/__init__.py index 970bb5f9b83e..b45b52cd35c1 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/__init__.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/__init__.py @@ -11,7 +11,6 @@ from .servers_operations import ServersOperations from .firewall_rules_operations import FirewallRulesOperations -from .virtual_network_rules_operations import VirtualNetworkRulesOperations from .databases_operations import DatabasesOperations from .configurations_operations import ConfigurationsOperations from .log_files_operations import LogFilesOperations @@ -23,7 +22,6 @@ __all__ = [ 'ServersOperations', 'FirewallRulesOperations', - 'VirtualNetworkRulesOperations', 'DatabasesOperations', 'ConfigurationsOperations', 'LogFilesOperations', diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/check_name_availability_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/check_name_availability_operations.py index e223d1e39b80..d3ee625a4013 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/check_name_availability_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/check_name_availability_operations.py @@ -26,6 +26,8 @@ class CheckNameAvailabilityOperations(object): :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -82,7 +84,7 @@ def execute( # Construct and send request request = self._client.post(url, query_parameters) response = self._client.send( - request, header_parameters, body_content, **operation_config) + request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/configurations_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/configurations_operations.py index f9123d684c2b..cb5222d964f4 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/configurations_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/configurations_operations.py @@ -12,6 +12,7 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError +from msrest.exceptions import DeserializationError from msrestazure.azure_operation import AzureOperationPoller from .. import models @@ -27,6 +28,8 @@ class ConfigurationsOperations(object): :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -36,32 +39,9 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def create_or_update( - self, resource_group_name, server_name, configuration_name, value=None, source=None, custom_headers=None, raw=False, **operation_config): - """Updates a configuration of a server. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param configuration_name: The name of the server configuration. - :type configuration_name: str - :param value: Value of the configuration. - :type value: str - :param source: Source of the configuration. - :type source: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - Configuration or ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgresql.models.Configuration] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _create_or_update_initial( + self, resource_group_name, server_name, configuration_name, value=None, source=None, custom_headers=None, raw=False, **operation_config): parameters = models.Configuration(value=value, source=source) # Construct URL @@ -92,19 +72,78 @@ def create_or_update( body_content = self._serialize.body(parameters, 'Configuration') # Construct and send request - def long_running_send(): + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - request = self._client.put(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Configuration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, server_name, configuration_name, value=None, source=None, custom_headers=None, raw=False, **operation_config): + """Updates a configuration of a server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param configuration_name: The name of the server configuration. + :type configuration_name: str + :param value: Value of the configuration. + :type value: str + :param source: Source of the configuration. + :type source: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns + Configuration or ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgresql.models.Configuration] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + configuration_name=configuration_name, + value=value, + source=source, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] return self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): @@ -113,10 +152,7 @@ def get_long_running_output(response): exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Configuration', response) + deserialized = self._deserialize('Configuration', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -124,10 +160,6 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -183,7 +215,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -254,7 +286,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/databases_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/databases_operations.py index 3dfebedcbac9..6addc37915f2 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/databases_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/databases_operations.py @@ -12,6 +12,7 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError +from msrest.exceptions import DeserializationError from msrestazure.azure_operation import AzureOperationPoller from .. import models @@ -27,6 +28,8 @@ class DatabasesOperations(object): :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -36,32 +39,9 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def create_or_update( - self, resource_group_name, server_name, database_name, charset=None, collation=None, custom_headers=None, raw=False, **operation_config): - """Creates a new database or updates an existing database. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param charset: The charset of the database. - :type charset: str - :param collation: The collation of the database. - :type collation: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Database or - ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgresql.models.Database] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _create_or_update_initial( + self, resource_group_name, server_name, database_name, charset=None, collation=None, custom_headers=None, raw=False, **operation_config): parameters = models.Database(charset=charset, collation=collation) # Construct URL @@ -92,19 +72,80 @@ def create_or_update( body_content = self._serialize.body(parameters, 'Database') # Construct and send request - def long_running_send(): + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - request = self._client.put(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Database', response) + if response.status_code == 201: + deserialized = self._deserialize('Database', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, server_name, database_name, charset=None, collation=None, custom_headers=None, raw=False, **operation_config): + """Creates a new database or updates an existing database. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param charset: The charset of the database. + :type charset: str + :param collation: The collation of the database. + :type collation: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns Database or + ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgresql.models.Database] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + charset=charset, + collation=collation, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] return self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): @@ -113,12 +154,7 @@ def get_long_running_output(response): exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Database', response) - if response.status_code == 201: - deserialized = self._deserialize('Database', response) + deserialized = self._deserialize('Database', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -126,10 +162,6 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -137,27 +169,9 @@ def get_long_running_output(response): long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) - def delete( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - """Deletes a database. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _delete_initial( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases/{databaseName}' path_format_arguments = { @@ -183,18 +197,63 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - def long_running_send(): + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """Deletes a database. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns None or + ClientRawResponse if raw=true + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result - request = self._client.delete(url, query_parameters) - return self._client.send(request, header_parameters, **operation_config) + # Construct and send request + def long_running_send(): + return raw_result.response def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] return self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): @@ -207,10 +266,6 @@ def get_long_running_output(response): client_raw_response = ClientRawResponse(None, response) return client_raw_response - if raw: - response = long_running_send() - return get_long_running_output(response) - long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -266,7 +321,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -337,7 +392,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/firewall_rules_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/firewall_rules_operations.py index 166fb4688a78..bc57d5777e69 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/firewall_rules_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/firewall_rules_operations.py @@ -12,6 +12,7 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError +from msrest.exceptions import DeserializationError from msrestazure.azure_operation import AzureOperationPoller from .. import models @@ -27,6 +28,8 @@ class FirewallRulesOperations(object): :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -36,34 +39,9 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def create_or_update( - self, resource_group_name, server_name, firewall_rule_name, start_ip_address, end_ip_address, custom_headers=None, raw=False, **operation_config): - """Creates a new firewall rule or updates an existing firewall rule. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param firewall_rule_name: The name of the server firewall rule. - :type firewall_rule_name: str - :param start_ip_address: The start IP address of the server firewall - rule. Must be IPv4 format. - :type start_ip_address: str - :param end_ip_address: The end IP address of the server firewall rule. - Must be IPv4 format. - :type end_ip_address: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns FirewallRule - or ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgresql.models.FirewallRule] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _create_or_update_initial( + self, resource_group_name, server_name, firewall_rule_name, start_ip_address, end_ip_address, custom_headers=None, raw=False, **operation_config): parameters = models.FirewallRule(start_ip_address=start_ip_address, end_ip_address=end_ip_address) # Construct URL @@ -94,19 +72,82 @@ def create_or_update( body_content = self._serialize.body(parameters, 'FirewallRule') # Construct and send request - def long_running_send(): + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - request = self._client.put(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('FirewallRule', response) + if response.status_code == 201: + deserialized = self._deserialize('FirewallRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, server_name, firewall_rule_name, start_ip_address, end_ip_address, custom_headers=None, raw=False, **operation_config): + """Creates a new firewall rule or updates an existing firewall rule. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param firewall_rule_name: The name of the server firewall rule. + :type firewall_rule_name: str + :param start_ip_address: The start IP address of the server firewall + rule. Must be IPv4 format. + :type start_ip_address: str + :param end_ip_address: The end IP address of the server firewall rule. + Must be IPv4 format. + :type end_ip_address: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns FirewallRule + or ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgresql.models.FirewallRule] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + firewall_rule_name=firewall_rule_name, + start_ip_address=start_ip_address, + end_ip_address=end_ip_address, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] return self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): @@ -115,12 +156,7 @@ def get_long_running_output(response): exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('FirewallRule', response) - if response.status_code == 201: - deserialized = self._deserialize('FirewallRule', response) + deserialized = self._deserialize('FirewallRule', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -128,10 +164,6 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -139,27 +171,9 @@ def get_long_running_output(response): long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) - def delete( - self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): - """Deletes a server firewall rule. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param firewall_rule_name: The name of the server firewall rule. - :type firewall_rule_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _delete_initial( + self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}' path_format_arguments = { @@ -185,18 +199,63 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - def long_running_send(): + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) - request = self._client.delete(url, query_parameters) - return self._client.send(request, header_parameters, **operation_config) + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): + """Deletes a server firewall rule. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param firewall_rule_name: The name of the server firewall rule. + :type firewall_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns None or + ClientRawResponse if raw=true + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + firewall_rule_name=firewall_rule_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] return self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): @@ -209,10 +268,6 @@ def get_long_running_output(response): client_raw_response = ClientRawResponse(None, response) return client_raw_response - if raw: - response = long_running_send() - return get_long_running_output(response) - long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -268,7 +323,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -339,7 +394,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/location_based_performance_tier_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/location_based_performance_tier_operations.py index f2b15e76dc0b..5194ca976760 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/location_based_performance_tier_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/location_based_performance_tier_operations.py @@ -26,6 +26,8 @@ class LocationBasedPerformanceTierOperations(object): :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -84,7 +86,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/log_files_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/log_files_operations.py index 71dee330f20e..83780695cd06 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/log_files_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/log_files_operations.py @@ -26,6 +26,8 @@ class LogFilesOperations(object): :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -88,7 +90,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/operations.py index 5a8217358b8c..c42ff7ca4a89 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/operations.py @@ -26,6 +26,8 @@ class Operations(object): :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -68,7 +70,7 @@ def list( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/performance_tiers_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/performance_tiers_operations.py index c213a876d50b..e55e9ba7e45c 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/performance_tiers_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/performance_tiers_operations.py @@ -26,6 +26,8 @@ class PerformanceTiersOperations(object): :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -80,7 +82,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/servers_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/servers_operations.py index c3297da03542..e5423822a7db 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/servers_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/servers_operations.py @@ -12,6 +12,7 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError +from msrest.exceptions import DeserializationError from msrestazure.azure_operation import AzureOperationPoller from .. import models @@ -27,6 +28,8 @@ class ServersOperations(object): :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -36,29 +39,9 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def create( - self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): - """Creates a new server, or will overwrite an existing server. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param parameters: The required parameters for creating or updating a - server. - :type parameters: ~azure.mgmt.rdbms.postgresql.models.ServerForCreate - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Server or - ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgresql.models.Server] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _create_initial( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}' path_format_arguments = { @@ -86,19 +69,75 @@ def create( body_content = self._serialize.body(parameters, 'ServerForCreate') # Construct and send request - def long_running_send(): + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - request = self._client.put(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Server', response) + if response.status_code == 201: + deserialized = self._deserialize('Server', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates a new server, or will overwrite an existing server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param parameters: The required parameters for creating or updating a + server. + :type parameters: ~azure.mgmt.rdbms.postgresql.models.ServerForCreate + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns Server or + ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgresql.models.Server] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + server_name=server_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] return self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): @@ -107,12 +146,7 @@ def get_long_running_output(response): exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Server', response) - if response.status_code == 201: - deserialized = self._deserialize('Server', response) + deserialized = self._deserialize('Server', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -120,10 +154,6 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -131,30 +161,9 @@ def get_long_running_output(response): long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) - def update( - self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): - """Updates an existing server. The request body can contain one to many of - the properties present in the normal server definition. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param parameters: The required parameters for updating a server. - :type parameters: - ~azure.mgmt.rdbms.postgresql.models.ServerUpdateParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Server or - ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgresql.models.Server] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _update_initial( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}' path_format_arguments = { @@ -182,19 +191,74 @@ def update( body_content = self._serialize.body(parameters, 'ServerUpdateParameters') # Construct and send request - def long_running_send(): + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) - request = self._client.patch(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Server', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): + """Updates an existing server. The request body can contain one to many of + the properties present in the normal server definition. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param parameters: The required parameters for updating a server. + :type parameters: + ~azure.mgmt.rdbms.postgresql.models.ServerUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns Server or + ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgresql.models.Server] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] return self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): @@ -203,10 +267,7 @@ def get_long_running_output(response): exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Server', response) + deserialized = self._deserialize('Server', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -214,10 +275,6 @@ def get_long_running_output(response): return deserialized - if raw: - response = long_running_send() - return get_long_running_output(response) - long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -225,25 +282,9 @@ def get_long_running_output(response): long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) - def delete( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """Deletes a server. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _delete_initial( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}' path_format_arguments = { @@ -268,18 +309,60 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - def long_running_send(): + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """Deletes a server. - request = self._client.delete(url, query_parameters) - return self._client.send(request, header_parameters, **operation_config) + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns None or + ClientRawResponse if raw=true + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response def get_long_running_status(status_link, headers=None): request = self._client.get(status_link) if headers: request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] return self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): @@ -292,10 +375,6 @@ def get_long_running_output(response): client_raw_response = ClientRawResponse(None, response) return client_raw_response - if raw: - response = long_running_send() - return get_long_running_output(response) - long_running_operation_timeout = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -348,7 +427,7 @@ def get( # Construct and send request request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) + response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -416,7 +495,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -480,7 +559,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/virtual_network_rules_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/virtual_network_rules_operations.py deleted file mode 100644 index ef60139ff8cf..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/virtual_network_rules_operations.py +++ /dev/null @@ -1,362 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrestazure.azure_operation import AzureOperationPoller - -from .. import models - - -class VirtualNetworkRulesOperations(object): - """VirtualNetworkRulesOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". - """ - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-04-30-preview" - - self.config = config - - def get( - self, resource_group_name, server_name, virtual_network_rule_name, custom_headers=None, raw=False, **operation_config): - """Gets a virtual network rule. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param virtual_network_rule_name: The name of the virtual network - rule. - :type virtual_network_rule_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: VirtualNetworkRule or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.rdbms.postgresql.models.VirtualNetworkRule or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}' - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'virtualNetworkRuleName': self._serialize.url("virtual_network_rule_name", virtual_network_rule_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('VirtualNetworkRule', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, server_name, virtual_network_rule_name, virtual_network_subnet_id, ignore_missing_vnet_service_endpoint=None, custom_headers=None, raw=False, **operation_config): - """Creates or updates an existing virtual network rule. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param virtual_network_rule_name: The name of the virtual network - rule. - :type virtual_network_rule_name: str - :param virtual_network_subnet_id: The ARM resource id of the virtual - network subnet. - :type virtual_network_subnet_id: str - :param ignore_missing_vnet_service_endpoint: Create firewall rule - before the virtual network has vnet service endpoint enabled. - :type ignore_missing_vnet_service_endpoint: bool - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - VirtualNetworkRule or ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgresql.models.VirtualNetworkRule] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - parameters = models.VirtualNetworkRule(virtual_network_subnet_id=virtual_network_subnet_id, ignore_missing_vnet_service_endpoint=ignore_missing_vnet_service_endpoint) - - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}' - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'virtualNetworkRuleName': self._serialize.url("virtual_network_rule_name", virtual_network_rule_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'VirtualNetworkRule') - - # Construct and send request - def long_running_send(): - - request = self._client.put(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) - - def get_long_running_output(response): - - if response.status_code not in [200, 202, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('VirtualNetworkRule', response) - if response.status_code == 201: - deserialized = self._deserialize('VirtualNetworkRule', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) - - def delete( - self, resource_group_name, server_name, virtual_network_rule_name, custom_headers=None, raw=False, **operation_config): - """Deletes the virtual network rule with the given name. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param virtual_network_rule_name: The name of the virtual network - rule. - :type virtual_network_rule_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}' - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'virtualNetworkRuleName': self._serialize.url("virtual_network_rule_name", virtual_network_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - def long_running_send(): - - request = self._client.delete(url, query_parameters) - return self._client.send(request, header_parameters, **operation_config) - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) - - def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) - - def list_by_server( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """Gets a list of virtual network rules in a server. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of VirtualNetworkRule - :rtype: - ~azure.mgmt.rdbms.postgresql.models.VirtualNetworkRulePaged[~azure.mgmt.rdbms.postgresql.models.VirtualNetworkRule] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules' - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.VirtualNetworkRulePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.VirtualNetworkRulePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/postgre_sql_management_client.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/postgre_sql_management_client.py index 74599ba0cda9..98e51b58c84f 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/postgre_sql_management_client.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/postgre_sql_management_client.py @@ -15,7 +15,6 @@ from .version import VERSION from .operations.servers_operations import ServersOperations from .operations.firewall_rules_operations import FirewallRulesOperations -from .operations.virtual_network_rules_operations import VirtualNetworkRulesOperations from .operations.databases_operations import DatabasesOperations from .operations.configurations_operations import ConfigurationsOperations from .operations.log_files_operations import LogFilesOperations @@ -52,7 +51,7 @@ def __init__( super(PostgreSQLManagementClientConfiguration, self).__init__(base_url) - self.add_user_agent('postgresqlmanagementclient/{}'.format(VERSION)) + self.add_user_agent('azure-mgmt-rdbms/{}'.format(VERSION)) self.add_user_agent('Azure-SDK-For-Python') self.credentials = credentials @@ -60,7 +59,7 @@ def __init__( class PostgreSQLManagementClient(object): - """The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, log files and configurations. + """The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, log files and configurations. :ivar config: Configuration for client. :vartype config: PostgreSQLManagementClientConfiguration @@ -69,8 +68,6 @@ class PostgreSQLManagementClient(object): :vartype servers: azure.mgmt.rdbms.postgresql.operations.ServersOperations :ivar firewall_rules: FirewallRules operations :vartype firewall_rules: azure.mgmt.rdbms.postgresql.operations.FirewallRulesOperations - :ivar virtual_network_rules: VirtualNetworkRules operations - :vartype virtual_network_rules: azure.mgmt.rdbms.postgresql.operations.VirtualNetworkRulesOperations :ivar databases: Databases operations :vartype databases: azure.mgmt.rdbms.postgresql.operations.DatabasesOperations :ivar configurations: Configurations operations @@ -110,8 +107,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.firewall_rules = FirewallRulesOperations( self._client, self.config, self._serialize, self._deserialize) - self.virtual_network_rules = VirtualNetworkRulesOperations( - self._client, self.config, self._serialize, self._deserialize) self.databases = DatabasesOperations( self._client, self.config, self._serialize, self._deserialize) self.configurations = ConfigurationsOperations( diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/version.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/version.py index e0ec669828cb..3c14a627134c 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/version.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "2017-04-30-preview" From 1074d0449c5a821271cf23eb9e73875ba8a0282f Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 7 Feb 2018 22:56:19 +0000 Subject: [PATCH 3/7] Generated from 3a9029563b4559b1b33dbd46266a95d174acf118 Update Examples folder to examples --- .../azure/mgmt/rdbms/mysql/models/__init__.py | 6 ++ .../models/my_sql_management_client_enums.py | 9 +- .../models/performance_tier_properties.py | 25 +++-- ...rformance_tier_service_level_objectives.py | 21 ++-- .../azure/mgmt/rdbms/mysql/models/server.py | 16 +-- .../models/server_properties_for_create.py | 15 ++- .../server_properties_for_default_create.py | 11 +- .../server_properties_for_geo_restore.py | 48 +++++++++ .../models/server_properties_for_restore.py | 11 +- .../mysql/models/server_update_parameters.py | 14 +-- .../azure/mgmt/rdbms/mysql/models/sku.py | 6 +- .../rdbms/mysql/models/storage_profile.py | 38 +++++++ .../rdbms/mysql/my_sql_management_client.py | 9 +- .../mgmt/rdbms/mysql/operations/__init__.py | 2 - .../check_name_availability_operations.py | 4 +- .../operations/configurations_operations.py | 4 +- .../mysql/operations/databases_operations.py | 4 +- .../operations/firewall_rules_operations.py | 4 +- ...ation_based_performance_tier_operations.py | 4 +- .../mysql/operations/log_files_operations.py | 4 +- .../mgmt/rdbms/mysql/operations/operations.py | 4 +- .../performance_tiers_operations.py | 102 ------------------ .../mysql/operations/servers_operations.py | 10 +- .../azure/mgmt/rdbms/mysql/version.py | 2 +- .../mgmt/rdbms/postgresql/models/__init__.py | 6 ++ .../models/performance_tier_properties.py | 25 +++-- ...rformance_tier_service_level_objectives.py | 21 ++-- .../postgre_sql_management_client_enums.py | 6 ++ .../mgmt/rdbms/postgresql/models/server.py | 16 +-- .../models/server_properties_for_create.py | 15 ++- .../server_properties_for_default_create.py | 11 +- .../server_properties_for_geo_restore.py | 48 +++++++++ .../models/server_properties_for_restore.py | 11 +- .../models/server_update_parameters.py | 14 +-- .../azure/mgmt/rdbms/postgresql/models/sku.py | 4 +- .../postgresql/models/storage_profile.py | 38 +++++++ .../rdbms/postgresql/operations/__init__.py | 2 - .../check_name_availability_operations.py | 4 +- .../operations/configurations_operations.py | 4 +- .../operations/databases_operations.py | 4 +- .../operations/firewall_rules_operations.py | 4 +- ...ation_based_performance_tier_operations.py | 4 +- .../operations/log_files_operations.py | 4 +- .../rdbms/postgresql/operations/operations.py | 4 +- .../performance_tiers_operations.py | 102 ------------------ .../operations/servers_operations.py | 4 +- .../postgre_sql_management_client.py | 9 +- .../azure/mgmt/rdbms/postgresql/version.py | 2 +- 48 files changed, 366 insertions(+), 369 deletions(-) create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_geo_restore.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/storage_profile.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/performance_tiers_operations.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_geo_restore.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/storage_profile.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/performance_tiers_operations.py diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/__init__.py index 3a4c02db18cd..7eee4a037b3c 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/__init__.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/__init__.py @@ -11,9 +11,11 @@ from .proxy_resource import ProxyResource from .tracked_resource import TrackedResource +from .storage_profile import StorageProfile from .server_properties_for_create import ServerPropertiesForCreate from .server_properties_for_default_create import ServerPropertiesForDefaultCreate from .server_properties_for_restore import ServerPropertiesForRestore +from .server_properties_for_geo_restore import ServerPropertiesForGeoRestore from .sku import Sku from .server import Server from .server_for_create import ServerForCreate @@ -39,6 +41,7 @@ ServerVersion, SslEnforcementEnum, ServerState, + GeoRedundantBackup, SkuTier, OperationOrigin, ) @@ -46,9 +49,11 @@ __all__ = [ 'ProxyResource', 'TrackedResource', + 'StorageProfile', 'ServerPropertiesForCreate', 'ServerPropertiesForDefaultCreate', 'ServerPropertiesForRestore', + 'ServerPropertiesForGeoRestore', 'Sku', 'Server', 'ServerForCreate', @@ -73,6 +78,7 @@ 'ServerVersion', 'SslEnforcementEnum', 'ServerState', + 'GeoRedundantBackup', 'SkuTier', 'OperationOrigin', ] diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/my_sql_management_client_enums.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/my_sql_management_client_enums.py index 4ab8a535a65d..c1d7935c0459 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/my_sql_management_client_enums.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/my_sql_management_client_enums.py @@ -31,10 +31,17 @@ class ServerState(Enum): disabled = "Disabled" +class GeoRedundantBackup(Enum): + + enabled = "Enabled" + disabled = "Disabled" + + class SkuTier(Enum): basic = "Basic" - standard = "Standard" + general_purpose = "GeneralPurpose" + memory_optimized = "MemoryOptimized" class OperationOrigin(Enum): diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/performance_tier_properties.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/performance_tier_properties.py index 473d0b73ffc4..36a99895f4ca 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/performance_tier_properties.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/performance_tier_properties.py @@ -17,9 +17,16 @@ class PerformanceTierProperties(Model): :param id: ID of the performance tier. :type id: str - :param backup_retention_days: Backup retention in days for the performance - tier edition - :type backup_retention_days: int + :param max_backup_retention_days: Maximum Backup retention in days for the + performance tier edition + :type max_backup_retention_days: int + :param min_backup_retention_days: Minimum Backup retention in days for the + performance tier edition + :type min_backup_retention_days: int + :param max_storage_mb: Max storage allowed for a server. + :type max_storage_mb: int + :param min_storage_mb: Max storage allowed for a server. + :type min_storage_mb: int :param service_level_objectives: Service level objectives associated with the performance tier :type service_level_objectives: @@ -28,12 +35,18 @@ class PerformanceTierProperties(Model): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'}, + 'max_backup_retention_days': {'key': 'maxBackupRetentionDays', 'type': 'int'}, + 'min_backup_retention_days': {'key': 'minBackupRetentionDays', 'type': 'int'}, + 'max_storage_mb': {'key': 'maxStorageMB', 'type': 'int'}, + 'min_storage_mb': {'key': 'minStorageMB', 'type': 'int'}, 'service_level_objectives': {'key': 'serviceLevelObjectives', 'type': '[PerformanceTierServiceLevelObjectives]'}, } - def __init__(self, id=None, backup_retention_days=None, service_level_objectives=None): + def __init__(self, id=None, max_backup_retention_days=None, min_backup_retention_days=None, max_storage_mb=None, min_storage_mb=None, service_level_objectives=None): super(PerformanceTierProperties, self).__init__() self.id = id - self.backup_retention_days = backup_retention_days + self.max_backup_retention_days = max_backup_retention_days + self.min_backup_retention_days = min_backup_retention_days + self.max_storage_mb = max_storage_mb + self.min_storage_mb = min_storage_mb self.service_level_objectives = service_level_objectives diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/performance_tier_service_level_objectives.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/performance_tier_service_level_objectives.py index 7e2c98d7e24a..96ba9e7c889c 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/performance_tier_service_level_objectives.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/performance_tier_service_level_objectives.py @@ -19,24 +19,23 @@ class PerformanceTierServiceLevelObjectives(Model): :type id: str :param edition: Edition of the performance tier. :type edition: str - :param dtu: Database throughput unit associated with the service level - objective - :type dtu: int - :param storage_mb: Maximum storage in MB associated with the service level - objective - :type storage_mb: int + :param v_core: vCore associated with the service level objective + :type v_core: int + :param hardware_generation: Hardware generation associated with the + service level objective + :type hardware_generation: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'edition': {'key': 'edition', 'type': 'str'}, - 'dtu': {'key': 'dtu', 'type': 'int'}, - 'storage_mb': {'key': 'storageMB', 'type': 'int'}, + 'v_core': {'key': 'vCore', 'type': 'int'}, + 'hardware_generation': {'key': 'hardwareGeneration', 'type': 'str'}, } - def __init__(self, id=None, edition=None, dtu=None, storage_mb=None): + def __init__(self, id=None, edition=None, v_core=None, hardware_generation=None): super(PerformanceTierServiceLevelObjectives, self).__init__() self.id = id self.edition = edition - self.dtu = dtu - self.storage_mb = storage_mb + self.v_core = v_core + self.hardware_generation = hardware_generation diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server.py index bcd0d71985c8..46e114056c51 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server.py @@ -34,8 +34,6 @@ class Server(TrackedResource): Can only be specified when the server is being created (and is required for creation). :type administrator_login: str - :param storage_mb: The maximum storage allowed for a server. - :type storage_mb: long :param version: Server version. Possible values include: '5.6', '5.7' :type version: str or ~azure.mgmt.rdbms.mysql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to @@ -49,6 +47,11 @@ class Server(TrackedResource): :param fully_qualified_domain_name: The fully qualified domain name of a server. :type fully_qualified_domain_name: str + :param earliest_restore_date: Earliest restore point creation time + (ISO8601 format) + :type earliest_restore_date: datetime + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.mysql.models.StorageProfile """ _validation = { @@ -56,7 +59,6 @@ class Server(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'storage_mb': {'minimum': 1024}, } _attribute_map = { @@ -67,19 +69,21 @@ class Server(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'Sku'}, 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, - 'storage_mb': {'key': 'properties.storageMB', 'type': 'long'}, 'version': {'key': 'properties.version', 'type': 'str'}, 'ssl_enforcement': {'key': 'properties.sslEnforcement', 'type': 'SslEnforcementEnum'}, 'user_visible_state': {'key': 'properties.userVisibleState', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, + 'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, } - def __init__(self, location, tags=None, sku=None, administrator_login=None, storage_mb=None, version=None, ssl_enforcement=None, user_visible_state=None, fully_qualified_domain_name=None): + def __init__(self, location, tags=None, sku=None, administrator_login=None, version=None, ssl_enforcement=None, user_visible_state=None, fully_qualified_domain_name=None, earliest_restore_date=None, storage_profile=None): super(Server, self).__init__(location=location, tags=tags) self.sku = sku self.administrator_login = administrator_login - self.storage_mb = storage_mb self.version = version self.ssl_enforcement = ssl_enforcement self.user_visible_state = user_visible_state self.fully_qualified_domain_name = fully_qualified_domain_name + self.earliest_restore_date = earliest_restore_date + self.storage_profile = storage_profile diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_create.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_create.py index 04b1aa2b9648..fb22126068fc 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_create.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_create.py @@ -17,39 +17,38 @@ class ServerPropertiesForCreate(Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ServerPropertiesForDefaultCreate, - ServerPropertiesForRestore + ServerPropertiesForRestore, ServerPropertiesForGeoRestore - :param storage_mb: The maximum storage allowed for a server. - :type storage_mb: long :param version: Server version. Possible values include: '5.6', '5.7' :type version: str or ~azure.mgmt.rdbms.mysql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' :type ssl_enforcement: str or ~azure.mgmt.rdbms.mysql.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.mysql.models.StorageProfile :param create_mode: Constant filled by server. :type create_mode: str """ _validation = { - 'storage_mb': {'minimum': 1024}, 'create_mode': {'required': True}, } _attribute_map = { - 'storage_mb': {'key': 'storageMB', 'type': 'long'}, 'version': {'key': 'version', 'type': 'str'}, 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, 'create_mode': {'key': 'createMode', 'type': 'str'}, } _subtype_map = { - 'create_mode': {'Default': 'ServerPropertiesForDefaultCreate', 'PointInTimeRestore': 'ServerPropertiesForRestore'} + 'create_mode': {'Default': 'ServerPropertiesForDefaultCreate', 'PointInTimeRestore': 'ServerPropertiesForRestore', 'GeoRestore': 'ServerPropertiesForGeoRestore'} } - def __init__(self, storage_mb=None, version=None, ssl_enforcement=None): + def __init__(self, version=None, ssl_enforcement=None, storage_profile=None): super(ServerPropertiesForCreate, self).__init__() - self.storage_mb = storage_mb self.version = version self.ssl_enforcement = ssl_enforcement + self.storage_profile = storage_profile self.create_mode = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_default_create.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_default_create.py index b4aad6816f08..5421c3059e47 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_default_create.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_default_create.py @@ -15,14 +15,14 @@ class ServerPropertiesForDefaultCreate(ServerPropertiesForCreate): """The properties used to create a new server. - :param storage_mb: The maximum storage allowed for a server. - :type storage_mb: long :param version: Server version. Possible values include: '5.6', '5.7' :type version: str or ~azure.mgmt.rdbms.mysql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' :type ssl_enforcement: str or ~azure.mgmt.rdbms.mysql.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.mysql.models.StorageProfile :param create_mode: Constant filled by server. :type create_mode: str :param administrator_login: The administrator's login name of a server. @@ -35,23 +35,22 @@ class ServerPropertiesForDefaultCreate(ServerPropertiesForCreate): """ _validation = { - 'storage_mb': {'minimum': 1024}, 'create_mode': {'required': True}, 'administrator_login': {'required': True}, 'administrator_login_password': {'required': True}, } _attribute_map = { - 'storage_mb': {'key': 'storageMB', 'type': 'long'}, 'version': {'key': 'version', 'type': 'str'}, 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, 'create_mode': {'key': 'createMode', 'type': 'str'}, 'administrator_login': {'key': 'administratorLogin', 'type': 'str'}, 'administrator_login_password': {'key': 'administratorLoginPassword', 'type': 'str'}, } - def __init__(self, administrator_login, administrator_login_password, storage_mb=None, version=None, ssl_enforcement=None): - super(ServerPropertiesForDefaultCreate, self).__init__(storage_mb=storage_mb, version=version, ssl_enforcement=ssl_enforcement) + def __init__(self, administrator_login, administrator_login_password, version=None, ssl_enforcement=None, storage_profile=None): + super(ServerPropertiesForDefaultCreate, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile) self.administrator_login = administrator_login self.administrator_login_password = administrator_login_password self.create_mode = 'Default' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_geo_restore.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_geo_restore.py new file mode 100644 index 000000000000..cb74a4564d80 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_geo_restore.py @@ -0,0 +1,48 @@ +# 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 .server_properties_for_create import ServerPropertiesForCreate + + +class ServerPropertiesForGeoRestore(ServerPropertiesForCreate): + """The properties to a new server by restoring from a geo replicated backup. + + :param version: Server version. Possible values include: '5.6', '5.7' + :type version: str or ~azure.mgmt.rdbms.mysql.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.mysql.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.mysql.models.StorageProfile + :param create_mode: Constant filled by server. + :type create_mode: str + :param source_server_id: The source server id to restore from. + :type source_server_id: str + """ + + _validation = { + 'create_mode': {'required': True}, + 'source_server_id': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'source_server_id': {'key': 'sourceServerId', 'type': 'str'}, + } + + def __init__(self, source_server_id, version=None, ssl_enforcement=None, storage_profile=None): + super(ServerPropertiesForGeoRestore, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile) + self.source_server_id = source_server_id + self.create_mode = 'GeoRestore' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_restore.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_restore.py index 3e3eed115255..e43bfce7aa65 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_restore.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_properties_for_restore.py @@ -15,14 +15,14 @@ class ServerPropertiesForRestore(ServerPropertiesForCreate): """The properties to a new server by restoring from a backup. - :param storage_mb: The maximum storage allowed for a server. - :type storage_mb: long :param version: Server version. Possible values include: '5.6', '5.7' :type version: str or ~azure.mgmt.rdbms.mysql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' :type ssl_enforcement: str or ~azure.mgmt.rdbms.mysql.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.mysql.models.StorageProfile :param create_mode: Constant filled by server. :type create_mode: str :param source_server_id: The source server id to restore from. @@ -33,23 +33,22 @@ class ServerPropertiesForRestore(ServerPropertiesForCreate): """ _validation = { - 'storage_mb': {'minimum': 1024}, 'create_mode': {'required': True}, 'source_server_id': {'required': True}, 'restore_point_in_time': {'required': True}, } _attribute_map = { - 'storage_mb': {'key': 'storageMB', 'type': 'long'}, 'version': {'key': 'version', 'type': 'str'}, 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, 'create_mode': {'key': 'createMode', 'type': 'str'}, 'source_server_id': {'key': 'sourceServerId', 'type': 'str'}, 'restore_point_in_time': {'key': 'restorePointInTime', 'type': 'iso-8601'}, } - def __init__(self, source_server_id, restore_point_in_time, storage_mb=None, version=None, ssl_enforcement=None): - super(ServerPropertiesForRestore, self).__init__(storage_mb=storage_mb, version=version, ssl_enforcement=ssl_enforcement) + def __init__(self, source_server_id, restore_point_in_time, version=None, ssl_enforcement=None, storage_profile=None): + super(ServerPropertiesForRestore, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile) self.source_server_id = source_server_id self.restore_point_in_time = restore_point_in_time self.create_mode = 'PointInTimeRestore' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_update_parameters.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_update_parameters.py index 182c974b2c4e..5da1465629fe 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_update_parameters.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/server_update_parameters.py @@ -17,8 +17,8 @@ class ServerUpdateParameters(Model): :param sku: The SKU (pricing tier) of the server. :type sku: ~azure.mgmt.rdbms.mysql.models.Sku - :param storage_mb: The max storage allowed for a server. - :type storage_mb: long + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.mysql.models.StorageProfile :param administrator_login_password: The password of the administrator login. :type administrator_login_password: str @@ -33,23 +33,19 @@ class ServerUpdateParameters(Model): :type tags: dict[str, str] """ - _validation = { - 'storage_mb': {'minimum': 1024}, - } - _attribute_map = { 'sku': {'key': 'sku', 'type': 'Sku'}, - 'storage_mb': {'key': 'properties.storageMB', 'type': 'long'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, 'version': {'key': 'properties.version', 'type': 'str'}, 'ssl_enforcement': {'key': 'properties.sslEnforcement', 'type': 'SslEnforcementEnum'}, 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, sku=None, storage_mb=None, administrator_login_password=None, version=None, ssl_enforcement=None, tags=None): + def __init__(self, sku=None, storage_profile=None, administrator_login_password=None, version=None, ssl_enforcement=None, tags=None): super(ServerUpdateParameters, self).__init__() self.sku = sku - self.storage_mb = storage_mb + self.storage_profile = storage_profile self.administrator_login_password = administrator_login_password self.version = version self.ssl_enforcement = ssl_enforcement diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/sku.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/sku.py index 2ac58be3f25d..480a830a4988 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/sku.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/sku.py @@ -15,11 +15,11 @@ class Sku(Model): """Billing information related properties of a server. - :param name: The name of the sku, typically, a letter + Number code, e.g. - P3. + :param name: The name of the sku, typically, tier + family + cores, e.g. + B_Gen4_1, GP_Gen5_8. :type name: str :param tier: The tier of the particular SKU, e.g. Basic. Possible values - include: 'Basic', 'Standard' + include: 'Basic', 'GeneralPurpose', 'MemoryOptimized' :type tier: str or ~azure.mgmt.rdbms.mysql.models.SkuTier :param capacity: The scale up/out capacity, representing server's compute units. diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/storage_profile.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/storage_profile.py new file mode 100644 index 000000000000..1bc8092ae4b2 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/storage_profile.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class StorageProfile(Model): + """Storage Profile properties of a server. + + :param backup_retention_days: Backup retention days for the server. + :type backup_retention_days: int + :param geo_redundant_backup: Enable Geo-redundant or not for server + backup. Possible values include: 'Enabled', 'Disabled' + :type geo_redundant_backup: str or + ~azure.mgmt.rdbms.mysql.models.GeoRedundantBackup + :param storage_mb: Max storage allowed for a server. + :type storage_mb: int + """ + + _attribute_map = { + 'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'}, + 'geo_redundant_backup': {'key': 'geoRedundantBackup', 'type': 'str'}, + 'storage_mb': {'key': 'storageMB', 'type': 'int'}, + } + + def __init__(self, backup_retention_days=None, geo_redundant_backup=None, storage_mb=None): + super(StorageProfile, self).__init__() + self.backup_retention_days = backup_retention_days + self.geo_redundant_backup = geo_redundant_backup + self.storage_mb = storage_mb diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/my_sql_management_client.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/my_sql_management_client.py index 3bccabe8ba76..36dbfea74dfd 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/my_sql_management_client.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/my_sql_management_client.py @@ -18,7 +18,6 @@ from .operations.databases_operations import DatabasesOperations from .operations.configurations_operations import ConfigurationsOperations from .operations.log_files_operations import LogFilesOperations -from .operations.performance_tiers_operations import PerformanceTiersOperations from .operations.location_based_performance_tier_operations import LocationBasedPerformanceTierOperations from .operations.check_name_availability_operations import CheckNameAvailabilityOperations from .operations.operations import Operations @@ -59,7 +58,7 @@ def __init__( class MySQLManagementClient(object): - """The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, log files and configurations. + """The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, log files and configurations with new business model. :ivar config: Configuration for client. :vartype config: MySQLManagementClientConfiguration @@ -74,8 +73,6 @@ class MySQLManagementClient(object): :vartype configurations: azure.mgmt.rdbms.mysql.operations.ConfigurationsOperations :ivar log_files: LogFiles operations :vartype log_files: azure.mgmt.rdbms.mysql.operations.LogFilesOperations - :ivar performance_tiers: PerformanceTiers operations - :vartype performance_tiers: azure.mgmt.rdbms.mysql.operations.PerformanceTiersOperations :ivar location_based_performance_tier: LocationBasedPerformanceTier operations :vartype location_based_performance_tier: azure.mgmt.rdbms.mysql.operations.LocationBasedPerformanceTierOperations :ivar check_name_availability: CheckNameAvailability operations @@ -99,7 +96,7 @@ def __init__( self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2017-04-30-preview' + self.api_version = '2017-12-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -113,8 +110,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.log_files = LogFilesOperations( self._client, self.config, self._serialize, self._deserialize) - self.performance_tiers = PerformanceTiersOperations( - self._client, self.config, self._serialize, self._deserialize) self.location_based_performance_tier = LocationBasedPerformanceTierOperations( self._client, self.config, self._serialize, self._deserialize) self.check_name_availability = CheckNameAvailabilityOperations( diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/__init__.py index b45b52cd35c1..323618c0dd5f 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/__init__.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/__init__.py @@ -14,7 +14,6 @@ from .databases_operations import DatabasesOperations from .configurations_operations import ConfigurationsOperations from .log_files_operations import LogFilesOperations -from .performance_tiers_operations import PerformanceTiersOperations from .location_based_performance_tier_operations import LocationBasedPerformanceTierOperations from .check_name_availability_operations import CheckNameAvailabilityOperations from .operations import Operations @@ -25,7 +24,6 @@ 'DatabasesOperations', 'ConfigurationsOperations', 'LogFilesOperations', - 'PerformanceTiersOperations', 'LocationBasedPerformanceTierOperations', 'CheckNameAvailabilityOperations', 'Operations', diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/check_name_availability_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/check_name_availability_operations.py index f16c1b618b74..6c71fbfcb60b 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/check_name_availability_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/check_name_availability_operations.py @@ -23,7 +23,7 @@ class CheckNameAvailabilityOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/configurations_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/configurations_operations.py index 3bba375da8a6..4daae542f0fb 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/configurations_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/configurations_operations.py @@ -25,7 +25,7 @@ class ConfigurationsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/databases_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/databases_operations.py index 511955374415..8bec63a4b5e9 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/databases_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/databases_operations.py @@ -25,7 +25,7 @@ class DatabasesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/firewall_rules_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/firewall_rules_operations.py index f4ec781d3f3f..7331bde2dc78 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/firewall_rules_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/firewall_rules_operations.py @@ -25,7 +25,7 @@ class FirewallRulesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/location_based_performance_tier_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/location_based_performance_tier_operations.py index 9e558d349a76..f4a79e1fe34f 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/location_based_performance_tier_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/location_based_performance_tier_operations.py @@ -23,7 +23,7 @@ class LocationBasedPerformanceTierOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/log_files_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/log_files_operations.py index a174a8dede20..f0b57836dd0b 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/log_files_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/log_files_operations.py @@ -23,7 +23,7 @@ class LogFilesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/operations.py index 886dbb2ca71e..0f5412dadd46 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/operations.py @@ -23,7 +23,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/performance_tiers_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/performance_tiers_operations.py deleted file mode 100644 index 03b5bdec4176..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/performance_tiers_operations.py +++ /dev/null @@ -1,102 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class PerformanceTiersOperations(object): - """PerformanceTiersOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-04-30-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """List all the performance tiers in a given subscription. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of PerformanceTierProperties - :rtype: - ~azure.mgmt.rdbms.mysql.models.PerformanceTierPropertiesPaged[~azure.mgmt.rdbms.mysql.models.PerformanceTierProperties] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/performanceTiers' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.PerformanceTierPropertiesPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.PerformanceTierPropertiesPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/servers_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/servers_operations.py index 3d24e85f3588..59c12629bbdb 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/servers_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/servers_operations.py @@ -25,7 +25,7 @@ class ServersOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -35,12 +35,12 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config - def _create_or_update_initial( + def _create_initial( self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}' @@ -91,7 +91,7 @@ def _create_or_update_initial( return deserialized - def create_or_update( + def create( self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): """Creates a new server or updates an existing server. The update action will overwrite the existing server. @@ -115,7 +115,7 @@ def create_or_update( or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - raw_result = self._create_or_update_initial( + raw_result = self._create_initial( resource_group_name=resource_group_name, server_name=server_name, parameters=parameters, diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/version.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/version.py index 3c14a627134c..d2d4445f16cf 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/version.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "2017-04-30-preview" +VERSION = "2017-12-01-preview" diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/__init__.py index 9bc07a61b9c2..95ce897ede1f 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/__init__.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/__init__.py @@ -11,9 +11,11 @@ from .proxy_resource import ProxyResource from .tracked_resource import TrackedResource +from .storage_profile import StorageProfile from .server_properties_for_create import ServerPropertiesForCreate from .server_properties_for_default_create import ServerPropertiesForDefaultCreate from .server_properties_for_restore import ServerPropertiesForRestore +from .server_properties_for_geo_restore import ServerPropertiesForGeoRestore from .sku import Sku from .server import Server from .server_for_create import ServerForCreate @@ -39,6 +41,7 @@ ServerVersion, SslEnforcementEnum, ServerState, + GeoRedundantBackup, SkuTier, OperationOrigin, ) @@ -46,9 +49,11 @@ __all__ = [ 'ProxyResource', 'TrackedResource', + 'StorageProfile', 'ServerPropertiesForCreate', 'ServerPropertiesForDefaultCreate', 'ServerPropertiesForRestore', + 'ServerPropertiesForGeoRestore', 'Sku', 'Server', 'ServerForCreate', @@ -73,6 +78,7 @@ 'ServerVersion', 'SslEnforcementEnum', 'ServerState', + 'GeoRedundantBackup', 'SkuTier', 'OperationOrigin', ] diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/performance_tier_properties.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/performance_tier_properties.py index 96211f7f17ec..f9cab7e5fbe8 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/performance_tier_properties.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/performance_tier_properties.py @@ -17,9 +17,16 @@ class PerformanceTierProperties(Model): :param id: ID of the performance tier. :type id: str - :param backup_retention_days: Backup retention in days for the performance - tier edition - :type backup_retention_days: int + :param max_backup_retention_days: Maximum Backup retention in days for the + performance tier edition + :type max_backup_retention_days: int + :param min_backup_retention_days: Minimum Backup retention in days for the + performance tier edition + :type min_backup_retention_days: int + :param max_storage_mb: Max storage allowed for a server. + :type max_storage_mb: int + :param min_storage_mb: Max storage allowed for a server. + :type min_storage_mb: int :param service_level_objectives: Service level objectives associated with the performance tier :type service_level_objectives: @@ -28,12 +35,18 @@ class PerformanceTierProperties(Model): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'}, + 'max_backup_retention_days': {'key': 'maxBackupRetentionDays', 'type': 'int'}, + 'min_backup_retention_days': {'key': 'minBackupRetentionDays', 'type': 'int'}, + 'max_storage_mb': {'key': 'maxStorageMB', 'type': 'int'}, + 'min_storage_mb': {'key': 'minStorageMB', 'type': 'int'}, 'service_level_objectives': {'key': 'serviceLevelObjectives', 'type': '[PerformanceTierServiceLevelObjectives]'}, } - def __init__(self, id=None, backup_retention_days=None, service_level_objectives=None): + def __init__(self, id=None, max_backup_retention_days=None, min_backup_retention_days=None, max_storage_mb=None, min_storage_mb=None, service_level_objectives=None): super(PerformanceTierProperties, self).__init__() self.id = id - self.backup_retention_days = backup_retention_days + self.max_backup_retention_days = max_backup_retention_days + self.min_backup_retention_days = min_backup_retention_days + self.max_storage_mb = max_storage_mb + self.min_storage_mb = min_storage_mb self.service_level_objectives = service_level_objectives diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/performance_tier_service_level_objectives.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/performance_tier_service_level_objectives.py index 7e2c98d7e24a..96ba9e7c889c 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/performance_tier_service_level_objectives.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/performance_tier_service_level_objectives.py @@ -19,24 +19,23 @@ class PerformanceTierServiceLevelObjectives(Model): :type id: str :param edition: Edition of the performance tier. :type edition: str - :param dtu: Database throughput unit associated with the service level - objective - :type dtu: int - :param storage_mb: Maximum storage in MB associated with the service level - objective - :type storage_mb: int + :param v_core: vCore associated with the service level objective + :type v_core: int + :param hardware_generation: Hardware generation associated with the + service level objective + :type hardware_generation: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'edition': {'key': 'edition', 'type': 'str'}, - 'dtu': {'key': 'dtu', 'type': 'int'}, - 'storage_mb': {'key': 'storageMB', 'type': 'int'}, + 'v_core': {'key': 'vCore', 'type': 'int'}, + 'hardware_generation': {'key': 'hardwareGeneration', 'type': 'str'}, } - def __init__(self, id=None, edition=None, dtu=None, storage_mb=None): + def __init__(self, id=None, edition=None, v_core=None, hardware_generation=None): super(PerformanceTierServiceLevelObjectives, self).__init__() self.id = id self.edition = edition - self.dtu = dtu - self.storage_mb = storage_mb + self.v_core = v_core + self.hardware_generation = hardware_generation diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/postgre_sql_management_client_enums.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/postgre_sql_management_client_enums.py index d539086044e1..ccaa28a4ddad 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/postgre_sql_management_client_enums.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/postgre_sql_management_client_enums.py @@ -31,6 +31,12 @@ class ServerState(Enum): disabled = "Disabled" +class GeoRedundantBackup(Enum): + + enabled = "Enabled" + disabled = "Disabled" + + class SkuTier(Enum): basic = "Basic" diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server.py index d82e78f891de..c7bc6e3e1a6a 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server.py @@ -34,8 +34,6 @@ class Server(TrackedResource): Can only be specified when the server is being created (and is required for creation). :type administrator_login: str - :param storage_mb: The maximum storage allowed for a server. - :type storage_mb: long :param version: Server version. Possible values include: '9.5', '9.6' :type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to @@ -49,6 +47,11 @@ class Server(TrackedResource): :param fully_qualified_domain_name: The fully qualified domain name of a server. :type fully_qualified_domain_name: str + :param earliest_restore_date: Earliest restore point creation time + (ISO8601 format) + :type earliest_restore_date: datetime + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.postgresql.models.StorageProfile """ _validation = { @@ -56,7 +59,6 @@ class Server(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'storage_mb': {'minimum': 1024}, } _attribute_map = { @@ -67,19 +69,21 @@ class Server(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'Sku'}, 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, - 'storage_mb': {'key': 'properties.storageMB', 'type': 'long'}, 'version': {'key': 'properties.version', 'type': 'str'}, 'ssl_enforcement': {'key': 'properties.sslEnforcement', 'type': 'SslEnforcementEnum'}, 'user_visible_state': {'key': 'properties.userVisibleState', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, + 'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, } - def __init__(self, location, tags=None, sku=None, administrator_login=None, storage_mb=None, version=None, ssl_enforcement=None, user_visible_state=None, fully_qualified_domain_name=None): + def __init__(self, location, tags=None, sku=None, administrator_login=None, version=None, ssl_enforcement=None, user_visible_state=None, fully_qualified_domain_name=None, earliest_restore_date=None, storage_profile=None): super(Server, self).__init__(location=location, tags=tags) self.sku = sku self.administrator_login = administrator_login - self.storage_mb = storage_mb self.version = version self.ssl_enforcement = ssl_enforcement self.user_visible_state = user_visible_state self.fully_qualified_domain_name = fully_qualified_domain_name + self.earliest_restore_date = earliest_restore_date + self.storage_profile = storage_profile diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_create.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_create.py index 06d96cec5008..8101e6cf31ae 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_create.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_create.py @@ -17,39 +17,38 @@ class ServerPropertiesForCreate(Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ServerPropertiesForDefaultCreate, - ServerPropertiesForRestore + ServerPropertiesForRestore, ServerPropertiesForGeoRestore - :param storage_mb: The maximum storage allowed for a server. - :type storage_mb: long :param version: Server version. Possible values include: '9.5', '9.6' :type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' :type ssl_enforcement: str or ~azure.mgmt.rdbms.postgresql.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.postgresql.models.StorageProfile :param create_mode: Constant filled by server. :type create_mode: str """ _validation = { - 'storage_mb': {'minimum': 1024}, 'create_mode': {'required': True}, } _attribute_map = { - 'storage_mb': {'key': 'storageMB', 'type': 'long'}, 'version': {'key': 'version', 'type': 'str'}, 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, 'create_mode': {'key': 'createMode', 'type': 'str'}, } _subtype_map = { - 'create_mode': {'Default': 'ServerPropertiesForDefaultCreate', 'PointInTimeRestore': 'ServerPropertiesForRestore'} + 'create_mode': {'Default': 'ServerPropertiesForDefaultCreate', 'PointInTimeRestore': 'ServerPropertiesForRestore', 'GeoRestore': 'ServerPropertiesForGeoRestore'} } - def __init__(self, storage_mb=None, version=None, ssl_enforcement=None): + def __init__(self, version=None, ssl_enforcement=None, storage_profile=None): super(ServerPropertiesForCreate, self).__init__() - self.storage_mb = storage_mb self.version = version self.ssl_enforcement = ssl_enforcement + self.storage_profile = storage_profile self.create_mode = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_default_create.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_default_create.py index 6d05c05f8d65..487e01908dde 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_default_create.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_default_create.py @@ -15,14 +15,14 @@ class ServerPropertiesForDefaultCreate(ServerPropertiesForCreate): """The properties used to create a new server. - :param storage_mb: The maximum storage allowed for a server. - :type storage_mb: long :param version: Server version. Possible values include: '9.5', '9.6' :type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' :type ssl_enforcement: str or ~azure.mgmt.rdbms.postgresql.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.postgresql.models.StorageProfile :param create_mode: Constant filled by server. :type create_mode: str :param administrator_login: The administrator's login name of a server. @@ -35,23 +35,22 @@ class ServerPropertiesForDefaultCreate(ServerPropertiesForCreate): """ _validation = { - 'storage_mb': {'minimum': 1024}, 'create_mode': {'required': True}, 'administrator_login': {'required': True}, 'administrator_login_password': {'required': True}, } _attribute_map = { - 'storage_mb': {'key': 'storageMB', 'type': 'long'}, 'version': {'key': 'version', 'type': 'str'}, 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, 'create_mode': {'key': 'createMode', 'type': 'str'}, 'administrator_login': {'key': 'administratorLogin', 'type': 'str'}, 'administrator_login_password': {'key': 'administratorLoginPassword', 'type': 'str'}, } - def __init__(self, administrator_login, administrator_login_password, storage_mb=None, version=None, ssl_enforcement=None): - super(ServerPropertiesForDefaultCreate, self).__init__(storage_mb=storage_mb, version=version, ssl_enforcement=ssl_enforcement) + def __init__(self, administrator_login, administrator_login_password, version=None, ssl_enforcement=None, storage_profile=None): + super(ServerPropertiesForDefaultCreate, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile) self.administrator_login = administrator_login self.administrator_login_password = administrator_login_password self.create_mode = 'Default' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_geo_restore.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_geo_restore.py new file mode 100644 index 000000000000..1e78faee183c --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_geo_restore.py @@ -0,0 +1,48 @@ +# 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 .server_properties_for_create import ServerPropertiesForCreate + + +class ServerPropertiesForGeoRestore(ServerPropertiesForCreate): + """The properties to a new server by restoring from a geo replicated backup. + + :param version: Server version. Possible values include: '9.5', '9.6' + :type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.postgresql.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.postgresql.models.StorageProfile + :param create_mode: Constant filled by server. + :type create_mode: str + :param source_server_id: The source server id to restore from. + :type source_server_id: str + """ + + _validation = { + 'create_mode': {'required': True}, + 'source_server_id': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'source_server_id': {'key': 'sourceServerId', 'type': 'str'}, + } + + def __init__(self, source_server_id, version=None, ssl_enforcement=None, storage_profile=None): + super(ServerPropertiesForGeoRestore, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile) + self.source_server_id = source_server_id + self.create_mode = 'GeoRestore' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_restore.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_restore.py index 2eeadc7a4887..a8f224f343ef 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_restore.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_restore.py @@ -15,14 +15,14 @@ class ServerPropertiesForRestore(ServerPropertiesForCreate): """The properties to a new server by restoring from a backup. - :param storage_mb: The maximum storage allowed for a server. - :type storage_mb: long :param version: Server version. Possible values include: '9.5', '9.6' :type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' :type ssl_enforcement: str or ~azure.mgmt.rdbms.postgresql.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.postgresql.models.StorageProfile :param create_mode: Constant filled by server. :type create_mode: str :param source_server_id: The source server id to restore from. @@ -33,23 +33,22 @@ class ServerPropertiesForRestore(ServerPropertiesForCreate): """ _validation = { - 'storage_mb': {'minimum': 1024}, 'create_mode': {'required': True}, 'source_server_id': {'required': True}, 'restore_point_in_time': {'required': True}, } _attribute_map = { - 'storage_mb': {'key': 'storageMB', 'type': 'long'}, 'version': {'key': 'version', 'type': 'str'}, 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, 'create_mode': {'key': 'createMode', 'type': 'str'}, 'source_server_id': {'key': 'sourceServerId', 'type': 'str'}, 'restore_point_in_time': {'key': 'restorePointInTime', 'type': 'iso-8601'}, } - def __init__(self, source_server_id, restore_point_in_time, storage_mb=None, version=None, ssl_enforcement=None): - super(ServerPropertiesForRestore, self).__init__(storage_mb=storage_mb, version=version, ssl_enforcement=ssl_enforcement) + def __init__(self, source_server_id, restore_point_in_time, version=None, ssl_enforcement=None, storage_profile=None): + super(ServerPropertiesForRestore, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile) self.source_server_id = source_server_id self.restore_point_in_time = restore_point_in_time self.create_mode = 'PointInTimeRestore' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_update_parameters.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_update_parameters.py index 568d5b11c290..5888125236a7 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_update_parameters.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_update_parameters.py @@ -17,8 +17,8 @@ class ServerUpdateParameters(Model): :param sku: The SKU (pricing tier) of the server. :type sku: ~azure.mgmt.rdbms.postgresql.models.Sku - :param storage_mb: The max storage allowed for a server. - :type storage_mb: long + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.postgresql.models.StorageProfile :param administrator_login_password: The password of the administrator login. :type administrator_login_password: str @@ -33,23 +33,19 @@ class ServerUpdateParameters(Model): :type tags: dict[str, str] """ - _validation = { - 'storage_mb': {'minimum': 1024}, - } - _attribute_map = { 'sku': {'key': 'sku', 'type': 'Sku'}, - 'storage_mb': {'key': 'properties.storageMB', 'type': 'long'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, 'version': {'key': 'properties.version', 'type': 'str'}, 'ssl_enforcement': {'key': 'properties.sslEnforcement', 'type': 'SslEnforcementEnum'}, 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, sku=None, storage_mb=None, administrator_login_password=None, version=None, ssl_enforcement=None, tags=None): + def __init__(self, sku=None, storage_profile=None, administrator_login_password=None, version=None, ssl_enforcement=None, tags=None): super(ServerUpdateParameters, self).__init__() self.sku = sku - self.storage_mb = storage_mb + self.storage_profile = storage_profile self.administrator_login_password = administrator_login_password self.version = version self.ssl_enforcement = ssl_enforcement diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/sku.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/sku.py index f4e2846463ec..77d15a740b3a 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/sku.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/sku.py @@ -15,8 +15,8 @@ class Sku(Model): """Billing information related properties of a server. - :param name: The name of the sku, typically, a letter + Number code, e.g. - P3. + :param name: The name of the sku, typically, tier + family + cores, e.g. + B_Gen4_1, GP_Gen5_8. :type name: str :param tier: The tier of the particular SKU, e.g. Basic. Possible values include: 'Basic', 'Standard' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/storage_profile.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/storage_profile.py new file mode 100644 index 000000000000..0f408839ce2d --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/storage_profile.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class StorageProfile(Model): + """Storage Profile properties of a server. + + :param backup_retention_days: Backup retention days for the server. + :type backup_retention_days: int + :param geo_redundant_backup: Enable Geo-redundant or not for server + backup. Possible values include: 'Enabled', 'Disabled' + :type geo_redundant_backup: str or + ~azure.mgmt.rdbms.postgresql.models.GeoRedundantBackup + :param storage_mb: Max storage allowed for a server. + :type storage_mb: int + """ + + _attribute_map = { + 'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'}, + 'geo_redundant_backup': {'key': 'geoRedundantBackup', 'type': 'str'}, + 'storage_mb': {'key': 'storageMB', 'type': 'int'}, + } + + def __init__(self, backup_retention_days=None, geo_redundant_backup=None, storage_mb=None): + super(StorageProfile, self).__init__() + self.backup_retention_days = backup_retention_days + self.geo_redundant_backup = geo_redundant_backup + self.storage_mb = storage_mb diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/__init__.py index b45b52cd35c1..323618c0dd5f 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/__init__.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/__init__.py @@ -14,7 +14,6 @@ from .databases_operations import DatabasesOperations from .configurations_operations import ConfigurationsOperations from .log_files_operations import LogFilesOperations -from .performance_tiers_operations import PerformanceTiersOperations from .location_based_performance_tier_operations import LocationBasedPerformanceTierOperations from .check_name_availability_operations import CheckNameAvailabilityOperations from .operations import Operations @@ -25,7 +24,6 @@ 'DatabasesOperations', 'ConfigurationsOperations', 'LogFilesOperations', - 'PerformanceTiersOperations', 'LocationBasedPerformanceTierOperations', 'CheckNameAvailabilityOperations', 'Operations', diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/check_name_availability_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/check_name_availability_operations.py index d3ee625a4013..6e5d92c0daf9 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/check_name_availability_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/check_name_availability_operations.py @@ -23,7 +23,7 @@ class CheckNameAvailabilityOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/configurations_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/configurations_operations.py index cb5222d964f4..d0962a30c0a3 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/configurations_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/configurations_operations.py @@ -25,7 +25,7 @@ class ConfigurationsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/databases_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/databases_operations.py index 6addc37915f2..46dc7aa35307 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/databases_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/databases_operations.py @@ -25,7 +25,7 @@ class DatabasesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/firewall_rules_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/firewall_rules_operations.py index bc57d5777e69..29dc58ef6d50 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/firewall_rules_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/firewall_rules_operations.py @@ -25,7 +25,7 @@ class FirewallRulesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/location_based_performance_tier_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/location_based_performance_tier_operations.py index 5194ca976760..de2bfa29e87e 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/location_based_performance_tier_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/location_based_performance_tier_operations.py @@ -23,7 +23,7 @@ class LocationBasedPerformanceTierOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/log_files_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/log_files_operations.py index 83780695cd06..e334db78acd8 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/log_files_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/log_files_operations.py @@ -23,7 +23,7 @@ class LogFilesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/operations.py index c42ff7ca4a89..05c5652b7f8f 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/operations.py @@ -23,7 +23,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/performance_tiers_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/performance_tiers_operations.py deleted file mode 100644 index e55e9ba7e45c..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/performance_tiers_operations.py +++ /dev/null @@ -1,102 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class PerformanceTiersOperations(object): - """PerformanceTiersOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-04-30-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """List all the performance tiers in a given subscription. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of PerformanceTierProperties - :rtype: - ~azure.mgmt.rdbms.postgresql.models.PerformanceTierPropertiesPaged[~azure.mgmt.rdbms.postgresql.models.PerformanceTierProperties] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/performanceTiers' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.PerformanceTierPropertiesPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.PerformanceTierPropertiesPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/servers_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/servers_operations.py index e5423822a7db..f88a396f2796 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/servers_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/servers_operations.py @@ -25,7 +25,7 @@ class ServersOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/postgre_sql_management_client.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/postgre_sql_management_client.py index 98e51b58c84f..183c1a955f84 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/postgre_sql_management_client.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/postgre_sql_management_client.py @@ -18,7 +18,6 @@ from .operations.databases_operations import DatabasesOperations from .operations.configurations_operations import ConfigurationsOperations from .operations.log_files_operations import LogFilesOperations -from .operations.performance_tiers_operations import PerformanceTiersOperations from .operations.location_based_performance_tier_operations import LocationBasedPerformanceTierOperations from .operations.check_name_availability_operations import CheckNameAvailabilityOperations from .operations.operations import Operations @@ -59,7 +58,7 @@ def __init__( class PostgreSQLManagementClient(object): - """The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, log files and configurations. + """The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, log files and configurations with new business model. :ivar config: Configuration for client. :vartype config: PostgreSQLManagementClientConfiguration @@ -74,8 +73,6 @@ class PostgreSQLManagementClient(object): :vartype configurations: azure.mgmt.rdbms.postgresql.operations.ConfigurationsOperations :ivar log_files: LogFiles operations :vartype log_files: azure.mgmt.rdbms.postgresql.operations.LogFilesOperations - :ivar performance_tiers: PerformanceTiers operations - :vartype performance_tiers: azure.mgmt.rdbms.postgresql.operations.PerformanceTiersOperations :ivar location_based_performance_tier: LocationBasedPerformanceTier operations :vartype location_based_performance_tier: azure.mgmt.rdbms.postgresql.operations.LocationBasedPerformanceTierOperations :ivar check_name_availability: CheckNameAvailability operations @@ -99,7 +96,7 @@ def __init__( self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2017-04-30-preview' + self.api_version = '2017-12-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -113,8 +110,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.log_files = LogFilesOperations( self._client, self.config, self._serialize, self._deserialize) - self.performance_tiers = PerformanceTiersOperations( - self._client, self.config, self._serialize, self._deserialize) self.location_based_performance_tier = LocationBasedPerformanceTierOperations( self._client, self.config, self._serialize, self._deserialize) self.check_name_availability = CheckNameAvailabilityOperations( diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/version.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/version.py index 3c14a627134c..d2d4445f16cf 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/version.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "2017-04-30-preview" +VERSION = "2017-12-01-preview" From 869e6c919db13b33efabe6edee433f8b918ac71b Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 8 Feb 2018 20:38:52 +0000 Subject: [PATCH 4/7] Generated from f2100051927d4cdf64b6fd7c3270f26086135e5d update postgresql name space back to postgres --- .../mgmt/rdbms/postgres/models/__init__.py | 6 ++ .../models/performance_tier_properties.py | 25 +++-- ...rformance_tier_service_level_objectives.py | 21 ++-- .../postgre_sql_management_client_enums.py | 6 ++ .../mgmt/rdbms/postgres/models/server.py | 16 +-- .../models/server_properties_for_create.py | 15 ++- .../server_properties_for_default_create.py | 11 +- .../server_properties_for_geo_restore.py | 48 +++++++++ .../models/server_properties_for_restore.py | 11 +- .../models/server_update_parameters.py | 14 +-- .../azure/mgmt/rdbms/postgres/models/sku.py | 4 +- .../rdbms/postgres/models/storage_profile.py | 38 +++++++ .../rdbms/postgres/operations/__init__.py | 2 - .../check_name_availability_operations.py | 4 +- .../operations/configurations_operations.py | 4 +- .../operations/databases_operations.py | 4 +- .../operations/firewall_rules_operations.py | 4 +- ...ation_based_performance_tier_operations.py | 4 +- .../operations/log_files_operations.py | 4 +- .../rdbms/postgres/operations/operations.py | 4 +- .../performance_tiers_operations.py | 102 ------------------ .../postgres/operations/servers_operations.py | 4 +- .../postgres/postgre_sql_management_client.py | 9 +- .../azure/mgmt/rdbms/postgres/version.py | 2 +- 24 files changed, 180 insertions(+), 182 deletions(-) create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_geo_restore.py create mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/storage_profile.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/performance_tiers_operations.py diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/__init__.py index 9bc07a61b9c2..95ce897ede1f 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/__init__.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/__init__.py @@ -11,9 +11,11 @@ from .proxy_resource import ProxyResource from .tracked_resource import TrackedResource +from .storage_profile import StorageProfile from .server_properties_for_create import ServerPropertiesForCreate from .server_properties_for_default_create import ServerPropertiesForDefaultCreate from .server_properties_for_restore import ServerPropertiesForRestore +from .server_properties_for_geo_restore import ServerPropertiesForGeoRestore from .sku import Sku from .server import Server from .server_for_create import ServerForCreate @@ -39,6 +41,7 @@ ServerVersion, SslEnforcementEnum, ServerState, + GeoRedundantBackup, SkuTier, OperationOrigin, ) @@ -46,9 +49,11 @@ __all__ = [ 'ProxyResource', 'TrackedResource', + 'StorageProfile', 'ServerPropertiesForCreate', 'ServerPropertiesForDefaultCreate', 'ServerPropertiesForRestore', + 'ServerPropertiesForGeoRestore', 'Sku', 'Server', 'ServerForCreate', @@ -73,6 +78,7 @@ 'ServerVersion', 'SslEnforcementEnum', 'ServerState', + 'GeoRedundantBackup', 'SkuTier', 'OperationOrigin', ] diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_properties.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_properties.py index 9d7f38812e4d..ad7c0fbe94e0 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_properties.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_properties.py @@ -17,9 +17,16 @@ class PerformanceTierProperties(Model): :param id: ID of the performance tier. :type id: str - :param backup_retention_days: Backup retention in days for the performance - tier edition - :type backup_retention_days: int + :param max_backup_retention_days: Maximum Backup retention in days for the + performance tier edition + :type max_backup_retention_days: int + :param min_backup_retention_days: Minimum Backup retention in days for the + performance tier edition + :type min_backup_retention_days: int + :param max_storage_mb: Max storage allowed for a server. + :type max_storage_mb: int + :param min_storage_mb: Max storage allowed for a server. + :type min_storage_mb: int :param service_level_objectives: Service level objectives associated with the performance tier :type service_level_objectives: @@ -28,12 +35,18 @@ class PerformanceTierProperties(Model): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'}, + 'max_backup_retention_days': {'key': 'maxBackupRetentionDays', 'type': 'int'}, + 'min_backup_retention_days': {'key': 'minBackupRetentionDays', 'type': 'int'}, + 'max_storage_mb': {'key': 'maxStorageMB', 'type': 'int'}, + 'min_storage_mb': {'key': 'minStorageMB', 'type': 'int'}, 'service_level_objectives': {'key': 'serviceLevelObjectives', 'type': '[PerformanceTierServiceLevelObjectives]'}, } - def __init__(self, id=None, backup_retention_days=None, service_level_objectives=None): + def __init__(self, id=None, max_backup_retention_days=None, min_backup_retention_days=None, max_storage_mb=None, min_storage_mb=None, service_level_objectives=None): super(PerformanceTierProperties, self).__init__() self.id = id - self.backup_retention_days = backup_retention_days + self.max_backup_retention_days = max_backup_retention_days + self.min_backup_retention_days = min_backup_retention_days + self.max_storage_mb = max_storage_mb + self.min_storage_mb = min_storage_mb self.service_level_objectives = service_level_objectives diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_service_level_objectives.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_service_level_objectives.py index 7e2c98d7e24a..96ba9e7c889c 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_service_level_objectives.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_service_level_objectives.py @@ -19,24 +19,23 @@ class PerformanceTierServiceLevelObjectives(Model): :type id: str :param edition: Edition of the performance tier. :type edition: str - :param dtu: Database throughput unit associated with the service level - objective - :type dtu: int - :param storage_mb: Maximum storage in MB associated with the service level - objective - :type storage_mb: int + :param v_core: vCore associated with the service level objective + :type v_core: int + :param hardware_generation: Hardware generation associated with the + service level objective + :type hardware_generation: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'edition': {'key': 'edition', 'type': 'str'}, - 'dtu': {'key': 'dtu', 'type': 'int'}, - 'storage_mb': {'key': 'storageMB', 'type': 'int'}, + 'v_core': {'key': 'vCore', 'type': 'int'}, + 'hardware_generation': {'key': 'hardwareGeneration', 'type': 'str'}, } - def __init__(self, id=None, edition=None, dtu=None, storage_mb=None): + def __init__(self, id=None, edition=None, v_core=None, hardware_generation=None): super(PerformanceTierServiceLevelObjectives, self).__init__() self.id = id self.edition = edition - self.dtu = dtu - self.storage_mb = storage_mb + self.v_core = v_core + self.hardware_generation = hardware_generation diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/postgre_sql_management_client_enums.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/postgre_sql_management_client_enums.py index d539086044e1..ccaa28a4ddad 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/postgre_sql_management_client_enums.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/postgre_sql_management_client_enums.py @@ -31,6 +31,12 @@ class ServerState(Enum): disabled = "Disabled" +class GeoRedundantBackup(Enum): + + enabled = "Enabled" + disabled = "Disabled" + + class SkuTier(Enum): basic = "Basic" diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server.py index 5a53ae461473..c8d3a7afac57 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server.py @@ -34,8 +34,6 @@ class Server(TrackedResource): Can only be specified when the server is being created (and is required for creation). :type administrator_login: str - :param storage_mb: The maximum storage allowed for a server. - :type storage_mb: long :param version: Server version. Possible values include: '9.5', '9.6' :type version: str or ~azure.mgmt.rdbms.postgres.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to @@ -49,6 +47,11 @@ class Server(TrackedResource): :param fully_qualified_domain_name: The fully qualified domain name of a server. :type fully_qualified_domain_name: str + :param earliest_restore_date: Earliest restore point creation time + (ISO8601 format) + :type earliest_restore_date: datetime + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.postgres.models.StorageProfile """ _validation = { @@ -56,7 +59,6 @@ class Server(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'storage_mb': {'minimum': 1024}, } _attribute_map = { @@ -67,19 +69,21 @@ class Server(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'Sku'}, 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, - 'storage_mb': {'key': 'properties.storageMB', 'type': 'long'}, 'version': {'key': 'properties.version', 'type': 'str'}, 'ssl_enforcement': {'key': 'properties.sslEnforcement', 'type': 'SslEnforcementEnum'}, 'user_visible_state': {'key': 'properties.userVisibleState', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, + 'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, } - def __init__(self, location, tags=None, sku=None, administrator_login=None, storage_mb=None, version=None, ssl_enforcement=None, user_visible_state=None, fully_qualified_domain_name=None): + def __init__(self, location, tags=None, sku=None, administrator_login=None, version=None, ssl_enforcement=None, user_visible_state=None, fully_qualified_domain_name=None, earliest_restore_date=None, storage_profile=None): super(Server, self).__init__(location=location, tags=tags) self.sku = sku self.administrator_login = administrator_login - self.storage_mb = storage_mb self.version = version self.ssl_enforcement = ssl_enforcement self.user_visible_state = user_visible_state self.fully_qualified_domain_name = fully_qualified_domain_name + self.earliest_restore_date = earliest_restore_date + self.storage_profile = storage_profile diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_create.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_create.py index 3d843e572ae9..5b8eb4bcfe74 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_create.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_create.py @@ -17,39 +17,38 @@ class ServerPropertiesForCreate(Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: ServerPropertiesForDefaultCreate, - ServerPropertiesForRestore + ServerPropertiesForRestore, ServerPropertiesForGeoRestore - :param storage_mb: The maximum storage allowed for a server. - :type storage_mb: long :param version: Server version. Possible values include: '9.5', '9.6' :type version: str or ~azure.mgmt.rdbms.postgres.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' :type ssl_enforcement: str or ~azure.mgmt.rdbms.postgres.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.postgres.models.StorageProfile :param create_mode: Constant filled by server. :type create_mode: str """ _validation = { - 'storage_mb': {'minimum': 1024}, 'create_mode': {'required': True}, } _attribute_map = { - 'storage_mb': {'key': 'storageMB', 'type': 'long'}, 'version': {'key': 'version', 'type': 'str'}, 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, 'create_mode': {'key': 'createMode', 'type': 'str'}, } _subtype_map = { - 'create_mode': {'Default': 'ServerPropertiesForDefaultCreate', 'PointInTimeRestore': 'ServerPropertiesForRestore'} + 'create_mode': {'Default': 'ServerPropertiesForDefaultCreate', 'PointInTimeRestore': 'ServerPropertiesForRestore', 'GeoRestore': 'ServerPropertiesForGeoRestore'} } - def __init__(self, storage_mb=None, version=None, ssl_enforcement=None): + def __init__(self, version=None, ssl_enforcement=None, storage_profile=None): super(ServerPropertiesForCreate, self).__init__() - self.storage_mb = storage_mb self.version = version self.ssl_enforcement = ssl_enforcement + self.storage_profile = storage_profile self.create_mode = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_default_create.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_default_create.py index c3cea4b6d341..c649e2f3c8f5 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_default_create.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_default_create.py @@ -15,14 +15,14 @@ class ServerPropertiesForDefaultCreate(ServerPropertiesForCreate): """The properties used to create a new server. - :param storage_mb: The maximum storage allowed for a server. - :type storage_mb: long :param version: Server version. Possible values include: '9.5', '9.6' :type version: str or ~azure.mgmt.rdbms.postgres.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' :type ssl_enforcement: str or ~azure.mgmt.rdbms.postgres.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.postgres.models.StorageProfile :param create_mode: Constant filled by server. :type create_mode: str :param administrator_login: The administrator's login name of a server. @@ -35,23 +35,22 @@ class ServerPropertiesForDefaultCreate(ServerPropertiesForCreate): """ _validation = { - 'storage_mb': {'minimum': 1024}, 'create_mode': {'required': True}, 'administrator_login': {'required': True}, 'administrator_login_password': {'required': True}, } _attribute_map = { - 'storage_mb': {'key': 'storageMB', 'type': 'long'}, 'version': {'key': 'version', 'type': 'str'}, 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, 'create_mode': {'key': 'createMode', 'type': 'str'}, 'administrator_login': {'key': 'administratorLogin', 'type': 'str'}, 'administrator_login_password': {'key': 'administratorLoginPassword', 'type': 'str'}, } - def __init__(self, administrator_login, administrator_login_password, storage_mb=None, version=None, ssl_enforcement=None): - super(ServerPropertiesForDefaultCreate, self).__init__(storage_mb=storage_mb, version=version, ssl_enforcement=ssl_enforcement) + def __init__(self, administrator_login, administrator_login_password, version=None, ssl_enforcement=None, storage_profile=None): + super(ServerPropertiesForDefaultCreate, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile) self.administrator_login = administrator_login self.administrator_login_password = administrator_login_password self.create_mode = 'Default' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_geo_restore.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_geo_restore.py new file mode 100644 index 000000000000..95d76a168db5 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_geo_restore.py @@ -0,0 +1,48 @@ +# 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 .server_properties_for_create import ServerPropertiesForCreate + + +class ServerPropertiesForGeoRestore(ServerPropertiesForCreate): + """The properties to a new server by restoring from a geo replicated backup. + + :param version: Server version. Possible values include: '9.5', '9.6' + :type version: str or ~azure.mgmt.rdbms.postgres.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.postgres.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.postgres.models.StorageProfile + :param create_mode: Constant filled by server. + :type create_mode: str + :param source_server_id: The source server id to restore from. + :type source_server_id: str + """ + + _validation = { + 'create_mode': {'required': True}, + 'source_server_id': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'source_server_id': {'key': 'sourceServerId', 'type': 'str'}, + } + + def __init__(self, source_server_id, version=None, ssl_enforcement=None, storage_profile=None): + super(ServerPropertiesForGeoRestore, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile) + self.source_server_id = source_server_id + self.create_mode = 'GeoRestore' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_restore.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_restore.py index dd1ccf7b32e2..eec677e4ed72 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_restore.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_restore.py @@ -15,14 +15,14 @@ class ServerPropertiesForRestore(ServerPropertiesForCreate): """The properties to a new server by restoring from a backup. - :param storage_mb: The maximum storage allowed for a server. - :type storage_mb: long :param version: Server version. Possible values include: '9.5', '9.6' :type version: str or ~azure.mgmt.rdbms.postgres.models.ServerVersion :param ssl_enforcement: Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', 'Disabled' :type ssl_enforcement: str or ~azure.mgmt.rdbms.postgres.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.postgres.models.StorageProfile :param create_mode: Constant filled by server. :type create_mode: str :param source_server_id: The source server id to restore from. @@ -33,23 +33,22 @@ class ServerPropertiesForRestore(ServerPropertiesForCreate): """ _validation = { - 'storage_mb': {'minimum': 1024}, 'create_mode': {'required': True}, 'source_server_id': {'required': True}, 'restore_point_in_time': {'required': True}, } _attribute_map = { - 'storage_mb': {'key': 'storageMB', 'type': 'long'}, 'version': {'key': 'version', 'type': 'str'}, 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, 'create_mode': {'key': 'createMode', 'type': 'str'}, 'source_server_id': {'key': 'sourceServerId', 'type': 'str'}, 'restore_point_in_time': {'key': 'restorePointInTime', 'type': 'iso-8601'}, } - def __init__(self, source_server_id, restore_point_in_time, storage_mb=None, version=None, ssl_enforcement=None): - super(ServerPropertiesForRestore, self).__init__(storage_mb=storage_mb, version=version, ssl_enforcement=ssl_enforcement) + def __init__(self, source_server_id, restore_point_in_time, version=None, ssl_enforcement=None, storage_profile=None): + super(ServerPropertiesForRestore, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile) self.source_server_id = source_server_id self.restore_point_in_time = restore_point_in_time self.create_mode = 'PointInTimeRestore' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_update_parameters.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_update_parameters.py index 25cfd01ae0c1..aed0ddeba0f6 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_update_parameters.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_update_parameters.py @@ -17,8 +17,8 @@ class ServerUpdateParameters(Model): :param sku: The SKU (pricing tier) of the server. :type sku: ~azure.mgmt.rdbms.postgres.models.Sku - :param storage_mb: The max storage allowed for a server. - :type storage_mb: long + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.postgres.models.StorageProfile :param administrator_login_password: The password of the administrator login. :type administrator_login_password: str @@ -33,23 +33,19 @@ class ServerUpdateParameters(Model): :type tags: dict[str, str] """ - _validation = { - 'storage_mb': {'minimum': 1024}, - } - _attribute_map = { 'sku': {'key': 'sku', 'type': 'Sku'}, - 'storage_mb': {'key': 'properties.storageMB', 'type': 'long'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, 'version': {'key': 'properties.version', 'type': 'str'}, 'ssl_enforcement': {'key': 'properties.sslEnforcement', 'type': 'SslEnforcementEnum'}, 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, sku=None, storage_mb=None, administrator_login_password=None, version=None, ssl_enforcement=None, tags=None): + def __init__(self, sku=None, storage_profile=None, administrator_login_password=None, version=None, ssl_enforcement=None, tags=None): super(ServerUpdateParameters, self).__init__() self.sku = sku - self.storage_mb = storage_mb + self.storage_profile = storage_profile self.administrator_login_password = administrator_login_password self.version = version self.ssl_enforcement = ssl_enforcement diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/sku.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/sku.py index c8779e322ba6..f087762dfd82 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/sku.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/sku.py @@ -15,8 +15,8 @@ class Sku(Model): """Billing information related properties of a server. - :param name: The name of the sku, typically, a letter + Number code, e.g. - P3. + :param name: The name of the sku, typically, tier + family + cores, e.g. + B_Gen4_1, GP_Gen5_8. :type name: str :param tier: The tier of the particular SKU, e.g. Basic. Possible values include: 'Basic', 'Standard' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/storage_profile.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/storage_profile.py new file mode 100644 index 000000000000..c60fedde2174 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/storage_profile.py @@ -0,0 +1,38 @@ +# 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 msrest.serialization import Model + + +class StorageProfile(Model): + """Storage Profile properties of a server. + + :param backup_retention_days: Backup retention days for the server. + :type backup_retention_days: int + :param geo_redundant_backup: Enable Geo-redundant or not for server + backup. Possible values include: 'Enabled', 'Disabled' + :type geo_redundant_backup: str or + ~azure.mgmt.rdbms.postgres.models.GeoRedundantBackup + :param storage_mb: Max storage allowed for a server. + :type storage_mb: int + """ + + _attribute_map = { + 'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'}, + 'geo_redundant_backup': {'key': 'geoRedundantBackup', 'type': 'str'}, + 'storage_mb': {'key': 'storageMB', 'type': 'int'}, + } + + def __init__(self, backup_retention_days=None, geo_redundant_backup=None, storage_mb=None): + super(StorageProfile, self).__init__() + self.backup_retention_days = backup_retention_days + self.geo_redundant_backup = geo_redundant_backup + self.storage_mb = storage_mb diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/__init__.py index b45b52cd35c1..323618c0dd5f 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/__init__.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/__init__.py @@ -14,7 +14,6 @@ from .databases_operations import DatabasesOperations from .configurations_operations import ConfigurationsOperations from .log_files_operations import LogFilesOperations -from .performance_tiers_operations import PerformanceTiersOperations from .location_based_performance_tier_operations import LocationBasedPerformanceTierOperations from .check_name_availability_operations import CheckNameAvailabilityOperations from .operations import Operations @@ -25,7 +24,6 @@ 'DatabasesOperations', 'ConfigurationsOperations', 'LogFilesOperations', - 'PerformanceTiersOperations', 'LocationBasedPerformanceTierOperations', 'CheckNameAvailabilityOperations', 'Operations', diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/check_name_availability_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/check_name_availability_operations.py index 40158b09d21d..27e95fcb81f3 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/check_name_availability_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/check_name_availability_operations.py @@ -23,7 +23,7 @@ class CheckNameAvailabilityOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/configurations_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/configurations_operations.py index 03a73cfef7e7..1d587b53eaf6 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/configurations_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/configurations_operations.py @@ -25,7 +25,7 @@ class ConfigurationsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/databases_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/databases_operations.py index df1f95eaf0f9..b73001e7ba32 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/databases_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/databases_operations.py @@ -25,7 +25,7 @@ class DatabasesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/firewall_rules_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/firewall_rules_operations.py index 8d9dae43fa4a..ea23a0805839 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/firewall_rules_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/firewall_rules_operations.py @@ -25,7 +25,7 @@ class FirewallRulesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/location_based_performance_tier_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/location_based_performance_tier_operations.py index b60199cfcb1f..5021591d0bea 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/location_based_performance_tier_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/location_based_performance_tier_operations.py @@ -23,7 +23,7 @@ class LocationBasedPerformanceTierOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/log_files_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/log_files_operations.py index 676712bb0e85..58e333927f6d 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/log_files_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/log_files_operations.py @@ -23,7 +23,7 @@ class LogFilesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/operations.py index 4b04c106d89c..c109975b4598 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/operations.py @@ -23,7 +23,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/performance_tiers_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/performance_tiers_operations.py deleted file mode 100644 index 49f897316d2e..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/performance_tiers_operations.py +++ /dev/null @@ -1,102 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class PerformanceTiersOperations(object): - """PerformanceTiersOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-04-30-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """List all the performance tiers in a given subscription. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of PerformanceTierProperties - :rtype: - ~azure.mgmt.rdbms.postgres.models.PerformanceTierPropertiesPaged[~azure.mgmt.rdbms.postgres.models.PerformanceTierProperties] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/performanceTiers' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.PerformanceTierPropertiesPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.PerformanceTierPropertiesPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/servers_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/servers_operations.py index 5ada82de6d44..80743be3588f 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/servers_operations.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/servers_operations.py @@ -25,7 +25,7 @@ class ServersOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-04-30-preview". + :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-04-30-preview" + self.api_version = "2017-12-01-preview" self.config = config diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/postgre_sql_management_client.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/postgre_sql_management_client.py index c4fca7fa5c09..f35de6043838 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/postgre_sql_management_client.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/postgre_sql_management_client.py @@ -18,7 +18,6 @@ from .operations.databases_operations import DatabasesOperations from .operations.configurations_operations import ConfigurationsOperations from .operations.log_files_operations import LogFilesOperations -from .operations.performance_tiers_operations import PerformanceTiersOperations from .operations.location_based_performance_tier_operations import LocationBasedPerformanceTierOperations from .operations.check_name_availability_operations import CheckNameAvailabilityOperations from .operations.operations import Operations @@ -59,7 +58,7 @@ def __init__( class PostgreSQLManagementClient(object): - """The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, log files and configurations. + """The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, log files and configurations with new business model. :ivar config: Configuration for client. :vartype config: PostgreSQLManagementClientConfiguration @@ -74,8 +73,6 @@ class PostgreSQLManagementClient(object): :vartype configurations: azure.mgmt.rdbms.postgres.operations.ConfigurationsOperations :ivar log_files: LogFiles operations :vartype log_files: azure.mgmt.rdbms.postgres.operations.LogFilesOperations - :ivar performance_tiers: PerformanceTiers operations - :vartype performance_tiers: azure.mgmt.rdbms.postgres.operations.PerformanceTiersOperations :ivar location_based_performance_tier: LocationBasedPerformanceTier operations :vartype location_based_performance_tier: azure.mgmt.rdbms.postgres.operations.LocationBasedPerformanceTierOperations :ivar check_name_availability: CheckNameAvailability operations @@ -99,7 +96,7 @@ def __init__( self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2017-04-30-preview' + self.api_version = '2017-12-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -113,8 +110,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.log_files = LogFilesOperations( self._client, self.config, self._serialize, self._deserialize) - self.performance_tiers = PerformanceTiersOperations( - self._client, self.config, self._serialize, self._deserialize) self.location_based_performance_tier = LocationBasedPerformanceTierOperations( self._client, self.config, self._serialize, self._deserialize) self.check_name_availability = CheckNameAvailabilityOperations( diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/version.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/version.py index 3c14a627134c..d2d4445f16cf 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/version.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "2017-04-30-preview" +VERSION = "2017-12-01-preview" From 71b71f9bc3d800a72f57d98924a1a6f7f76ec60c Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 13 Feb 2018 01:36:10 +0000 Subject: [PATCH 5/7] Generated from 311a3ee70d7617c50f7a9d4de5dc0c753a9907b8 make createtime and lastmodifiedtime for logfileproperties to readonly --- .../azure/mgmt/rdbms/mysql/models/log_file.py | 16 +++++++++------- .../mgmt/rdbms/postgresql/models/log_file.py | 16 +++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/log_file.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/log_file.py index 3ec6e29b9c51..7ca4f91fe2a5 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/log_file.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/log_file.py @@ -28,10 +28,10 @@ class LogFile(ProxyResource): :type log_file_name: str :param size_in_kb: Size of the log file. :type size_in_kb: long - :param created_time: Creation timestamp of the log file. - :type created_time: datetime - :param last_modified_time: Last modified timestamp of the log file. - :type last_modified_time: datetime + :ivar created_time: Creation timestamp of the log file. + :vartype created_time: datetime + :ivar last_modified_time: Last modified timestamp of the log file. + :vartype last_modified_time: datetime :param log_file_type: Type of the log file. :type log_file_type: str :param url: The url to download the log file from. @@ -42,6 +42,8 @@ class LogFile(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'created_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, } _attribute_map = { @@ -56,11 +58,11 @@ class LogFile(ProxyResource): 'url': {'key': 'properties.url', 'type': 'str'}, } - def __init__(self, log_file_name=None, size_in_kb=None, created_time=None, last_modified_time=None, log_file_type=None, url=None): + def __init__(self, log_file_name=None, size_in_kb=None, log_file_type=None, url=None): super(LogFile, self).__init__() self.log_file_name = log_file_name self.size_in_kb = size_in_kb - self.created_time = created_time - self.last_modified_time = last_modified_time + self.created_time = None + self.last_modified_time = None self.log_file_type = log_file_type self.url = url diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/log_file.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/log_file.py index 3ec6e29b9c51..7ca4f91fe2a5 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/log_file.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/log_file.py @@ -28,10 +28,10 @@ class LogFile(ProxyResource): :type log_file_name: str :param size_in_kb: Size of the log file. :type size_in_kb: long - :param created_time: Creation timestamp of the log file. - :type created_time: datetime - :param last_modified_time: Last modified timestamp of the log file. - :type last_modified_time: datetime + :ivar created_time: Creation timestamp of the log file. + :vartype created_time: datetime + :ivar last_modified_time: Last modified timestamp of the log file. + :vartype last_modified_time: datetime :param log_file_type: Type of the log file. :type log_file_type: str :param url: The url to download the log file from. @@ -42,6 +42,8 @@ class LogFile(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'created_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, } _attribute_map = { @@ -56,11 +58,11 @@ class LogFile(ProxyResource): 'url': {'key': 'properties.url', 'type': 'str'}, } - def __init__(self, log_file_name=None, size_in_kb=None, created_time=None, last_modified_time=None, log_file_type=None, url=None): + def __init__(self, log_file_name=None, size_in_kb=None, log_file_type=None, url=None): super(LogFile, self).__init__() self.log_file_name = log_file_name self.size_in_kb = size_in_kb - self.created_time = created_time - self.last_modified_time = last_modified_time + self.created_time = None + self.last_modified_time = None self.log_file_type = log_file_type self.url = url From 692ba40b65395038697a10618d745fddf421f452 Mon Sep 17 00:00:00 2001 From: Qingqing Yuan Date: Tue, 20 Feb 2018 12:08:42 -0800 Subject: [PATCH 6/7] Remove postgres folder --- .../azure/mgmt/rdbms/postgres/__init__.py | 18 - .../mgmt/rdbms/postgres/models/__init__.py | 84 --- .../rdbms/postgres/models/configuration.py | 70 --- .../postgres/models/configuration_paged.py | 27 - .../mgmt/rdbms/postgres/models/database.py | 50 -- .../rdbms/postgres/models/database_paged.py | 27 - .../rdbms/postgres/models/firewall_rule.py | 54 -- .../postgres/models/firewall_rule_paged.py | 27 - .../mgmt/rdbms/postgres/models/log_file.py | 66 -- .../rdbms/postgres/models/log_file_paged.py | 27 - .../postgres/models/name_availability.py | 36 -- .../models/name_availability_request.py | 36 -- .../mgmt/rdbms/postgres/models/operation.py | 53 -- .../postgres/models/operation_display.py | 50 -- .../postgres/models/operation_list_result.py | 28 - .../models/performance_tier_properties.py | 52 -- .../performance_tier_properties_paged.py | 27 - ...rformance_tier_service_level_objectives.py | 41 -- .../postgre_sql_management_client_enums.py | 50 -- .../rdbms/postgres/models/proxy_resource.py | 45 -- .../mgmt/rdbms/postgres/models/server.py | 89 --- .../postgres/models/server_for_create.py | 46 -- .../rdbms/postgres/models/server_paged.py | 27 - .../models/server_properties_for_create.py | 54 -- .../server_properties_for_default_create.py | 56 -- .../server_properties_for_geo_restore.py | 48 -- .../models/server_properties_for_restore.py | 54 -- .../models/server_update_parameters.py | 52 -- .../azure/mgmt/rdbms/postgres/models/sku.py | 51 -- .../rdbms/postgres/models/storage_profile.py | 38 -- .../rdbms/postgres/models/tracked_resource.py | 51 -- .../rdbms/postgres/operations/__init__.py | 30 - .../check_name_availability_operations.py | 103 ---- .../operations/configurations_operations.py | 306 --------- .../operations/databases_operations.py | 412 ------------- .../operations/firewall_rules_operations.py | 414 ------------- ...ation_based_performance_tier_operations.py | 106 ---- .../operations/log_files_operations.py | 110 ---- .../rdbms/postgres/operations/operations.py | 89 --- .../postgres/operations/servers_operations.py | 579 ------------------ .../postgres/postgre_sql_management_client.py | 118 ---- .../azure/mgmt/rdbms/postgres/version.py | 13 - 42 files changed, 3714 deletions(-) delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/__init__.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/__init__.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/configuration.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/configuration_paged.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/database.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/database_paged.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/firewall_rule.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/firewall_rule_paged.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/log_file.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/log_file_paged.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/name_availability.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/name_availability_request.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation_display.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation_list_result.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_properties.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_properties_paged.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_service_level_objectives.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/postgre_sql_management_client_enums.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/proxy_resource.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_for_create.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_paged.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_create.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_default_create.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_geo_restore.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_restore.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_update_parameters.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/sku.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/storage_profile.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/tracked_resource.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/__init__.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/check_name_availability_operations.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/configurations_operations.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/databases_operations.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/firewall_rules_operations.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/location_based_performance_tier_operations.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/log_files_operations.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/operations.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/servers_operations.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/postgre_sql_management_client.py delete mode 100644 azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/version.py diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/__init__.py deleted file mode 100644 index 41ac8ae569f2..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/__init__.py +++ /dev/null @@ -1,18 +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 .postgre_sql_management_client import PostgreSQLManagementClient -from .version import VERSION - -__all__ = ['PostgreSQLManagementClient'] - -__version__ = VERSION - diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/__init__.py deleted file mode 100644 index 95ce897ede1f..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/__init__.py +++ /dev/null @@ -1,84 +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 .proxy_resource import ProxyResource -from .tracked_resource import TrackedResource -from .storage_profile import StorageProfile -from .server_properties_for_create import ServerPropertiesForCreate -from .server_properties_for_default_create import ServerPropertiesForDefaultCreate -from .server_properties_for_restore import ServerPropertiesForRestore -from .server_properties_for_geo_restore import ServerPropertiesForGeoRestore -from .sku import Sku -from .server import Server -from .server_for_create import ServerForCreate -from .server_update_parameters import ServerUpdateParameters -from .firewall_rule import FirewallRule -from .database import Database -from .configuration import Configuration -from .operation_display import OperationDisplay -from .operation import Operation -from .operation_list_result import OperationListResult -from .log_file import LogFile -from .performance_tier_service_level_objectives import PerformanceTierServiceLevelObjectives -from .performance_tier_properties import PerformanceTierProperties -from .name_availability_request import NameAvailabilityRequest -from .name_availability import NameAvailability -from .server_paged import ServerPaged -from .firewall_rule_paged import FirewallRulePaged -from .database_paged import DatabasePaged -from .configuration_paged import ConfigurationPaged -from .log_file_paged import LogFilePaged -from .performance_tier_properties_paged import PerformanceTierPropertiesPaged -from .postgre_sql_management_client_enums import ( - ServerVersion, - SslEnforcementEnum, - ServerState, - GeoRedundantBackup, - SkuTier, - OperationOrigin, -) - -__all__ = [ - 'ProxyResource', - 'TrackedResource', - 'StorageProfile', - 'ServerPropertiesForCreate', - 'ServerPropertiesForDefaultCreate', - 'ServerPropertiesForRestore', - 'ServerPropertiesForGeoRestore', - 'Sku', - 'Server', - 'ServerForCreate', - 'ServerUpdateParameters', - 'FirewallRule', - 'Database', - 'Configuration', - 'OperationDisplay', - 'Operation', - 'OperationListResult', - 'LogFile', - 'PerformanceTierServiceLevelObjectives', - 'PerformanceTierProperties', - 'NameAvailabilityRequest', - 'NameAvailability', - 'ServerPaged', - 'FirewallRulePaged', - 'DatabasePaged', - 'ConfigurationPaged', - 'LogFilePaged', - 'PerformanceTierPropertiesPaged', - 'ServerVersion', - 'SslEnforcementEnum', - 'ServerState', - 'GeoRedundantBackup', - 'SkuTier', - 'OperationOrigin', -] diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/configuration.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/configuration.py deleted file mode 100644 index 958b4df22372..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/configuration.py +++ /dev/null @@ -1,70 +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 .proxy_resource import ProxyResource - - -class Configuration(ProxyResource): - """Represents a Configuration. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param value: Value of the configuration. - :type value: str - :ivar description: Description of the configuration. - :vartype description: str - :ivar default_value: Default value of the configuration. - :vartype default_value: str - :ivar data_type: Data type of the configuration. - :vartype data_type: str - :ivar allowed_values: Allowed values of the configuration. - :vartype allowed_values: str - :param source: Source of the configuration. - :type source: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'description': {'readonly': True}, - 'default_value': {'readonly': True}, - 'data_type': {'readonly': True}, - 'allowed_values': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'properties.value', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'default_value': {'key': 'properties.defaultValue', 'type': 'str'}, - 'data_type': {'key': 'properties.dataType', 'type': 'str'}, - 'allowed_values': {'key': 'properties.allowedValues', 'type': 'str'}, - 'source': {'key': 'properties.source', 'type': 'str'}, - } - - def __init__(self, value=None, source=None): - super(Configuration, self).__init__() - self.value = value - self.description = None - self.default_value = None - self.data_type = None - self.allowed_values = None - self.source = source diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/configuration_paged.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/configuration_paged.py deleted file mode 100644 index c8f0925967f6..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/configuration_paged.py +++ /dev/null @@ -1,27 +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 msrest.paging import Paged - - -class ConfigurationPaged(Paged): - """ - A paging container for iterating over a list of :class:`Configuration ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Configuration]'} - } - - def __init__(self, *args, **kwargs): - - super(ConfigurationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/database.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/database.py deleted file mode 100644 index f4e129302c9d..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/database.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 .proxy_resource import ProxyResource - - -class Database(ProxyResource): - """Represents a Database. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param charset: The charset of the database. - :type charset: str - :param collation: The collation of the database. - :type collation: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'charset': {'key': 'properties.charset', 'type': 'str'}, - 'collation': {'key': 'properties.collation', 'type': 'str'}, - } - - def __init__(self, charset=None, collation=None): - super(Database, self).__init__() - self.charset = charset - self.collation = collation diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/database_paged.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/database_paged.py deleted file mode 100644 index bbbe51643acf..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/database_paged.py +++ /dev/null @@ -1,27 +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 msrest.paging import Paged - - -class DatabasePaged(Paged): - """ - A paging container for iterating over a list of :class:`Database ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Database]'} - } - - def __init__(self, *args, **kwargs): - - super(DatabasePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/firewall_rule.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/firewall_rule.py deleted file mode 100644 index ed7b9c13a026..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/firewall_rule.py +++ /dev/null @@ -1,54 +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 .proxy_resource import ProxyResource - - -class FirewallRule(ProxyResource): - """Represents a server firewall rule. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param start_ip_address: The start IP address of the server firewall rule. - Must be IPv4 format. - :type start_ip_address: str - :param end_ip_address: The end IP address of the server firewall rule. - Must be IPv4 format. - :type end_ip_address: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'start_ip_address': {'required': True, 'pattern': r'^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$'}, - 'end_ip_address': {'required': True, 'pattern': r'^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$'}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'start_ip_address': {'key': 'properties.startIpAddress', 'type': 'str'}, - 'end_ip_address': {'key': 'properties.endIpAddress', 'type': 'str'}, - } - - def __init__(self, start_ip_address, end_ip_address): - super(FirewallRule, self).__init__() - self.start_ip_address = start_ip_address - self.end_ip_address = end_ip_address diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/firewall_rule_paged.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/firewall_rule_paged.py deleted file mode 100644 index 02a72ebeb415..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/firewall_rule_paged.py +++ /dev/null @@ -1,27 +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 msrest.paging import Paged - - -class FirewallRulePaged(Paged): - """ - A paging container for iterating over a list of :class:`FirewallRule ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[FirewallRule]'} - } - - def __init__(self, *args, **kwargs): - - super(FirewallRulePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/log_file.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/log_file.py deleted file mode 100644 index 3ec6e29b9c51..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/log_file.py +++ /dev/null @@ -1,66 +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 .proxy_resource import ProxyResource - - -class LogFile(ProxyResource): - """Represents a log file. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param log_file_name: Log file name. - :type log_file_name: str - :param size_in_kb: Size of the log file. - :type size_in_kb: long - :param created_time: Creation timestamp of the log file. - :type created_time: datetime - :param last_modified_time: Last modified timestamp of the log file. - :type last_modified_time: datetime - :param log_file_type: Type of the log file. - :type log_file_type: str - :param url: The url to download the log file from. - :type url: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'log_file_name': {'key': 'properties.name', 'type': 'str'}, - 'size_in_kb': {'key': 'properties.sizeInKB', 'type': 'long'}, - 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, - 'log_file_type': {'key': 'properties.type', 'type': 'str'}, - 'url': {'key': 'properties.url', 'type': 'str'}, - } - - def __init__(self, log_file_name=None, size_in_kb=None, created_time=None, last_modified_time=None, log_file_type=None, url=None): - super(LogFile, self).__init__() - self.log_file_name = log_file_name - self.size_in_kb = size_in_kb - self.created_time = created_time - self.last_modified_time = last_modified_time - self.log_file_type = log_file_type - self.url = url diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/log_file_paged.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/log_file_paged.py deleted file mode 100644 index 4e2eda696fc5..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/log_file_paged.py +++ /dev/null @@ -1,27 +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 msrest.paging import Paged - - -class LogFilePaged(Paged): - """ - A paging container for iterating over a list of :class:`LogFile ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[LogFile]'} - } - - def __init__(self, *args, **kwargs): - - super(LogFilePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/name_availability.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/name_availability.py deleted file mode 100644 index b7759d8d4726..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/name_availability.py +++ /dev/null @@ -1,36 +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 msrest.serialization import Model - - -class NameAvailability(Model): - """Represents a resource name availability. - - :param message: Error Message. - :type message: str - :param name_available: Indicates whether the resource name is available. - :type name_available: bool - :param reason: Reason for name being unavailable. - :type reason: str - """ - - _attribute_map = { - 'message': {'key': 'message', 'type': 'str'}, - 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, - 'reason': {'key': 'reason', 'type': 'str'}, - } - - def __init__(self, message=None, name_available=None, reason=None): - super(NameAvailability, self).__init__() - self.message = message - self.name_available = name_available - self.reason = reason diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/name_availability_request.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/name_availability_request.py deleted file mode 100644 index 715b87ea3676..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/name_availability_request.py +++ /dev/null @@ -1,36 +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 msrest.serialization import Model - - -class NameAvailabilityRequest(Model): - """Request from client to check resource name availability. - - :param name: Resource name to verify. - :type name: str - :param type: Resource type used for verification. - :type type: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, name, type=None): - super(NameAvailabilityRequest, self).__init__() - self.name = name - self.type = type diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation.py deleted file mode 100644 index a162fa66ce7f..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation.py +++ /dev/null @@ -1,53 +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 msrest.serialization import Model - - -class Operation(Model): - """REST API operation definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: The name of the operation being performed on this particular - object. - :vartype name: str - :ivar display: The localized display information for this particular - operation or action. - :vartype display: ~azure.mgmt.rdbms.postgres.models.OperationDisplay - :ivar origin: The intended executor of the operation. Possible values - include: 'NotSpecified', 'user', 'system' - :vartype origin: str or ~azure.mgmt.rdbms.postgres.models.OperationOrigin - :ivar properties: Additional descriptions for the operation. - :vartype properties: dict[str, object] - """ - - _validation = { - 'name': {'readonly': True}, - 'display': {'readonly': True}, - 'origin': {'readonly': True}, - 'properties': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__(self): - super(Operation, self).__init__() - self.name = None - self.display = None - self.origin = None - self.properties = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation_display.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation_display.py deleted file mode 100644 index 66b7f736d293..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation_display.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 msrest.serialization import Model - - -class OperationDisplay(Model): - """Display metadata associated with the operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar provider: Operation resource provider name. - :vartype provider: str - :ivar resource: Resource on which the operation is performed. - :vartype resource: str - :ivar operation: Localized friendly name for the operation. - :vartype operation: str - :ivar description: Operation description. - :vartype description: str - """ - - _validation = { - 'provider': {'readonly': True}, - 'resource': {'readonly': True}, - 'operation': {'readonly': True}, - 'description': {'readonly': True}, - } - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__(self): - super(OperationDisplay, self).__init__() - self.provider = None - self.resource = None - self.operation = None - self.description = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation_list_result.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation_list_result.py deleted file mode 100644 index 04f9aa792ad7..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/operation_list_result.py +++ /dev/null @@ -1,28 +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 msrest.serialization import Model - - -class OperationListResult(Model): - """A list of resource provider operations. - - :param value: The list of resource provider operations. - :type value: list[~azure.mgmt.rdbms.postgres.models.Operation] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - } - - def __init__(self, value=None): - super(OperationListResult, self).__init__() - self.value = value diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_properties.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_properties.py deleted file mode 100644 index ad7c0fbe94e0..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_properties.py +++ /dev/null @@ -1,52 +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 msrest.serialization import Model - - -class PerformanceTierProperties(Model): - """Performance tier properties. - - :param id: ID of the performance tier. - :type id: str - :param max_backup_retention_days: Maximum Backup retention in days for the - performance tier edition - :type max_backup_retention_days: int - :param min_backup_retention_days: Minimum Backup retention in days for the - performance tier edition - :type min_backup_retention_days: int - :param max_storage_mb: Max storage allowed for a server. - :type max_storage_mb: int - :param min_storage_mb: Max storage allowed for a server. - :type min_storage_mb: int - :param service_level_objectives: Service level objectives associated with - the performance tier - :type service_level_objectives: - list[~azure.mgmt.rdbms.postgres.models.PerformanceTierServiceLevelObjectives] - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'max_backup_retention_days': {'key': 'maxBackupRetentionDays', 'type': 'int'}, - 'min_backup_retention_days': {'key': 'minBackupRetentionDays', 'type': 'int'}, - 'max_storage_mb': {'key': 'maxStorageMB', 'type': 'int'}, - 'min_storage_mb': {'key': 'minStorageMB', 'type': 'int'}, - 'service_level_objectives': {'key': 'serviceLevelObjectives', 'type': '[PerformanceTierServiceLevelObjectives]'}, - } - - def __init__(self, id=None, max_backup_retention_days=None, min_backup_retention_days=None, max_storage_mb=None, min_storage_mb=None, service_level_objectives=None): - super(PerformanceTierProperties, self).__init__() - self.id = id - self.max_backup_retention_days = max_backup_retention_days - self.min_backup_retention_days = min_backup_retention_days - self.max_storage_mb = max_storage_mb - self.min_storage_mb = min_storage_mb - self.service_level_objectives = service_level_objectives diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_properties_paged.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_properties_paged.py deleted file mode 100644 index ea2d29a85f6a..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_properties_paged.py +++ /dev/null @@ -1,27 +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 msrest.paging import Paged - - -class PerformanceTierPropertiesPaged(Paged): - """ - A paging container for iterating over a list of :class:`PerformanceTierProperties ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[PerformanceTierProperties]'} - } - - def __init__(self, *args, **kwargs): - - super(PerformanceTierPropertiesPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_service_level_objectives.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_service_level_objectives.py deleted file mode 100644 index 96ba9e7c889c..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/performance_tier_service_level_objectives.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 msrest.serialization import Model - - -class PerformanceTierServiceLevelObjectives(Model): - """Service level objectives for performance tier. - - :param id: ID for the service level objective. - :type id: str - :param edition: Edition of the performance tier. - :type edition: str - :param v_core: vCore associated with the service level objective - :type v_core: int - :param hardware_generation: Hardware generation associated with the - service level objective - :type hardware_generation: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'edition': {'key': 'edition', 'type': 'str'}, - 'v_core': {'key': 'vCore', 'type': 'int'}, - 'hardware_generation': {'key': 'hardwareGeneration', 'type': 'str'}, - } - - def __init__(self, id=None, edition=None, v_core=None, hardware_generation=None): - super(PerformanceTierServiceLevelObjectives, self).__init__() - self.id = id - self.edition = edition - self.v_core = v_core - self.hardware_generation = hardware_generation diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/postgre_sql_management_client_enums.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/postgre_sql_management_client_enums.py deleted file mode 100644 index ccaa28a4ddad..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/postgre_sql_management_client_enums.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 enum import Enum - - -class ServerVersion(Enum): - - nine_full_stop_five = "9.5" - nine_full_stop_six = "9.6" - - -class SslEnforcementEnum(Enum): - - enabled = "Enabled" - disabled = "Disabled" - - -class ServerState(Enum): - - ready = "Ready" - dropping = "Dropping" - disabled = "Disabled" - - -class GeoRedundantBackup(Enum): - - enabled = "Enabled" - disabled = "Disabled" - - -class SkuTier(Enum): - - basic = "Basic" - standard = "Standard" - - -class OperationOrigin(Enum): - - not_specified = "NotSpecified" - user = "user" - system = "system" diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/proxy_resource.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/proxy_resource.py deleted file mode 100644 index b982916c5e5b..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/proxy_resource.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 msrest.serialization import Model - - -class ProxyResource(Model): - """Resource properties. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self): - super(ProxyResource, self).__init__() - self.id = None - self.name = None - self.type = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server.py deleted file mode 100644 index c8d3a7afac57..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server.py +++ /dev/null @@ -1,89 +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 .tracked_resource import TrackedResource - - -class Server(TrackedResource): - """Represents a server. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: The location the resource resides in. - :type location: str - :param tags: Application-specific metadata in the form of key-value pairs. - :type tags: dict[str, str] - :param sku: The SKU (pricing tier) of the server. - :type sku: ~azure.mgmt.rdbms.postgres.models.Sku - :param administrator_login: The administrator's login name of a server. - Can only be specified when the server is being created (and is required - for creation). - :type administrator_login: str - :param version: Server version. Possible values include: '9.5', '9.6' - :type version: str or ~azure.mgmt.rdbms.postgres.models.ServerVersion - :param ssl_enforcement: Enable ssl enforcement or not when connect to - server. Possible values include: 'Enabled', 'Disabled' - :type ssl_enforcement: str or - ~azure.mgmt.rdbms.postgres.models.SslEnforcementEnum - :param user_visible_state: A state of a server that is visible to user. - Possible values include: 'Ready', 'Dropping', 'Disabled' - :type user_visible_state: str or - ~azure.mgmt.rdbms.postgres.models.ServerState - :param fully_qualified_domain_name: The fully qualified domain name of a - server. - :type fully_qualified_domain_name: str - :param earliest_restore_date: Earliest restore point creation time - (ISO8601 format) - :type earliest_restore_date: datetime - :param storage_profile: Storage profile of a server. - :type storage_profile: ~azure.mgmt.rdbms.postgres.models.StorageProfile - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, - 'version': {'key': 'properties.version', 'type': 'str'}, - 'ssl_enforcement': {'key': 'properties.sslEnforcement', 'type': 'SslEnforcementEnum'}, - 'user_visible_state': {'key': 'properties.userVisibleState', 'type': 'str'}, - 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, - 'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'}, - 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, - } - - def __init__(self, location, tags=None, sku=None, administrator_login=None, version=None, ssl_enforcement=None, user_visible_state=None, fully_qualified_domain_name=None, earliest_restore_date=None, storage_profile=None): - super(Server, self).__init__(location=location, tags=tags) - self.sku = sku - self.administrator_login = administrator_login - self.version = version - self.ssl_enforcement = ssl_enforcement - self.user_visible_state = user_visible_state - self.fully_qualified_domain_name = fully_qualified_domain_name - self.earliest_restore_date = earliest_restore_date - self.storage_profile = storage_profile diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_for_create.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_for_create.py deleted file mode 100644 index 16b0de4fd924..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_for_create.py +++ /dev/null @@ -1,46 +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 msrest.serialization import Model - - -class ServerForCreate(Model): - """Represents a server to be created. - - :param sku: The SKU (pricing tier) of the server. - :type sku: ~azure.mgmt.rdbms.postgres.models.Sku - :param properties: Properties of the server. - :type properties: - ~azure.mgmt.rdbms.postgres.models.ServerPropertiesForCreate - :param location: The location the resource resides in. - :type location: str - :param tags: Application-specific metadata in the form of key-value pairs. - :type tags: dict[str, str] - """ - - _validation = { - 'properties': {'required': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'properties': {'key': 'properties', 'type': 'ServerPropertiesForCreate'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, properties, location, sku=None, tags=None): - super(ServerForCreate, self).__init__() - self.sku = sku - self.properties = properties - self.location = location - self.tags = tags diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_paged.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_paged.py deleted file mode 100644 index 07cf2ada666e..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_paged.py +++ /dev/null @@ -1,27 +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 msrest.paging import Paged - - -class ServerPaged(Paged): - """ - A paging container for iterating over a list of :class:`Server ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Server]'} - } - - def __init__(self, *args, **kwargs): - - super(ServerPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_create.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_create.py deleted file mode 100644 index 5b8eb4bcfe74..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_create.py +++ /dev/null @@ -1,54 +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 msrest.serialization import Model - - -class ServerPropertiesForCreate(Model): - """The properties used to create a new server. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ServerPropertiesForDefaultCreate, - ServerPropertiesForRestore, ServerPropertiesForGeoRestore - - :param version: Server version. Possible values include: '9.5', '9.6' - :type version: str or ~azure.mgmt.rdbms.postgres.models.ServerVersion - :param ssl_enforcement: Enable ssl enforcement or not when connect to - server. Possible values include: 'Enabled', 'Disabled' - :type ssl_enforcement: str or - ~azure.mgmt.rdbms.postgres.models.SslEnforcementEnum - :param storage_profile: Storage profile of a server. - :type storage_profile: ~azure.mgmt.rdbms.postgres.models.StorageProfile - :param create_mode: Constant filled by server. - :type create_mode: str - """ - - _validation = { - 'create_mode': {'required': True}, - } - - _attribute_map = { - 'version': {'key': 'version', 'type': 'str'}, - 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, - 'create_mode': {'key': 'createMode', 'type': 'str'}, - } - - _subtype_map = { - 'create_mode': {'Default': 'ServerPropertiesForDefaultCreate', 'PointInTimeRestore': 'ServerPropertiesForRestore', 'GeoRestore': 'ServerPropertiesForGeoRestore'} - } - - def __init__(self, version=None, ssl_enforcement=None, storage_profile=None): - super(ServerPropertiesForCreate, self).__init__() - self.version = version - self.ssl_enforcement = ssl_enforcement - self.storage_profile = storage_profile - self.create_mode = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_default_create.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_default_create.py deleted file mode 100644 index c649e2f3c8f5..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_default_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 .server_properties_for_create import ServerPropertiesForCreate - - -class ServerPropertiesForDefaultCreate(ServerPropertiesForCreate): - """The properties used to create a new server. - - :param version: Server version. Possible values include: '9.5', '9.6' - :type version: str or ~azure.mgmt.rdbms.postgres.models.ServerVersion - :param ssl_enforcement: Enable ssl enforcement or not when connect to - server. Possible values include: 'Enabled', 'Disabled' - :type ssl_enforcement: str or - ~azure.mgmt.rdbms.postgres.models.SslEnforcementEnum - :param storage_profile: Storage profile of a server. - :type storage_profile: ~azure.mgmt.rdbms.postgres.models.StorageProfile - :param create_mode: Constant filled by server. - :type create_mode: str - :param administrator_login: The administrator's login name of a server. - Can only be specified when the server is being created (and is required - for creation). - :type administrator_login: str - :param administrator_login_password: The password of the administrator - login. - :type administrator_login_password: str - """ - - _validation = { - 'create_mode': {'required': True}, - 'administrator_login': {'required': True}, - 'administrator_login_password': {'required': True}, - } - - _attribute_map = { - 'version': {'key': 'version', 'type': 'str'}, - 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, - 'create_mode': {'key': 'createMode', 'type': 'str'}, - 'administrator_login': {'key': 'administratorLogin', 'type': 'str'}, - 'administrator_login_password': {'key': 'administratorLoginPassword', 'type': 'str'}, - } - - def __init__(self, administrator_login, administrator_login_password, version=None, ssl_enforcement=None, storage_profile=None): - super(ServerPropertiesForDefaultCreate, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile) - self.administrator_login = administrator_login - self.administrator_login_password = administrator_login_password - self.create_mode = 'Default' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_geo_restore.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_geo_restore.py deleted file mode 100644 index 95d76a168db5..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_geo_restore.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 .server_properties_for_create import ServerPropertiesForCreate - - -class ServerPropertiesForGeoRestore(ServerPropertiesForCreate): - """The properties to a new server by restoring from a geo replicated backup. - - :param version: Server version. Possible values include: '9.5', '9.6' - :type version: str or ~azure.mgmt.rdbms.postgres.models.ServerVersion - :param ssl_enforcement: Enable ssl enforcement or not when connect to - server. Possible values include: 'Enabled', 'Disabled' - :type ssl_enforcement: str or - ~azure.mgmt.rdbms.postgres.models.SslEnforcementEnum - :param storage_profile: Storage profile of a server. - :type storage_profile: ~azure.mgmt.rdbms.postgres.models.StorageProfile - :param create_mode: Constant filled by server. - :type create_mode: str - :param source_server_id: The source server id to restore from. - :type source_server_id: str - """ - - _validation = { - 'create_mode': {'required': True}, - 'source_server_id': {'required': True}, - } - - _attribute_map = { - 'version': {'key': 'version', 'type': 'str'}, - 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, - 'create_mode': {'key': 'createMode', 'type': 'str'}, - 'source_server_id': {'key': 'sourceServerId', 'type': 'str'}, - } - - def __init__(self, source_server_id, version=None, ssl_enforcement=None, storage_profile=None): - super(ServerPropertiesForGeoRestore, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile) - self.source_server_id = source_server_id - self.create_mode = 'GeoRestore' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_restore.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_restore.py deleted file mode 100644 index eec677e4ed72..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_properties_for_restore.py +++ /dev/null @@ -1,54 +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 .server_properties_for_create import ServerPropertiesForCreate - - -class ServerPropertiesForRestore(ServerPropertiesForCreate): - """The properties to a new server by restoring from a backup. - - :param version: Server version. Possible values include: '9.5', '9.6' - :type version: str or ~azure.mgmt.rdbms.postgres.models.ServerVersion - :param ssl_enforcement: Enable ssl enforcement or not when connect to - server. Possible values include: 'Enabled', 'Disabled' - :type ssl_enforcement: str or - ~azure.mgmt.rdbms.postgres.models.SslEnforcementEnum - :param storage_profile: Storage profile of a server. - :type storage_profile: ~azure.mgmt.rdbms.postgres.models.StorageProfile - :param create_mode: Constant filled by server. - :type create_mode: str - :param source_server_id: The source server id to restore from. - :type source_server_id: str - :param restore_point_in_time: Restore point creation time (ISO8601 - format), specifying the time to restore from. - :type restore_point_in_time: datetime - """ - - _validation = { - 'create_mode': {'required': True}, - 'source_server_id': {'required': True}, - 'restore_point_in_time': {'required': True}, - } - - _attribute_map = { - 'version': {'key': 'version', 'type': 'str'}, - 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, - 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, - 'create_mode': {'key': 'createMode', 'type': 'str'}, - 'source_server_id': {'key': 'sourceServerId', 'type': 'str'}, - 'restore_point_in_time': {'key': 'restorePointInTime', 'type': 'iso-8601'}, - } - - def __init__(self, source_server_id, restore_point_in_time, version=None, ssl_enforcement=None, storage_profile=None): - super(ServerPropertiesForRestore, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile) - self.source_server_id = source_server_id - self.restore_point_in_time = restore_point_in_time - self.create_mode = 'PointInTimeRestore' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_update_parameters.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_update_parameters.py deleted file mode 100644 index aed0ddeba0f6..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/server_update_parameters.py +++ /dev/null @@ -1,52 +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 msrest.serialization import Model - - -class ServerUpdateParameters(Model): - """Parameters allowd to update for a server. - - :param sku: The SKU (pricing tier) of the server. - :type sku: ~azure.mgmt.rdbms.postgres.models.Sku - :param storage_profile: Storage profile of a server. - :type storage_profile: ~azure.mgmt.rdbms.postgres.models.StorageProfile - :param administrator_login_password: The password of the administrator - login. - :type administrator_login_password: str - :param version: The version of a server. Possible values include: '9.5', - '9.6' - :type version: str or ~azure.mgmt.rdbms.postgres.models.ServerVersion - :param ssl_enforcement: Enable ssl enforcement or not when connect to - server. Possible values include: 'Enabled', 'Disabled' - :type ssl_enforcement: str or - ~azure.mgmt.rdbms.postgres.models.SslEnforcementEnum - :param tags: Application-specific metadata in the form of key-value pairs. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, - 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, - 'version': {'key': 'properties.version', 'type': 'str'}, - 'ssl_enforcement': {'key': 'properties.sslEnforcement', 'type': 'SslEnforcementEnum'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, sku=None, storage_profile=None, administrator_login_password=None, version=None, ssl_enforcement=None, tags=None): - super(ServerUpdateParameters, self).__init__() - self.sku = sku - self.storage_profile = storage_profile - self.administrator_login_password = administrator_login_password - self.version = version - self.ssl_enforcement = ssl_enforcement - self.tags = tags diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/sku.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/sku.py deleted file mode 100644 index f087762dfd82..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/sku.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 msrest.serialization import Model - - -class Sku(Model): - """Billing information related properties of a server. - - :param name: The name of the sku, typically, tier + family + cores, e.g. - B_Gen4_1, GP_Gen5_8. - :type name: str - :param tier: The tier of the particular SKU, e.g. Basic. Possible values - include: 'Basic', 'Standard' - :type tier: str or ~azure.mgmt.rdbms.postgres.models.SkuTier - :param capacity: The scale up/out capacity, representing server's compute - units. - :type capacity: int - :param size: The size code, to be interpreted by resource as appropriate. - :type size: str - :param family: The family of hardware. - :type family: str - """ - - _validation = { - 'capacity': {'minimum': 0}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - 'size': {'key': 'size', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - } - - def __init__(self, name=None, tier=None, capacity=None, size=None, family=None): - super(Sku, self).__init__() - self.name = name - self.tier = tier - self.capacity = capacity - self.size = size - self.family = family diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/storage_profile.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/storage_profile.py deleted file mode 100644 index c60fedde2174..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/storage_profile.py +++ /dev/null @@ -1,38 +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 msrest.serialization import Model - - -class StorageProfile(Model): - """Storage Profile properties of a server. - - :param backup_retention_days: Backup retention days for the server. - :type backup_retention_days: int - :param geo_redundant_backup: Enable Geo-redundant or not for server - backup. Possible values include: 'Enabled', 'Disabled' - :type geo_redundant_backup: str or - ~azure.mgmt.rdbms.postgres.models.GeoRedundantBackup - :param storage_mb: Max storage allowed for a server. - :type storage_mb: int - """ - - _attribute_map = { - 'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'}, - 'geo_redundant_backup': {'key': 'geoRedundantBackup', 'type': 'str'}, - 'storage_mb': {'key': 'storageMB', 'type': 'int'}, - } - - def __init__(self, backup_retention_days=None, geo_redundant_backup=None, storage_mb=None): - super(StorageProfile, self).__init__() - self.backup_retention_days = backup_retention_days - self.geo_redundant_backup = geo_redundant_backup - self.storage_mb = storage_mb diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/tracked_resource.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/tracked_resource.py deleted file mode 100644 index 0d199e6f6f97..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/models/tracked_resource.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 .proxy_resource import ProxyResource - - -class TrackedResource(ProxyResource): - """Resource properties including location and tags for track resources. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: The location the resource resides in. - :type location: str - :param tags: Application-specific metadata in the form of key-value pairs. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, location, tags=None): - super(TrackedResource, self).__init__() - self.location = location - self.tags = tags diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/__init__.py deleted file mode 100644 index 323618c0dd5f..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/__init__.py +++ /dev/null @@ -1,30 +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 .servers_operations import ServersOperations -from .firewall_rules_operations import FirewallRulesOperations -from .databases_operations import DatabasesOperations -from .configurations_operations import ConfigurationsOperations -from .log_files_operations import LogFilesOperations -from .location_based_performance_tier_operations import LocationBasedPerformanceTierOperations -from .check_name_availability_operations import CheckNameAvailabilityOperations -from .operations import Operations - -__all__ = [ - 'ServersOperations', - 'FirewallRulesOperations', - 'DatabasesOperations', - 'ConfigurationsOperations', - 'LogFilesOperations', - 'LocationBasedPerformanceTierOperations', - 'CheckNameAvailabilityOperations', - 'Operations', -] diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/check_name_availability_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/check_name_availability_operations.py deleted file mode 100644 index 27e95fcb81f3..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/check_name_availability_operations.py +++ /dev/null @@ -1,103 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class CheckNameAvailabilityOperations(object): - """CheckNameAvailabilityOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-12-01-preview" - - self.config = config - - def execute( - self, name, type=None, custom_headers=None, raw=False, **operation_config): - """Check the availability of name for resource. - - :param name: Resource name to verify. - :type name: str - :param type: Resource type used for verification. - :type type: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: NameAvailability or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.rdbms.postgres.models.NameAvailability or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - name_availability_request = models.NameAvailabilityRequest(name=name, type=type) - - # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/checkNameAvailability' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(name_availability_request, 'NameAvailabilityRequest') - - # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('NameAvailability', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/configurations_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/configurations_operations.py deleted file mode 100644 index 1d587b53eaf6..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/configurations_operations.py +++ /dev/null @@ -1,306 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller - -from .. import models - - -class ConfigurationsOperations(object): - """ConfigurationsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-12-01-preview" - - self.config = config - - - def _create_or_update_initial( - self, resource_group_name, server_name, configuration_name, value=None, source=None, custom_headers=None, raw=False, **operation_config): - parameters = models.Configuration(value=value, source=source) - - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/configurations/{configurationName}' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'Configuration') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Configuration', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, server_name, configuration_name, value=None, source=None, custom_headers=None, raw=False, **operation_config): - """Updates a configuration of a server. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param configuration_name: The name of the server configuration. - :type configuration_name: str - :param value: Value of the configuration. - :type value: str - :param source: Source of the configuration. - :type source: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - Configuration or ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgres.models.Configuration] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - server_name=server_name, - configuration_name=configuration_name, - value=value, - source=source, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) - - def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = self._deserialize('Configuration', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - long_running_operation_timeout = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) - - def get( - self, resource_group_name, server_name, configuration_name, custom_headers=None, raw=False, **operation_config): - """Gets information about a configuration of server. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param configuration_name: The name of the server configuration. - :type configuration_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Configuration or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.rdbms.postgres.models.Configuration or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/configurations/{configurationName}' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Configuration', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def list_by_server( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """List all the configurations in a given server. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Configuration - :rtype: - ~azure.mgmt.rdbms.postgres.models.ConfigurationPaged[~azure.mgmt.rdbms.postgres.models.Configuration] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/configurations' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.ConfigurationPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/databases_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/databases_operations.py deleted file mode 100644 index b73001e7ba32..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/databases_operations.py +++ /dev/null @@ -1,412 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller - -from .. import models - - -class DatabasesOperations(object): - """DatabasesOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-12-01-preview" - - self.config = config - - - def _create_or_update_initial( - self, resource_group_name, server_name, database_name, charset=None, collation=None, custom_headers=None, raw=False, **operation_config): - parameters = models.Database(charset=charset, collation=collation) - - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases/{databaseName}' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'Database') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) - - if response.status_code not in [200, 201, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Database', response) - if response.status_code == 201: - deserialized = self._deserialize('Database', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, server_name, database_name, charset=None, collation=None, custom_headers=None, raw=False, **operation_config): - """Creates a new database or updates an existing database. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param charset: The charset of the database. - :type charset: str - :param collation: The collation of the database. - :type collation: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Database or - ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgres.models.Database] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - charset=charset, - collation=collation, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) - - def get_long_running_output(response): - - if response.status_code not in [200, 201, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = self._deserialize('Database', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - long_running_operation_timeout = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) - - - def _delete_initial( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases/{databaseName}' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - """Deletes a database. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) - - def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - long_running_operation_timeout = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) - - def get( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - """Gets information about a database. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Database or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.rdbms.postgres.models.Database or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases/{databaseName}' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Database', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def list_by_server( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """List all the databases in a given server. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Database - :rtype: - ~azure.mgmt.rdbms.postgres.models.DatabasePaged[~azure.mgmt.rdbms.postgres.models.Database] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/databases' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.DatabasePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.DatabasePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/firewall_rules_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/firewall_rules_operations.py deleted file mode 100644 index ea23a0805839..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/firewall_rules_operations.py +++ /dev/null @@ -1,414 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller - -from .. import models - - -class FirewallRulesOperations(object): - """FirewallRulesOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-12-01-preview" - - self.config = config - - - def _create_or_update_initial( - self, resource_group_name, server_name, firewall_rule_name, start_ip_address, end_ip_address, custom_headers=None, raw=False, **operation_config): - parameters = models.FirewallRule(start_ip_address=start_ip_address, end_ip_address=end_ip_address) - - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'FirewallRule') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) - - if response.status_code not in [200, 201, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('FirewallRule', response) - if response.status_code == 201: - deserialized = self._deserialize('FirewallRule', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, server_name, firewall_rule_name, start_ip_address, end_ip_address, custom_headers=None, raw=False, **operation_config): - """Creates a new firewall rule or updates an existing firewall rule. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param firewall_rule_name: The name of the server firewall rule. - :type firewall_rule_name: str - :param start_ip_address: The start IP address of the server firewall - rule. Must be IPv4 format. - :type start_ip_address: str - :param end_ip_address: The end IP address of the server firewall rule. - Must be IPv4 format. - :type end_ip_address: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns FirewallRule - or ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgres.models.FirewallRule] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - server_name=server_name, - firewall_rule_name=firewall_rule_name, - start_ip_address=start_ip_address, - end_ip_address=end_ip_address, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) - - def get_long_running_output(response): - - if response.status_code not in [200, 201, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = self._deserialize('FirewallRule', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - long_running_operation_timeout = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) - - - def _delete_initial( - self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): - """Deletes a server firewall rule. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param firewall_rule_name: The name of the server firewall rule. - :type firewall_rule_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - firewall_rule_name=firewall_rule_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) - - def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - long_running_operation_timeout = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) - - def get( - self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): - """Gets information about a server firewall rule. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param firewall_rule_name: The name of the server firewall rule. - :type firewall_rule_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: FirewallRule or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.rdbms.postgres.models.FirewallRule or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules/{firewallRuleName}' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('FirewallRule', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def list_by_server( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """List all the firewall rules in a given server. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of FirewallRule - :rtype: - ~azure.mgmt.rdbms.postgres.models.FirewallRulePaged[~azure.mgmt.rdbms.postgres.models.FirewallRule] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/firewallRules' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.FirewallRulePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.FirewallRulePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/location_based_performance_tier_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/location_based_performance_tier_operations.py deleted file mode 100644 index 5021591d0bea..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/location_based_performance_tier_operations.py +++ /dev/null @@ -1,106 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class LocationBasedPerformanceTierOperations(object): - """LocationBasedPerformanceTierOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-12-01-preview" - - self.config = config - - def list( - self, location_name, custom_headers=None, raw=False, **operation_config): - """List all the performance tiers at specified location in a given - subscription. - - :param location_name: The name of the location. - :type location_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of PerformanceTierProperties - :rtype: - ~azure.mgmt.rdbms.postgres.models.PerformanceTierPropertiesPaged[~azure.mgmt.rdbms.postgres.models.PerformanceTierProperties] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/locations/{locationName}/performanceTiers' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'locationName': self._serialize.url("location_name", location_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.PerformanceTierPropertiesPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.PerformanceTierPropertiesPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/log_files_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/log_files_operations.py deleted file mode 100644 index 58e333927f6d..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/log_files_operations.py +++ /dev/null @@ -1,110 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class LogFilesOperations(object): - """LogFilesOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-12-01-preview" - - self.config = config - - def list_by_server( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """List all the log files in a given server. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of LogFile - :rtype: - ~azure.mgmt.rdbms.postgres.models.LogFilePaged[~azure.mgmt.rdbms.postgres.models.LogFile] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/logFiles' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.LogFilePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.LogFilePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/operations.py deleted file mode 100644 index c109975b4598..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/operations.py +++ /dev/null @@ -1,89 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class Operations(object): - """Operations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-12-01-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all of the available REST API operations. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: OperationListResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.rdbms.postgres.models.OperationListResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = '/providers/Microsoft.DBforPostgreSQL/operations' - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('OperationListResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/servers_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/servers_operations.py deleted file mode 100644 index 80743be3588f..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/operations/servers_operations.py +++ /dev/null @@ -1,579 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller - -from .. import models - - -class ServersOperations(object): - """ServersOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-12-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-12-01-preview" - - self.config = config - - - def _create_initial( - self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ServerForCreate') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) - - if response.status_code not in [200, 201, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Server', response) - if response.status_code == 201: - deserialized = self._deserialize('Server', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create( - self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): - """Creates a new server, or will overwrite an existing server. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param parameters: The required parameters for creating or updating a - server. - :type parameters: ~azure.mgmt.rdbms.postgres.models.ServerForCreate - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Server or - ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgres.models.Server] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - raw_result = self._create_initial( - resource_group_name=resource_group_name, - server_name=server_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) - - def get_long_running_output(response): - - if response.status_code not in [200, 201, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = self._deserialize('Server', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - long_running_operation_timeout = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) - - - def _update_initial( - self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ServerUpdateParameters') - - # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Server', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): - """Updates an existing server. The request body can contain one to many of - the properties present in the normal server definition. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param parameters: The required parameters for updating a server. - :type parameters: - ~azure.mgmt.rdbms.postgres.models.ServerUpdateParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns Server or - ClientRawResponse if raw=true - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.postgres.models.Server] - or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - server_name=server_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) - - def get_long_running_output(response): - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = self._deserialize('Server', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - long_running_operation_timeout = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) - - - def _delete_initial( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """Deletes a server. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) - - def get_long_running_output(response): - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - long_running_operation_timeout = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) - - def get( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """Gets information about a server. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Server or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.rdbms.postgres.models.Server or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Server', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """List all the servers in a given resource group. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Server - :rtype: - ~azure.mgmt.rdbms.postgres.models.ServerPaged[~azure.mgmt.rdbms.postgres.models.Server] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.ServerPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ServerPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - - def list( - self, custom_headers=None, raw=False, **operation_config): - """List all the servers in a given subscription. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Server - :rtype: - ~azure.mgmt.rdbms.postgres.models.ServerPaged[~azure.mgmt.rdbms.postgres.models.Server] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.DBforPostgreSQL/servers' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.ServerPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ServerPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/postgre_sql_management_client.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/postgre_sql_management_client.py deleted file mode 100644 index f35de6043838..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/postgre_sql_management_client.py +++ /dev/null @@ -1,118 +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 msrest.service_client import ServiceClient -from msrest import Serializer, Deserializer -from msrestazure import AzureConfiguration -from .version import VERSION -from .operations.servers_operations import ServersOperations -from .operations.firewall_rules_operations import FirewallRulesOperations -from .operations.databases_operations import DatabasesOperations -from .operations.configurations_operations import ConfigurationsOperations -from .operations.log_files_operations import LogFilesOperations -from .operations.location_based_performance_tier_operations import LocationBasedPerformanceTierOperations -from .operations.check_name_availability_operations import CheckNameAvailabilityOperations -from .operations.operations import Operations -from . import models - - -class PostgreSQLManagementClientConfiguration(AzureConfiguration): - """Configuration for PostgreSQLManagementClient - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: The subscription ID that identifies an Azure - subscription. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' - - super(PostgreSQLManagementClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-rdbms/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id - - -class PostgreSQLManagementClient(object): - """The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, log files and configurations with new business model. - - :ivar config: Configuration for client. - :vartype config: PostgreSQLManagementClientConfiguration - - :ivar servers: Servers operations - :vartype servers: azure.mgmt.rdbms.postgres.operations.ServersOperations - :ivar firewall_rules: FirewallRules operations - :vartype firewall_rules: azure.mgmt.rdbms.postgres.operations.FirewallRulesOperations - :ivar databases: Databases operations - :vartype databases: azure.mgmt.rdbms.postgres.operations.DatabasesOperations - :ivar configurations: Configurations operations - :vartype configurations: azure.mgmt.rdbms.postgres.operations.ConfigurationsOperations - :ivar log_files: LogFiles operations - :vartype log_files: azure.mgmt.rdbms.postgres.operations.LogFilesOperations - :ivar location_based_performance_tier: LocationBasedPerformanceTier operations - :vartype location_based_performance_tier: azure.mgmt.rdbms.postgres.operations.LocationBasedPerformanceTierOperations - :ivar check_name_availability: CheckNameAvailability operations - :vartype check_name_availability: azure.mgmt.rdbms.postgres.operations.CheckNameAvailabilityOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.rdbms.postgres.operations.Operations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: The subscription ID that identifies an Azure - subscription. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = PostgreSQLManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2017-12-01-preview' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.servers = ServersOperations( - self._client, self.config, self._serialize, self._deserialize) - self.firewall_rules = FirewallRulesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.databases = DatabasesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.configurations = ConfigurationsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.log_files = LogFilesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.location_based_performance_tier = LocationBasedPerformanceTierOperations( - self._client, self.config, self._serialize, self._deserialize) - self.check_name_availability = CheckNameAvailabilityOperations( - self._client, self.config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/version.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/version.py deleted file mode 100644 index d2d4445f16cf..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgres/version.py +++ /dev/null @@ -1,13 +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. -# -------------------------------------------------------------------------- - -VERSION = "2017-12-01-preview" - From 8644b34d36b9562eed41bec634ca7c38dbded540 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 26 Feb 2018 15:16:22 -0800 Subject: [PATCH 7/7] azure-mgmt-rdbms 0.3.0 --- azure-mgmt-rdbms/HISTORY.rst | 5 +++++ azure-mgmt-rdbms/README.rst | 12 ++++++++---- azure-mgmt-rdbms/azure/mgmt/rdbms/version.py | 2 +- azure-mgmt-rdbms/setup.py | 3 +-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/azure-mgmt-rdbms/HISTORY.rst b/azure-mgmt-rdbms/HISTORY.rst index 8910ae26f490..114fa329e424 100644 --- a/azure-mgmt-rdbms/HISTORY.rst +++ b/azure-mgmt-rdbms/HISTORY.rst @@ -3,6 +3,11 @@ Release History =============== +0.3.0 (2018-02-26) +++++++++++++++++++ + +* New pricing model release + 0.2.0rc1 (2017-10-16) +++++++++++++++++++++ diff --git a/azure-mgmt-rdbms/README.rst b/azure-mgmt-rdbms/README.rst index e0e0785c8ba2..fd71c9b33560 100644 --- a/azure-mgmt-rdbms/README.rst +++ b/azure-mgmt-rdbms/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure RDBMS Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.3, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. @@ -36,9 +36,13 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -For code examples, see `RDBMS Management -`__ -on readthedocs.org. +For code examples, see `PostgreSQL +`__ +on docs.microsoft.com. + +For code examples, see `MySQL +`__ +on docs.microsoft.com. Provide Feedback diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/version.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/version.py index e9a76ff7bb14..b0f482b01aee 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/version.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/version.py @@ -5,5 +5,5 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "0.2.0rc1" +VERSION = "0.3.0" diff --git a/azure-mgmt-rdbms/setup.py b/azure-mgmt-rdbms/setup.py index a2e98708304a..34fa7582f79c 100644 --- a/azure-mgmt-rdbms/setup.py +++ b/azure-mgmt-rdbms/setup.py @@ -69,7 +69,6 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', @@ -78,7 +77,7 @@ zip_safe=False, packages=find_packages(exclude=["tests"]), install_requires=[ - 'msrestazure~=0.4.11', + 'msrestazure>=0.4.20,<2.0.0', 'azure-common~=1.1', ], cmdclass=cmdclass