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/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..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,15 +11,16 @@ 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 .virtual_network_rule import VirtualNetworkRule from .database import Database from .configuration import Configuration from .operation_display import OperationDisplay @@ -32,7 +33,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 @@ -41,23 +41,24 @@ ServerVersion, SslEnforcementEnum, ServerState, + GeoRedundantBackup, SkuTier, - VirtualNetworkRuleState, OperationOrigin, ) __all__ = [ 'ProxyResource', 'TrackedResource', + 'StorageProfile', 'ServerPropertiesForCreate', 'ServerPropertiesForDefaultCreate', 'ServerPropertiesForRestore', + 'ServerPropertiesForGeoRestore', 'Sku', 'Server', 'ServerForCreate', 'ServerUpdateParameters', 'FirewallRule', - 'VirtualNetworkRule', 'Database', 'Configuration', 'OperationDisplay', @@ -70,7 +71,6 @@ 'NameAvailability', 'ServerPaged', 'FirewallRulePaged', - 'VirtualNetworkRulePaged', 'DatabasePaged', 'ConfigurationPaged', 'LogFilePaged', @@ -78,7 +78,7 @@ 'ServerVersion', 'SslEnforcementEnum', 'ServerState', + 'GeoRedundantBackup', 'SkuTier', - 'VirtualNetworkRuleState', 'OperationOrigin', ] 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/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..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,19 +31,17 @@ class ServerState(Enum): disabled = "Disabled" -class SkuTier(Enum): +class GeoRedundantBackup(Enum): - basic = "Basic" - standard = "Standard" + enabled = "Enabled" + disabled = "Disabled" -class VirtualNetworkRuleState(Enum): +class SkuTier(Enum): - initializing = "Initializing" - in_progress = "InProgress" - ready = "Ready" - deleting = "Deleting" - unknown = "Unknown" + basic = "Basic" + general_purpose = "GeneralPurpose" + memory_optimized = "MemoryOptimized" class OperationOrigin(Enum): 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..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,11 +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 72c5b74be4b1..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,23 +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/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.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_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..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,38 +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): - self.storage_mb = storage_mb + 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/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 b70b5542d3bc..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,22 +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 33140f04ad9d..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. @@ -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/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/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/models/virtual_network_rule_paged.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/virtual_network_rule_paged.py deleted file mode 100644 index a7eaf18d22bc..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/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/mysql/my_sql_management_client.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/my_sql_management_client.py index 011bb63cb449..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 @@ -15,11 +15,9 @@ 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 -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 @@ -52,7 +50,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 +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, 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 with new business model. :ivar config: Configuration for client. :vartype config: MySQLManagementClientConfiguration @@ -69,16 +67,12 @@ 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 :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 @@ -102,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) @@ -110,16 +104,12 @@ 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( 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 970bb5f9b83e..323618c0dd5f 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/__init__.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/__init__.py @@ -11,11 +11,9 @@ 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 -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 @@ -23,11 +21,9 @@ __all__ = [ 'ServersOperations', 'FirewallRulesOperations', - 'VirtualNetworkRulesOperations', '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 8807ec21c411..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,15 +23,17 @@ 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 + 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 @@ -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..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 @@ -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 @@ -24,44 +25,23 @@ 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 + 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( - 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..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 @@ -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 @@ -24,44 +25,23 @@ 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 + 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( - 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..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 @@ -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 @@ -24,46 +25,23 @@ 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 + 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( - 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..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,15 +23,17 @@ 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 + 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 @@ -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..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,15 +23,17 @@ 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 + 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 @@ -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..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,15 +23,17 @@ 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 + 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 @@ -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 deleted file mode 100644 index ec508f423582..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/performance_tiers_operations.py +++ /dev/null @@ -1,100 +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". - """ - - 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, **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 6d6c9a4eca98..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 @@ -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 @@ -24,42 +25,23 @@ 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 + 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( - 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_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( + 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_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/operations/virtual_network_rules_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/virtual_network_rules_operations.py deleted file mode 100644 index 365809856bb8..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/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.mysql.models.VirtualNetworkRule or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/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.mysql.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.DBforMySQL/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.DBforMySQL/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.mysql.models.VirtualNetworkRulePaged[~azure.mgmt.rdbms.mysql.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.DBforMySQL/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/mysql/version.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/version.py index e0ec669828cb..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 = "0.1.0" +VERSION = "2017-12-01-preview" 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..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,15 +11,16 @@ 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 .virtual_network_rule import VirtualNetworkRule from .database import Database from .configuration import Configuration from .operation_display import OperationDisplay @@ -32,7 +33,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 @@ -41,23 +41,24 @@ ServerVersion, SslEnforcementEnum, ServerState, + GeoRedundantBackup, SkuTier, - VirtualNetworkRuleState, OperationOrigin, ) __all__ = [ 'ProxyResource', 'TrackedResource', + 'StorageProfile', 'ServerPropertiesForCreate', 'ServerPropertiesForDefaultCreate', 'ServerPropertiesForRestore', + 'ServerPropertiesForGeoRestore', 'Sku', 'Server', 'ServerForCreate', 'ServerUpdateParameters', 'FirewallRule', - 'VirtualNetworkRule', 'Database', 'Configuration', 'OperationDisplay', @@ -70,7 +71,6 @@ 'NameAvailability', 'ServerPaged', 'FirewallRulePaged', - 'VirtualNetworkRulePaged', 'DatabasePaged', 'ConfigurationPaged', 'LogFilePaged', @@ -78,7 +78,7 @@ 'ServerVersion', 'SslEnforcementEnum', 'ServerState', + 'GeoRedundantBackup', 'SkuTier', - 'VirtualNetworkRuleState', 'OperationOrigin', ] 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 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..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,11 +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 72c5b74be4b1..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,23 +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 0ad7b32a369c..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,19 +31,16 @@ class ServerState(Enum): disabled = "Disabled" -class SkuTier(Enum): +class GeoRedundantBackup(Enum): - basic = "Basic" - standard = "Standard" + enabled = "Enabled" + disabled = "Disabled" -class VirtualNetworkRuleState(Enum): +class SkuTier(Enum): - initializing = "Initializing" - in_progress = "InProgress" - ready = "Ready" - deleting = "Deleting" - unknown = "Unknown" + basic = "Basic" + standard = "Standard" class OperationOrigin(Enum): 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.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_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..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,38 +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): - self.storage_mb = storage_mb + 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/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 f149b2080b10..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,22 +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 b08828ed1a03..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' @@ -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/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/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..323618c0dd5f 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/__init__.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/__init__.py @@ -11,11 +11,9 @@ 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 -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 @@ -23,11 +21,9 @@ __all__ = [ 'ServersOperations', 'FirewallRulesOperations', - 'VirtualNetworkRulesOperations', '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 e223d1e39b80..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,15 +23,17 @@ 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 + 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 @@ -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..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 @@ -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 @@ -24,44 +25,23 @@ 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 + 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( - 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..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 @@ -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 @@ -24,44 +25,23 @@ 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 + 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( - 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..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 @@ -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 @@ -24,46 +25,23 @@ 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 + 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( - 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..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,15 +23,17 @@ 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 + 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 @@ -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..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,15 +23,17 @@ 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 + 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 @@ -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..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,15 +23,17 @@ 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 + 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 @@ -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 deleted file mode 100644 index c213a876d50b..000000000000 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/operations/performance_tiers_operations.py +++ /dev/null @@ -1,100 +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". - """ - - 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, **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 c3297da03542..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 @@ -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 @@ -24,41 +25,23 @@ 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 + 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( - 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..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 @@ -15,11 +15,9 @@ 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 -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 @@ -52,7 +50,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 +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, 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 with new business model. :ivar config: Configuration for client. :vartype config: PostgreSQLManagementClientConfiguration @@ -69,16 +67,12 @@ 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 :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 @@ -102,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) @@ -110,16 +104,12 @@ 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( 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 e0ec669828cb..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 = "0.1.0" +VERSION = "2017-12-01-preview" 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