diff --git a/azure-mgmt-sqlvirtualmachine/HISTORY.rst b/azure-mgmt-sqlvirtualmachine/HISTORY.rst new file mode 100644 index 000000000000..8924d5d6c445 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (1970-01-01) +++++++++++++++++++ + +* Initial Release diff --git a/azure-mgmt-sqlvirtualmachine/MANIFEST.in b/azure-mgmt-sqlvirtualmachine/MANIFEST.in new file mode 100644 index 000000000000..6ceb27f7a96e --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/MANIFEST.in @@ -0,0 +1,4 @@ +include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-sqlvirtualmachine/README.rst b/azure-mgmt-sqlvirtualmachine/README.rst new file mode 100644 index 000000000000..45de4e6b43dd --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/README.rst @@ -0,0 +1,49 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure MyService 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.4, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Compatibility +============= + +**IMPORTANT**: If you have an earlier version of the azure package +(version < 1.0), you should uninstall it before installing this package. + +You can check the version using pip: + +.. code:: shell + + pip freeze + +If you see azure==0.11.0 (or any version below 1.0), uninstall it first: + +.. code:: shell + + pip uninstall azure + + +Usage +===== + +For code examples, see `MyService Management +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. diff --git a/azure-mgmt-sqlvirtualmachine/azure/__init__.py b/azure-mgmt-sqlvirtualmachine/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/__init__.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/__init__.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/__init__.py new file mode 100644 index 000000000000..d5491dd89ac6 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sql_virtual_machine_management_client import SqlVirtualMachineManagementClient +from .version import VERSION + +__all__ = ['SqlVirtualMachineManagementClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/__init__.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/__init__.py new file mode 100644 index 000000000000..5855d2727ed8 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/__init__.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from .private_ip_address_py3 import PrivateIPAddress + from .load_balancer_configuration_py3 import LoadBalancerConfiguration + from .resource_py3 import Resource + from .proxy_resource_py3 import ProxyResource + from .availability_group_listener_py3 import AvailabilityGroupListener + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation + from .wsfc_domain_profile_py3 import WsfcDomainProfile + from .tracked_resource_py3 import TrackedResource + from .sql_virtual_machine_group_py3 import SqlVirtualMachineGroup + from .sql_virtual_machine_group_update_py3 import SqlVirtualMachineGroupUpdate + from .resource_identity_py3 import ResourceIdentity + from .wsfc_domain_credentials_py3 import WsfcDomainCredentials + from .auto_patching_settings_py3 import AutoPatchingSettings + from .auto_backup_settings_py3 import AutoBackupSettings + from .key_vault_credential_settings_py3 import KeyVaultCredentialSettings + from .sql_connectivity_update_settings_py3 import SqlConnectivityUpdateSettings + from .sql_workload_type_update_settings_py3 import SqlWorkloadTypeUpdateSettings + from .sql_storage_update_settings_py3 import SqlStorageUpdateSettings + from .additional_features_server_configurations_py3 import AdditionalFeaturesServerConfigurations + from .server_configurations_management_settings_py3 import ServerConfigurationsManagementSettings + from .sql_virtual_machine_py3 import SqlVirtualMachine + from .sql_virtual_machine_update_py3 import SqlVirtualMachineUpdate +except (SyntaxError, ImportError): + from .private_ip_address import PrivateIPAddress + from .load_balancer_configuration import LoadBalancerConfiguration + from .resource import Resource + from .proxy_resource import ProxyResource + from .availability_group_listener import AvailabilityGroupListener + from .operation_display import OperationDisplay + from .operation import Operation + from .wsfc_domain_profile import WsfcDomainProfile + from .tracked_resource import TrackedResource + from .sql_virtual_machine_group import SqlVirtualMachineGroup + from .sql_virtual_machine_group_update import SqlVirtualMachineGroupUpdate + from .resource_identity import ResourceIdentity + from .wsfc_domain_credentials import WsfcDomainCredentials + from .auto_patching_settings import AutoPatchingSettings + from .auto_backup_settings import AutoBackupSettings + from .key_vault_credential_settings import KeyVaultCredentialSettings + from .sql_connectivity_update_settings import SqlConnectivityUpdateSettings + from .sql_workload_type_update_settings import SqlWorkloadTypeUpdateSettings + from .sql_storage_update_settings import SqlStorageUpdateSettings + from .additional_features_server_configurations import AdditionalFeaturesServerConfigurations + from .server_configurations_management_settings import ServerConfigurationsManagementSettings + from .sql_virtual_machine import SqlVirtualMachine + from .sql_virtual_machine_update import SqlVirtualMachineUpdate +from .availability_group_listener_paged import AvailabilityGroupListenerPaged +from .operation_paged import OperationPaged +from .sql_virtual_machine_group_paged import SqlVirtualMachineGroupPaged +from .sql_virtual_machine_paged import SqlVirtualMachinePaged +from .sql_virtual_machine_management_client_enums import ( + OperationOrigin, + SqlImageSku, + ScaleType, + ClusterManagerType, + ClusterConfiguration, + IdentityType, + SqlServerLicenseType, + DayOfWeek, + BackupScheduleType, + FullBackupFrequencyType, + ConnectivityType, + SqlWorkloadType, + DiskConfigurationType, +) + +__all__ = [ + 'PrivateIPAddress', + 'LoadBalancerConfiguration', + 'Resource', + 'ProxyResource', + 'AvailabilityGroupListener', + 'OperationDisplay', + 'Operation', + 'WsfcDomainProfile', + 'TrackedResource', + 'SqlVirtualMachineGroup', + 'SqlVirtualMachineGroupUpdate', + 'ResourceIdentity', + 'WsfcDomainCredentials', + 'AutoPatchingSettings', + 'AutoBackupSettings', + 'KeyVaultCredentialSettings', + 'SqlConnectivityUpdateSettings', + 'SqlWorkloadTypeUpdateSettings', + 'SqlStorageUpdateSettings', + 'AdditionalFeaturesServerConfigurations', + 'ServerConfigurationsManagementSettings', + 'SqlVirtualMachine', + 'SqlVirtualMachineUpdate', + 'AvailabilityGroupListenerPaged', + 'OperationPaged', + 'SqlVirtualMachineGroupPaged', + 'SqlVirtualMachinePaged', + 'OperationOrigin', + 'SqlImageSku', + 'ScaleType', + 'ClusterManagerType', + 'ClusterConfiguration', + 'IdentityType', + 'SqlServerLicenseType', + 'DayOfWeek', + 'BackupScheduleType', + 'FullBackupFrequencyType', + 'ConnectivityType', + 'SqlWorkloadType', + 'DiskConfigurationType', +] diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/additional_features_server_configurations.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/additional_features_server_configurations.py new file mode 100644 index 000000000000..cd976abb8474 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/additional_features_server_configurations.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 AdditionalFeaturesServerConfigurations(Model): + """Additional SQL Server feature settings. + + :param is_rservices_enabled: Enable or disable R services (SQL 2016 + onwards). + :type is_rservices_enabled: bool + :param backup_permissions_for_azure_backup_svc: Enable or disable Azure + Backup service. + :type backup_permissions_for_azure_backup_svc: bool + """ + + _attribute_map = { + 'is_rservices_enabled': {'key': 'isRServicesEnabled', 'type': 'bool'}, + 'backup_permissions_for_azure_backup_svc': {'key': 'backupPermissionsForAzureBackupSvc', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(AdditionalFeaturesServerConfigurations, self).__init__(**kwargs) + self.is_rservices_enabled = kwargs.get('is_rservices_enabled', None) + self.backup_permissions_for_azure_backup_svc = kwargs.get('backup_permissions_for_azure_backup_svc', None) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/additional_features_server_configurations_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/additional_features_server_configurations_py3.py new file mode 100644 index 000000000000..6fd2cc8931bf --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/additional_features_server_configurations_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 AdditionalFeaturesServerConfigurations(Model): + """Additional SQL Server feature settings. + + :param is_rservices_enabled: Enable or disable R services (SQL 2016 + onwards). + :type is_rservices_enabled: bool + :param backup_permissions_for_azure_backup_svc: Enable or disable Azure + Backup service. + :type backup_permissions_for_azure_backup_svc: bool + """ + + _attribute_map = { + 'is_rservices_enabled': {'key': 'isRServicesEnabled', 'type': 'bool'}, + 'backup_permissions_for_azure_backup_svc': {'key': 'backupPermissionsForAzureBackupSvc', 'type': 'bool'}, + } + + def __init__(self, *, is_rservices_enabled: bool=None, backup_permissions_for_azure_backup_svc: bool=None, **kwargs) -> None: + super(AdditionalFeaturesServerConfigurations, self).__init__(**kwargs) + self.is_rservices_enabled = is_rservices_enabled + self.backup_permissions_for_azure_backup_svc = backup_permissions_for_azure_backup_svc diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/auto_backup_settings.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/auto_backup_settings.py new file mode 100644 index 000000000000..dbeab14c0e17 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/auto_backup_settings.py @@ -0,0 +1,83 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 AutoBackupSettings(Model): + """Configure backups for databases in your SQL virtual machine. + + :param enable: Enable or disable autobackup on SQL virtual machine. + :type enable: bool + :param enable_encryption: Enable or disable encryption for backup on SQL + virtual machine. + :type enable_encryption: bool + :param retention_period: Retention period of backup: 1-30 days. + :type retention_period: int + :param storage_account_url: Storage account url where backup will be taken + to. + :type storage_account_url: str + :param storage_access_key: Storage account key where backup will be taken + to. + :type storage_access_key: str + :param password: Password for encryption on backup. + :type password: str + :param backup_system_dbs: Include or exclude system databases from auto + backup. + :type backup_system_dbs: bool + :param backup_schedule_type: Backup schedule type. Possible values + include: 'Manual', 'Automated' + :type backup_schedule_type: str or + ~azure.mgmt.sqlvirtualmachine.models.BackupScheduleType + :param full_backup_frequency: Frequency of full backups. In both cases, + full backups begin during the next scheduled time window. Possible values + include: 'Daily', 'Weekly' + :type full_backup_frequency: str or + ~azure.mgmt.sqlvirtualmachine.models.FullBackupFrequencyType + :param full_backup_start_time: Start time of a given day during which full + backups can take place. 0-23 hours. + :type full_backup_start_time: int + :param full_backup_window_hours: Duration of the time window of a given + day during which full backups can take place. 1-23 hours. + :type full_backup_window_hours: int + :param log_backup_frequency: Frequency of log backups. 5-60 minutes. + :type log_backup_frequency: int + """ + + _attribute_map = { + 'enable': {'key': 'enable', 'type': 'bool'}, + 'enable_encryption': {'key': 'enableEncryption', 'type': 'bool'}, + 'retention_period': {'key': 'retentionPeriod', 'type': 'int'}, + 'storage_account_url': {'key': 'storageAccountUrl', 'type': 'str'}, + 'storage_access_key': {'key': 'storageAccessKey', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'backup_system_dbs': {'key': 'backupSystemDbs', 'type': 'bool'}, + 'backup_schedule_type': {'key': 'backupScheduleType', 'type': 'str'}, + 'full_backup_frequency': {'key': 'fullBackupFrequency', 'type': 'str'}, + 'full_backup_start_time': {'key': 'fullBackupStartTime', 'type': 'int'}, + 'full_backup_window_hours': {'key': 'fullBackupWindowHours', 'type': 'int'}, + 'log_backup_frequency': {'key': 'logBackupFrequency', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(AutoBackupSettings, self).__init__(**kwargs) + self.enable = kwargs.get('enable', None) + self.enable_encryption = kwargs.get('enable_encryption', None) + self.retention_period = kwargs.get('retention_period', None) + self.storage_account_url = kwargs.get('storage_account_url', None) + self.storage_access_key = kwargs.get('storage_access_key', None) + self.password = kwargs.get('password', None) + self.backup_system_dbs = kwargs.get('backup_system_dbs', None) + self.backup_schedule_type = kwargs.get('backup_schedule_type', None) + self.full_backup_frequency = kwargs.get('full_backup_frequency', None) + self.full_backup_start_time = kwargs.get('full_backup_start_time', None) + self.full_backup_window_hours = kwargs.get('full_backup_window_hours', None) + self.log_backup_frequency = kwargs.get('log_backup_frequency', None) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/auto_backup_settings_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/auto_backup_settings_py3.py new file mode 100644 index 000000000000..6913e4d11f50 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/auto_backup_settings_py3.py @@ -0,0 +1,83 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 AutoBackupSettings(Model): + """Configure backups for databases in your SQL virtual machine. + + :param enable: Enable or disable autobackup on SQL virtual machine. + :type enable: bool + :param enable_encryption: Enable or disable encryption for backup on SQL + virtual machine. + :type enable_encryption: bool + :param retention_period: Retention period of backup: 1-30 days. + :type retention_period: int + :param storage_account_url: Storage account url where backup will be taken + to. + :type storage_account_url: str + :param storage_access_key: Storage account key where backup will be taken + to. + :type storage_access_key: str + :param password: Password for encryption on backup. + :type password: str + :param backup_system_dbs: Include or exclude system databases from auto + backup. + :type backup_system_dbs: bool + :param backup_schedule_type: Backup schedule type. Possible values + include: 'Manual', 'Automated' + :type backup_schedule_type: str or + ~azure.mgmt.sqlvirtualmachine.models.BackupScheduleType + :param full_backup_frequency: Frequency of full backups. In both cases, + full backups begin during the next scheduled time window. Possible values + include: 'Daily', 'Weekly' + :type full_backup_frequency: str or + ~azure.mgmt.sqlvirtualmachine.models.FullBackupFrequencyType + :param full_backup_start_time: Start time of a given day during which full + backups can take place. 0-23 hours. + :type full_backup_start_time: int + :param full_backup_window_hours: Duration of the time window of a given + day during which full backups can take place. 1-23 hours. + :type full_backup_window_hours: int + :param log_backup_frequency: Frequency of log backups. 5-60 minutes. + :type log_backup_frequency: int + """ + + _attribute_map = { + 'enable': {'key': 'enable', 'type': 'bool'}, + 'enable_encryption': {'key': 'enableEncryption', 'type': 'bool'}, + 'retention_period': {'key': 'retentionPeriod', 'type': 'int'}, + 'storage_account_url': {'key': 'storageAccountUrl', 'type': 'str'}, + 'storage_access_key': {'key': 'storageAccessKey', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'backup_system_dbs': {'key': 'backupSystemDbs', 'type': 'bool'}, + 'backup_schedule_type': {'key': 'backupScheduleType', 'type': 'str'}, + 'full_backup_frequency': {'key': 'fullBackupFrequency', 'type': 'str'}, + 'full_backup_start_time': {'key': 'fullBackupStartTime', 'type': 'int'}, + 'full_backup_window_hours': {'key': 'fullBackupWindowHours', 'type': 'int'}, + 'log_backup_frequency': {'key': 'logBackupFrequency', 'type': 'int'}, + } + + def __init__(self, *, enable: bool=None, enable_encryption: bool=None, retention_period: int=None, storage_account_url: str=None, storage_access_key: str=None, password: str=None, backup_system_dbs: bool=None, backup_schedule_type=None, full_backup_frequency=None, full_backup_start_time: int=None, full_backup_window_hours: int=None, log_backup_frequency: int=None, **kwargs) -> None: + super(AutoBackupSettings, self).__init__(**kwargs) + self.enable = enable + self.enable_encryption = enable_encryption + self.retention_period = retention_period + self.storage_account_url = storage_account_url + self.storage_access_key = storage_access_key + self.password = password + self.backup_system_dbs = backup_system_dbs + self.backup_schedule_type = backup_schedule_type + self.full_backup_frequency = full_backup_frequency + self.full_backup_start_time = full_backup_start_time + self.full_backup_window_hours = full_backup_window_hours + self.log_backup_frequency = log_backup_frequency diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/auto_patching_settings.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/auto_patching_settings.py new file mode 100644 index 000000000000..6f91282e5ee0 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/auto_patching_settings.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 AutoPatchingSettings(Model): + """Set a patching window during which Windows and SQL patches will be applied. + + :param enable: Enable or disable autopatching on SQL virtual machine. + :type enable: bool + :param day_of_week: Day of week to apply the patch on. Possible values + include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', + 'Saturday', 'Sunday' + :type day_of_week: str or ~azure.mgmt.sqlvirtualmachine.models.DayOfWeek + :param maintenance_window_starting_hour: Hour of the day when patching is + initiated. Local VM time. + :type maintenance_window_starting_hour: int + :param maintenance_window_duration: Duration of patching. + :type maintenance_window_duration: int + """ + + _attribute_map = { + 'enable': {'key': 'enable', 'type': 'bool'}, + 'day_of_week': {'key': 'dayOfWeek', 'type': 'DayOfWeek'}, + 'maintenance_window_starting_hour': {'key': 'maintenanceWindowStartingHour', 'type': 'int'}, + 'maintenance_window_duration': {'key': 'maintenanceWindowDuration', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(AutoPatchingSettings, self).__init__(**kwargs) + self.enable = kwargs.get('enable', None) + self.day_of_week = kwargs.get('day_of_week', None) + self.maintenance_window_starting_hour = kwargs.get('maintenance_window_starting_hour', None) + self.maintenance_window_duration = kwargs.get('maintenance_window_duration', None) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/auto_patching_settings_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/auto_patching_settings_py3.py new file mode 100644 index 000000000000..743aa0f69e79 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/auto_patching_settings_py3.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 AutoPatchingSettings(Model): + """Set a patching window during which Windows and SQL patches will be applied. + + :param enable: Enable or disable autopatching on SQL virtual machine. + :type enable: bool + :param day_of_week: Day of week to apply the patch on. Possible values + include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', + 'Saturday', 'Sunday' + :type day_of_week: str or ~azure.mgmt.sqlvirtualmachine.models.DayOfWeek + :param maintenance_window_starting_hour: Hour of the day when patching is + initiated. Local VM time. + :type maintenance_window_starting_hour: int + :param maintenance_window_duration: Duration of patching. + :type maintenance_window_duration: int + """ + + _attribute_map = { + 'enable': {'key': 'enable', 'type': 'bool'}, + 'day_of_week': {'key': 'dayOfWeek', 'type': 'DayOfWeek'}, + 'maintenance_window_starting_hour': {'key': 'maintenanceWindowStartingHour', 'type': 'int'}, + 'maintenance_window_duration': {'key': 'maintenanceWindowDuration', 'type': 'int'}, + } + + def __init__(self, *, enable: bool=None, day_of_week=None, maintenance_window_starting_hour: int=None, maintenance_window_duration: int=None, **kwargs) -> None: + super(AutoPatchingSettings, self).__init__(**kwargs) + self.enable = enable + self.day_of_week = day_of_week + self.maintenance_window_starting_hour = maintenance_window_starting_hour + self.maintenance_window_duration = maintenance_window_duration diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/availability_group_listener.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/availability_group_listener.py new file mode 100644 index 000000000000..0647367c314f --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/availability_group_listener.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 AvailabilityGroupListener(ProxyResource): + """A SQL Server availability group listener. + + 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 + :ivar provisioning_state: Provisioning state to track the aysnc operation + status. + :vartype provisioning_state: str + :param availability_group_name: Name of the availability group. + :type availability_group_name: str + :param load_balancer_configurations: List of load balancer configurations + for an availability group listener. + :type load_balancer_configurations: + list[~azure.mgmt.sqlvirtualmachine.models.LoadBalancerConfiguration] + :param create_default_availability_group_if_not_exist: Create a default + availability group if it does not exist. + :type create_default_availability_group_if_not_exist: bool + :param port: Listener port. + :type port: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'availability_group_name': {'key': 'properties.availabilityGroupName', 'type': 'str'}, + 'load_balancer_configurations': {'key': 'properties.loadBalancerConfigurations', 'type': '[LoadBalancerConfiguration]'}, + 'create_default_availability_group_if_not_exist': {'key': 'properties.createDefaultAvailabilityGroupIfNotExist', 'type': 'bool'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(AvailabilityGroupListener, self).__init__(**kwargs) + self.provisioning_state = None + self.availability_group_name = kwargs.get('availability_group_name', None) + self.load_balancer_configurations = kwargs.get('load_balancer_configurations', None) + self.create_default_availability_group_if_not_exist = kwargs.get('create_default_availability_group_if_not_exist', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/availability_group_listener_paged.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/availability_group_listener_paged.py new file mode 100644 index 000000000000..af5e37f8ae9a --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/availability_group_listener_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class AvailabilityGroupListenerPaged(Paged): + """ + A paging container for iterating over a list of :class:`AvailabilityGroupListener ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AvailabilityGroupListener]'} + } + + def __init__(self, *args, **kwargs): + + super(AvailabilityGroupListenerPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/availability_group_listener_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/availability_group_listener_py3.py new file mode 100644 index 000000000000..2f290deacd45 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/availability_group_listener_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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_py3 import ProxyResource + + +class AvailabilityGroupListener(ProxyResource): + """A SQL Server availability group listener. + + 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 + :ivar provisioning_state: Provisioning state to track the aysnc operation + status. + :vartype provisioning_state: str + :param availability_group_name: Name of the availability group. + :type availability_group_name: str + :param load_balancer_configurations: List of load balancer configurations + for an availability group listener. + :type load_balancer_configurations: + list[~azure.mgmt.sqlvirtualmachine.models.LoadBalancerConfiguration] + :param create_default_availability_group_if_not_exist: Create a default + availability group if it does not exist. + :type create_default_availability_group_if_not_exist: bool + :param port: Listener port. + :type port: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'availability_group_name': {'key': 'properties.availabilityGroupName', 'type': 'str'}, + 'load_balancer_configurations': {'key': 'properties.loadBalancerConfigurations', 'type': '[LoadBalancerConfiguration]'}, + 'create_default_availability_group_if_not_exist': {'key': 'properties.createDefaultAvailabilityGroupIfNotExist', 'type': 'bool'}, + 'port': {'key': 'properties.port', 'type': 'int'}, + } + + def __init__(self, *, availability_group_name: str=None, load_balancer_configurations=None, create_default_availability_group_if_not_exist: bool=None, port: int=None, **kwargs) -> None: + super(AvailabilityGroupListener, self).__init__(**kwargs) + self.provisioning_state = None + self.availability_group_name = availability_group_name + self.load_balancer_configurations = load_balancer_configurations + self.create_default_availability_group_if_not_exist = create_default_availability_group_if_not_exist + self.port = port diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/key_vault_credential_settings.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/key_vault_credential_settings.py new file mode 100644 index 000000000000..1da723d5a53e --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/key_vault_credential_settings.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyVaultCredentialSettings(Model): + """Configure your SQL virtual machine to be able to connect to the Azure Key + Vault service. + + :param enable: Enable or disable key vault credential setting. + :type enable: bool + :param credential_name: Credential name. + :type credential_name: str + :param azure_key_vault_url: Azure Key Vault url. + :type azure_key_vault_url: str + :param service_principal_name: Service principal name to access key vault. + :type service_principal_name: str + :param service_principal_secret: Service principal name secret to access + key vault. + :type service_principal_secret: str + """ + + _attribute_map = { + 'enable': {'key': 'enable', 'type': 'bool'}, + 'credential_name': {'key': 'credentialName', 'type': 'str'}, + 'azure_key_vault_url': {'key': 'azureKeyVaultUrl', 'type': 'str'}, + 'service_principal_name': {'key': 'servicePrincipalName', 'type': 'str'}, + 'service_principal_secret': {'key': 'servicePrincipalSecret', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultCredentialSettings, self).__init__(**kwargs) + self.enable = kwargs.get('enable', None) + self.credential_name = kwargs.get('credential_name', None) + self.azure_key_vault_url = kwargs.get('azure_key_vault_url', None) + self.service_principal_name = kwargs.get('service_principal_name', None) + self.service_principal_secret = kwargs.get('service_principal_secret', None) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/key_vault_credential_settings_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/key_vault_credential_settings_py3.py new file mode 100644 index 000000000000..e7210b64f103 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/key_vault_credential_settings_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyVaultCredentialSettings(Model): + """Configure your SQL virtual machine to be able to connect to the Azure Key + Vault service. + + :param enable: Enable or disable key vault credential setting. + :type enable: bool + :param credential_name: Credential name. + :type credential_name: str + :param azure_key_vault_url: Azure Key Vault url. + :type azure_key_vault_url: str + :param service_principal_name: Service principal name to access key vault. + :type service_principal_name: str + :param service_principal_secret: Service principal name secret to access + key vault. + :type service_principal_secret: str + """ + + _attribute_map = { + 'enable': {'key': 'enable', 'type': 'bool'}, + 'credential_name': {'key': 'credentialName', 'type': 'str'}, + 'azure_key_vault_url': {'key': 'azureKeyVaultUrl', 'type': 'str'}, + 'service_principal_name': {'key': 'servicePrincipalName', 'type': 'str'}, + 'service_principal_secret': {'key': 'servicePrincipalSecret', 'type': 'str'}, + } + + def __init__(self, *, enable: bool=None, credential_name: str=None, azure_key_vault_url: str=None, service_principal_name: str=None, service_principal_secret: str=None, **kwargs) -> None: + super(KeyVaultCredentialSettings, self).__init__(**kwargs) + self.enable = enable + self.credential_name = credential_name + self.azure_key_vault_url = azure_key_vault_url + self.service_principal_name = service_principal_name + self.service_principal_secret = service_principal_secret diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/load_balancer_configuration.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/load_balancer_configuration.py new file mode 100644 index 000000000000..df09e18404d1 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/load_balancer_configuration.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 LoadBalancerConfiguration(Model): + """A load balancer configuration for an availability group listener. + + :param private_ip_address: Private IP address. + :type private_ip_address: + ~azure.mgmt.sqlvirtualmachine.models.PrivateIPAddress + :param public_ip_address_resource_id: Resource id of the public IP. + :type public_ip_address_resource_id: str + :param load_balancer_resource_id: Subnet used to include private IP. + :type load_balancer_resource_id: str + :param probe_port: Probe port. + :type probe_port: int + :param sql_virtual_machine_instances: List of the SQL virtual machine + instance resource id's that are enrolled into the availability group + listener. + :type sql_virtual_machine_instances: list[str] + """ + + _attribute_map = { + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'PrivateIPAddress'}, + 'public_ip_address_resource_id': {'key': 'publicIpAddressResourceId', 'type': 'str'}, + 'load_balancer_resource_id': {'key': 'loadBalancerResourceId', 'type': 'str'}, + 'probe_port': {'key': 'probePort', 'type': 'int'}, + 'sql_virtual_machine_instances': {'key': 'sqlVirtualMachineInstances', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(LoadBalancerConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.public_ip_address_resource_id = kwargs.get('public_ip_address_resource_id', None) + self.load_balancer_resource_id = kwargs.get('load_balancer_resource_id', None) + self.probe_port = kwargs.get('probe_port', None) + self.sql_virtual_machine_instances = kwargs.get('sql_virtual_machine_instances', None) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/load_balancer_configuration_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/load_balancer_configuration_py3.py new file mode 100644 index 000000000000..c8cc7e3a17f9 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/load_balancer_configuration_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 LoadBalancerConfiguration(Model): + """A load balancer configuration for an availability group listener. + + :param private_ip_address: Private IP address. + :type private_ip_address: + ~azure.mgmt.sqlvirtualmachine.models.PrivateIPAddress + :param public_ip_address_resource_id: Resource id of the public IP. + :type public_ip_address_resource_id: str + :param load_balancer_resource_id: Subnet used to include private IP. + :type load_balancer_resource_id: str + :param probe_port: Probe port. + :type probe_port: int + :param sql_virtual_machine_instances: List of the SQL virtual machine + instance resource id's that are enrolled into the availability group + listener. + :type sql_virtual_machine_instances: list[str] + """ + + _attribute_map = { + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'PrivateIPAddress'}, + 'public_ip_address_resource_id': {'key': 'publicIpAddressResourceId', 'type': 'str'}, + 'load_balancer_resource_id': {'key': 'loadBalancerResourceId', 'type': 'str'}, + 'probe_port': {'key': 'probePort', 'type': 'int'}, + 'sql_virtual_machine_instances': {'key': 'sqlVirtualMachineInstances', 'type': '[str]'}, + } + + def __init__(self, *, private_ip_address=None, public_ip_address_resource_id: str=None, load_balancer_resource_id: str=None, probe_port: int=None, sql_virtual_machine_instances=None, **kwargs) -> None: + super(LoadBalancerConfiguration, self).__init__(**kwargs) + self.private_ip_address = private_ip_address + self.public_ip_address_resource_id = public_ip_address_resource_id + self.load_balancer_resource_id = load_balancer_resource_id + self.probe_port = probe_port + self.sql_virtual_machine_instances = sql_virtual_machine_instances diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/operation.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/operation.py new file mode 100644 index 000000000000..4bc77d2a0022 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/operation.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """SQL REST API operation definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the operation being performed on this particular + object. + :vartype name: str + :ivar display: The localized display information for this particular + operation / action. + :vartype display: ~azure.mgmt.sqlvirtualmachine.models.OperationDisplay + :ivar origin: The intended executor of the operation. Possible values + include: 'user', 'system' + :vartype origin: str or + ~azure.mgmt.sqlvirtualmachine.models.OperationOrigin + :ivar properties: Additional descriptions for the operation. + :vartype properties: dict[str, object] + """ + + _validation = { + 'name': {'readonly': True}, + 'display': {'readonly': True}, + 'origin': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{object}'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = None + self.origin = None + self.properties = None diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/operation_display.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/operation_display.py new file mode 100644 index 000000000000..dfbc4a6fcff3 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/operation_display.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The localized friendly form of the resource provider name. + :vartype provider: str + :ivar resource: The localized friendly form of the resource type related + to this action/operation. + :vartype resource: str + :ivar operation: The localized friendly name for the operation. + :vartype operation: str + :ivar description: The localized friendly description for the operation. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/operation_display_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/operation_display_py3.py new file mode 100644 index 000000000000..0541321c178c --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/operation_display_py3.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The localized friendly form of the resource provider name. + :vartype provider: str + :ivar resource: The localized friendly form of the resource type related + to this action/operation. + :vartype resource: str + :ivar operation: The localized friendly name for the operation. + :vartype operation: str + :ivar description: The localized friendly description for the operation. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/operation_paged.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/operation_paged.py new file mode 100644 index 000000000000..cd39eb52dd4f --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/operation_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/operation_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/operation_py3.py new file mode 100644 index 000000000000..4c69dde360a8 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/operation_py3.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """SQL REST API operation definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the operation being performed on this particular + object. + :vartype name: str + :ivar display: The localized display information for this particular + operation / action. + :vartype display: ~azure.mgmt.sqlvirtualmachine.models.OperationDisplay + :ivar origin: The intended executor of the operation. Possible values + include: 'user', 'system' + :vartype origin: str or + ~azure.mgmt.sqlvirtualmachine.models.OperationOrigin + :ivar properties: Additional descriptions for the operation. + :vartype properties: dict[str, object] + """ + + _validation = { + 'name': {'readonly': True}, + 'display': {'readonly': True}, + 'origin': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{object}'}, + } + + def __init__(self, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = None + self.origin = None + self.properties = None diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/private_ip_address.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/private_ip_address.py new file mode 100644 index 000000000000..68a8a58ff740 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/private_ip_address.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 PrivateIPAddress(Model): + """A private IP address bound to the availability group listener. + + :param ip_address: Private IP address bound to the availability group + listener. + :type ip_address: str + :param subnet_resource_id: Subnet used to include private IP. + :type subnet_resource_id: str + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet_resource_id': {'key': 'subnetResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateIPAddress, self).__init__(**kwargs) + self.ip_address = kwargs.get('ip_address', None) + self.subnet_resource_id = kwargs.get('subnet_resource_id', None) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/private_ip_address_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/private_ip_address_py3.py new file mode 100644 index 000000000000..25ca6a765078 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/private_ip_address_py3.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 PrivateIPAddress(Model): + """A private IP address bound to the availability group listener. + + :param ip_address: Private IP address bound to the availability group + listener. + :type ip_address: str + :param subnet_resource_id: Subnet used to include private IP. + :type subnet_resource_id: str + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + 'subnet_resource_id': {'key': 'subnetResourceId', 'type': 'str'}, + } + + def __init__(self, *, ip_address: str=None, subnet_resource_id: str=None, **kwargs) -> None: + super(PrivateIPAddress, self).__init__(**kwargs) + self.ip_address = ip_address + self.subnet_resource_id = subnet_resource_id diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/proxy_resource.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/proxy_resource.py new file mode 100644 index 000000000000..21fea4f24360 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/proxy_resource.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class ProxyResource(Resource): + """ARM proxy resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/proxy_resource_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/proxy_resource_py3.py new file mode 100644 index 000000000000..707323dfc134 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/proxy_resource_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class ProxyResource(Resource): + """ARM proxy resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/resource.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/resource.py new file mode 100644 index 000000000000..fc92549d32e9 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/resource.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """ARM resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/resource_identity.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/resource_identity.py new file mode 100644 index 000000000000..4503b6fe05ad --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/resource_identity.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceIdentity(Model): + """Azure Active Directory identity configuration for a resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The Azure Active Directory principal id. + :vartype principal_id: str + :param type: The identity type. Set this to 'SystemAssigned' in order to + automatically create and assign an Azure Active Directory principal for + the resource. Possible values include: 'SystemAssigned' + :type type: str or ~azure.mgmt.sqlvirtualmachine.models.IdentityType + :ivar tenant_id: The Azure Active Directory tenant id. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceIdentity, self).__init__(**kwargs) + self.principal_id = None + self.type = kwargs.get('type', None) + self.tenant_id = None diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/resource_identity_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/resource_identity_py3.py new file mode 100644 index 000000000000..cdfca44600cf --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/resource_identity_py3.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResourceIdentity(Model): + """Azure Active Directory identity configuration for a resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The Azure Active Directory principal id. + :vartype principal_id: str + :param type: The identity type. Set this to 'SystemAssigned' in order to + automatically create and assign an Azure Active Directory principal for + the resource. Possible values include: 'SystemAssigned' + :type type: str or ~azure.mgmt.sqlvirtualmachine.models.IdentityType + :ivar tenant_id: The Azure Active Directory tenant id. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(ResourceIdentity, self).__init__(**kwargs) + self.principal_id = None + self.type = type + self.tenant_id = None diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/resource_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/resource_py3.py new file mode 100644 index 000000000000..aedc5cfaf0b9 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/resource_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """ARM resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/server_configurations_management_settings.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/server_configurations_management_settings.py new file mode 100644 index 000000000000..ab68dd90af2b --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/server_configurations_management_settings.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServerConfigurationsManagementSettings(Model): + """Set the connectivity, storage and workload settings. + + :param sql_connectivity_update_settings: SQL connectivity type settings. + :type sql_connectivity_update_settings: + ~azure.mgmt.sqlvirtualmachine.models.SqlConnectivityUpdateSettings + :param sql_workload_type_update_settings: SQL workload type settings. + :type sql_workload_type_update_settings: + ~azure.mgmt.sqlvirtualmachine.models.SqlWorkloadTypeUpdateSettings + :param sql_storage_update_settings: SQL storage update settings. + :type sql_storage_update_settings: + ~azure.mgmt.sqlvirtualmachine.models.SqlStorageUpdateSettings + :param additional_features_server_configurations: Additional SQL feature + settings. + :type additional_features_server_configurations: + ~azure.mgmt.sqlvirtualmachine.models.AdditionalFeaturesServerConfigurations + """ + + _attribute_map = { + 'sql_connectivity_update_settings': {'key': 'sqlConnectivityUpdateSettings', 'type': 'SqlConnectivityUpdateSettings'}, + 'sql_workload_type_update_settings': {'key': 'sqlWorkloadTypeUpdateSettings', 'type': 'SqlWorkloadTypeUpdateSettings'}, + 'sql_storage_update_settings': {'key': 'sqlStorageUpdateSettings', 'type': 'SqlStorageUpdateSettings'}, + 'additional_features_server_configurations': {'key': 'additionalFeaturesServerConfigurations', 'type': 'AdditionalFeaturesServerConfigurations'}, + } + + def __init__(self, **kwargs): + super(ServerConfigurationsManagementSettings, self).__init__(**kwargs) + self.sql_connectivity_update_settings = kwargs.get('sql_connectivity_update_settings', None) + self.sql_workload_type_update_settings = kwargs.get('sql_workload_type_update_settings', None) + self.sql_storage_update_settings = kwargs.get('sql_storage_update_settings', None) + self.additional_features_server_configurations = kwargs.get('additional_features_server_configurations', None) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/server_configurations_management_settings_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/server_configurations_management_settings_py3.py new file mode 100644 index 000000000000..fd863b5255f9 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/server_configurations_management_settings_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServerConfigurationsManagementSettings(Model): + """Set the connectivity, storage and workload settings. + + :param sql_connectivity_update_settings: SQL connectivity type settings. + :type sql_connectivity_update_settings: + ~azure.mgmt.sqlvirtualmachine.models.SqlConnectivityUpdateSettings + :param sql_workload_type_update_settings: SQL workload type settings. + :type sql_workload_type_update_settings: + ~azure.mgmt.sqlvirtualmachine.models.SqlWorkloadTypeUpdateSettings + :param sql_storage_update_settings: SQL storage update settings. + :type sql_storage_update_settings: + ~azure.mgmt.sqlvirtualmachine.models.SqlStorageUpdateSettings + :param additional_features_server_configurations: Additional SQL feature + settings. + :type additional_features_server_configurations: + ~azure.mgmt.sqlvirtualmachine.models.AdditionalFeaturesServerConfigurations + """ + + _attribute_map = { + 'sql_connectivity_update_settings': {'key': 'sqlConnectivityUpdateSettings', 'type': 'SqlConnectivityUpdateSettings'}, + 'sql_workload_type_update_settings': {'key': 'sqlWorkloadTypeUpdateSettings', 'type': 'SqlWorkloadTypeUpdateSettings'}, + 'sql_storage_update_settings': {'key': 'sqlStorageUpdateSettings', 'type': 'SqlStorageUpdateSettings'}, + 'additional_features_server_configurations': {'key': 'additionalFeaturesServerConfigurations', 'type': 'AdditionalFeaturesServerConfigurations'}, + } + + def __init__(self, *, sql_connectivity_update_settings=None, sql_workload_type_update_settings=None, sql_storage_update_settings=None, additional_features_server_configurations=None, **kwargs) -> None: + super(ServerConfigurationsManagementSettings, self).__init__(**kwargs) + self.sql_connectivity_update_settings = sql_connectivity_update_settings + self.sql_workload_type_update_settings = sql_workload_type_update_settings + self.sql_storage_update_settings = sql_storage_update_settings + self.additional_features_server_configurations = additional_features_server_configurations diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_connectivity_update_settings.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_connectivity_update_settings.py new file mode 100644 index 000000000000..dc9ce902d887 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_connectivity_update_settings.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SqlConnectivityUpdateSettings(Model): + """Set the access level and network port settings for SQL Server. + + :param connectivity_type: SQL Server connectivity option. Possible values + include: 'LOCAL', 'PRIVATE', 'PUBLIC' + :type connectivity_type: str or + ~azure.mgmt.sqlvirtualmachine.models.ConnectivityType + :param port: SQL Server port. + :type port: int + :param sql_auth_update_user_name: SQL Server sysadmin login to create. + :type sql_auth_update_user_name: str + :param sql_auth_update_password: SQL Server sysadmin login password. + :type sql_auth_update_password: str + """ + + _attribute_map = { + 'connectivity_type': {'key': 'connectivityType', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'sql_auth_update_user_name': {'key': 'sqlAuthUpdateUserName', 'type': 'str'}, + 'sql_auth_update_password': {'key': 'sqlAuthUpdatePassword', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SqlConnectivityUpdateSettings, self).__init__(**kwargs) + self.connectivity_type = kwargs.get('connectivity_type', None) + self.port = kwargs.get('port', None) + self.sql_auth_update_user_name = kwargs.get('sql_auth_update_user_name', None) + self.sql_auth_update_password = kwargs.get('sql_auth_update_password', None) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_connectivity_update_settings_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_connectivity_update_settings_py3.py new file mode 100644 index 000000000000..a1efd4fd33a2 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_connectivity_update_settings_py3.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SqlConnectivityUpdateSettings(Model): + """Set the access level and network port settings for SQL Server. + + :param connectivity_type: SQL Server connectivity option. Possible values + include: 'LOCAL', 'PRIVATE', 'PUBLIC' + :type connectivity_type: str or + ~azure.mgmt.sqlvirtualmachine.models.ConnectivityType + :param port: SQL Server port. + :type port: int + :param sql_auth_update_user_name: SQL Server sysadmin login to create. + :type sql_auth_update_user_name: str + :param sql_auth_update_password: SQL Server sysadmin login password. + :type sql_auth_update_password: str + """ + + _attribute_map = { + 'connectivity_type': {'key': 'connectivityType', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'sql_auth_update_user_name': {'key': 'sqlAuthUpdateUserName', 'type': 'str'}, + 'sql_auth_update_password': {'key': 'sqlAuthUpdatePassword', 'type': 'str'}, + } + + def __init__(self, *, connectivity_type=None, port: int=None, sql_auth_update_user_name: str=None, sql_auth_update_password: str=None, **kwargs) -> None: + super(SqlConnectivityUpdateSettings, self).__init__(**kwargs) + self.connectivity_type = connectivity_type + self.port = port + self.sql_auth_update_user_name = sql_auth_update_user_name + self.sql_auth_update_password = sql_auth_update_password diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_storage_update_settings.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_storage_update_settings.py new file mode 100644 index 000000000000..117a29855992 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_storage_update_settings.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 SqlStorageUpdateSettings(Model): + """Set disk storage settings for SQL Server. + + :param disk_count: Virtual machine disk count. + :type disk_count: int + :param disk_configuration_type: Disk configuration to apply to SQL Server. + Possible values include: 'NEW', 'EXTEND', 'ADD' + :type disk_configuration_type: str or + ~azure.mgmt.sqlvirtualmachine.models.DiskConfigurationType + """ + + _attribute_map = { + 'disk_count': {'key': 'diskCount', 'type': 'int'}, + 'disk_configuration_type': {'key': 'diskConfigurationType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SqlStorageUpdateSettings, self).__init__(**kwargs) + self.disk_count = kwargs.get('disk_count', None) + self.disk_configuration_type = kwargs.get('disk_configuration_type', None) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_storage_update_settings_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_storage_update_settings_py3.py new file mode 100644 index 000000000000..94b8b9a5dc52 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_storage_update_settings_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 SqlStorageUpdateSettings(Model): + """Set disk storage settings for SQL Server. + + :param disk_count: Virtual machine disk count. + :type disk_count: int + :param disk_configuration_type: Disk configuration to apply to SQL Server. + Possible values include: 'NEW', 'EXTEND', 'ADD' + :type disk_configuration_type: str or + ~azure.mgmt.sqlvirtualmachine.models.DiskConfigurationType + """ + + _attribute_map = { + 'disk_count': {'key': 'diskCount', 'type': 'int'}, + 'disk_configuration_type': {'key': 'diskConfigurationType', 'type': 'str'}, + } + + def __init__(self, *, disk_count: int=None, disk_configuration_type=None, **kwargs) -> None: + super(SqlStorageUpdateSettings, self).__init__(**kwargs) + self.disk_count = disk_count + self.disk_configuration_type = disk_configuration_type diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine.py new file mode 100644 index 000000000000..c72dc4d1a1f3 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine.py @@ -0,0 +1,118 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .tracked_resource import TrackedResource + + +class SqlVirtualMachine(TrackedResource): + """A SQL virtual machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param identity: Azure Active Directory identity of the server. + :type identity: ~azure.mgmt.sqlvirtualmachine.models.ResourceIdentity + :param virtual_machine_resource_id: ARM Resource id of underlying virtual + machine created from SQL marketplace image. + :type virtual_machine_resource_id: str + :ivar provisioning_state: Provisioning state to track the aysnc operation + status. + :vartype provisioning_state: str + :ivar sql_image_offer: SQL image offer. Examples include SQL2016-WS2016, + SQL2017-WS2016. + :vartype sql_image_offer: str + :param sql_server_license_type: SQL Server license type. Possible values + include: 'PAYG', 'AHUB' + :type sql_server_license_type: str or + ~azure.mgmt.sqlvirtualmachine.models.SqlServerLicenseType + :ivar sql_image_sku: SQL image sku. Possible values include: 'Developer', + 'Express', 'Standard', 'Enterprise', 'Web' + :vartype sql_image_sku: str or + ~azure.mgmt.sqlvirtualmachine.models.SqlImageSku + :param sql_virtual_machine_group_resource_id: ARM resource id of the SQL + virtual machine group this SQL virtual machine is or will be part of. + :type sql_virtual_machine_group_resource_id: str + :param wsfc_domain_credentials: Domain credentials for setting up Windows + Server Failover Cluster for SQL availability group. + :type wsfc_domain_credentials: + ~azure.mgmt.sqlvirtualmachine.models.WsfcDomainCredentials + :param auto_patching_settings: Auto patching settings for applying + critical security updates to SQL virtual machine. + :type auto_patching_settings: + ~azure.mgmt.sqlvirtualmachine.models.AutoPatchingSettings + :param auto_backup_settings: Auto backup settings for SQL Server. + :type auto_backup_settings: + ~azure.mgmt.sqlvirtualmachine.models.AutoBackupSettings + :param key_vault_credential_settings: Key vault credential settings. + :type key_vault_credential_settings: + ~azure.mgmt.sqlvirtualmachine.models.KeyVaultCredentialSettings + :param server_configurations_management_settings: SQL Server configuration + management settings. + :type server_configurations_management_settings: + ~azure.mgmt.sqlvirtualmachine.models.ServerConfigurationsManagementSettings + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'sql_image_offer': {'readonly': True}, + 'sql_image_sku': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'virtual_machine_resource_id': {'key': 'properties.virtualMachineResourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sql_image_offer': {'key': 'properties.sqlImageOffer', 'type': 'str'}, + 'sql_server_license_type': {'key': 'properties.sqlServerLicenseType', 'type': 'str'}, + 'sql_image_sku': {'key': 'properties.sqlImageSku', 'type': 'str'}, + 'sql_virtual_machine_group_resource_id': {'key': 'properties.sqlVirtualMachineGroupResourceId', 'type': 'str'}, + 'wsfc_domain_credentials': {'key': 'properties.wsfcDomainCredentials', 'type': 'WsfcDomainCredentials'}, + 'auto_patching_settings': {'key': 'properties.autoPatchingSettings', 'type': 'AutoPatchingSettings'}, + 'auto_backup_settings': {'key': 'properties.autoBackupSettings', 'type': 'AutoBackupSettings'}, + 'key_vault_credential_settings': {'key': 'properties.keyVaultCredentialSettings', 'type': 'KeyVaultCredentialSettings'}, + 'server_configurations_management_settings': {'key': 'properties.serverConfigurationsManagementSettings', 'type': 'ServerConfigurationsManagementSettings'}, + } + + def __init__(self, **kwargs): + super(SqlVirtualMachine, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.virtual_machine_resource_id = kwargs.get('virtual_machine_resource_id', None) + self.provisioning_state = None + self.sql_image_offer = None + self.sql_server_license_type = kwargs.get('sql_server_license_type', None) + self.sql_image_sku = None + self.sql_virtual_machine_group_resource_id = kwargs.get('sql_virtual_machine_group_resource_id', None) + self.wsfc_domain_credentials = kwargs.get('wsfc_domain_credentials', None) + self.auto_patching_settings = kwargs.get('auto_patching_settings', None) + self.auto_backup_settings = kwargs.get('auto_backup_settings', None) + self.key_vault_credential_settings = kwargs.get('key_vault_credential_settings', None) + self.server_configurations_management_settings = kwargs.get('server_configurations_management_settings', None) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group.py new file mode 100644 index 000000000000..f9f127f195f1 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .tracked_resource import TrackedResource + + +class SqlVirtualMachineGroup(TrackedResource): + """A SQL virtual machine group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :ivar provisioning_state: Provisioning state to track the aysnc operation + status. + :vartype provisioning_state: str + :param sql_image_offer: SQL image offer. Examples may include + SQL2016-WS2016, SQL2017-WS2016. + :type sql_image_offer: str + :param sql_image_sku: SQL image sku. Possible values include: 'Developer', + 'Express', 'Standard', 'Enterprise', 'Web' + :type sql_image_sku: str or + ~azure.mgmt.sqlvirtualmachine.models.SqlImageSku + :ivar scale_type: Scale type. Possible values include: 'HA' + :vartype scale_type: str or ~azure.mgmt.sqlvirtualmachine.models.ScaleType + :ivar cluster_manager_type: Type of cluster manager: Windows Server + Failover Cluster (WSFC), implied by the scale type of the group and the OS + type. Possible values include: 'WSFC' + :vartype cluster_manager_type: str or + ~azure.mgmt.sqlvirtualmachine.models.ClusterManagerType + :ivar cluster_configuration: Cluster type. Possible values include: + 'Domainful' + :vartype cluster_configuration: str or + ~azure.mgmt.sqlvirtualmachine.models.ClusterConfiguration + :param wsfc_domain_profile: Cluster Active Directory domain profile. + :type wsfc_domain_profile: + ~azure.mgmt.sqlvirtualmachine.models.WsfcDomainProfile + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'scale_type': {'readonly': True}, + 'cluster_manager_type': {'readonly': True}, + 'cluster_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sql_image_offer': {'key': 'properties.sqlImageOffer', 'type': 'str'}, + 'sql_image_sku': {'key': 'properties.sqlImageSku', 'type': 'str'}, + 'scale_type': {'key': 'properties.scaleType', 'type': 'str'}, + 'cluster_manager_type': {'key': 'properties.clusterManagerType', 'type': 'str'}, + 'cluster_configuration': {'key': 'properties.clusterConfiguration', 'type': 'str'}, + 'wsfc_domain_profile': {'key': 'properties.wsfcDomainProfile', 'type': 'WsfcDomainProfile'}, + } + + def __init__(self, **kwargs): + super(SqlVirtualMachineGroup, self).__init__(**kwargs) + self.provisioning_state = None + self.sql_image_offer = kwargs.get('sql_image_offer', None) + self.sql_image_sku = kwargs.get('sql_image_sku', None) + self.scale_type = None + self.cluster_manager_type = None + self.cluster_configuration = None + self.wsfc_domain_profile = kwargs.get('wsfc_domain_profile', None) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group_paged.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group_paged.py new file mode 100644 index 000000000000..cf7a581ad478 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class SqlVirtualMachineGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`SqlVirtualMachineGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SqlVirtualMachineGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(SqlVirtualMachineGroupPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group_py3.py new file mode 100644 index 000000000000..a7a2c32fc3f6 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group_py3.py @@ -0,0 +1,93 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .tracked_resource_py3 import TrackedResource + + +class SqlVirtualMachineGroup(TrackedResource): + """A SQL virtual machine group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :ivar provisioning_state: Provisioning state to track the aysnc operation + status. + :vartype provisioning_state: str + :param sql_image_offer: SQL image offer. Examples may include + SQL2016-WS2016, SQL2017-WS2016. + :type sql_image_offer: str + :param sql_image_sku: SQL image sku. Possible values include: 'Developer', + 'Express', 'Standard', 'Enterprise', 'Web' + :type sql_image_sku: str or + ~azure.mgmt.sqlvirtualmachine.models.SqlImageSku + :ivar scale_type: Scale type. Possible values include: 'HA' + :vartype scale_type: str or ~azure.mgmt.sqlvirtualmachine.models.ScaleType + :ivar cluster_manager_type: Type of cluster manager: Windows Server + Failover Cluster (WSFC), implied by the scale type of the group and the OS + type. Possible values include: 'WSFC' + :vartype cluster_manager_type: str or + ~azure.mgmt.sqlvirtualmachine.models.ClusterManagerType + :ivar cluster_configuration: Cluster type. Possible values include: + 'Domainful' + :vartype cluster_configuration: str or + ~azure.mgmt.sqlvirtualmachine.models.ClusterConfiguration + :param wsfc_domain_profile: Cluster Active Directory domain profile. + :type wsfc_domain_profile: + ~azure.mgmt.sqlvirtualmachine.models.WsfcDomainProfile + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'scale_type': {'readonly': True}, + 'cluster_manager_type': {'readonly': True}, + 'cluster_configuration': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sql_image_offer': {'key': 'properties.sqlImageOffer', 'type': 'str'}, + 'sql_image_sku': {'key': 'properties.sqlImageSku', 'type': 'str'}, + 'scale_type': {'key': 'properties.scaleType', 'type': 'str'}, + 'cluster_manager_type': {'key': 'properties.clusterManagerType', 'type': 'str'}, + 'cluster_configuration': {'key': 'properties.clusterConfiguration', 'type': 'str'}, + 'wsfc_domain_profile': {'key': 'properties.wsfcDomainProfile', 'type': 'WsfcDomainProfile'}, + } + + def __init__(self, *, location: str, tags=None, sql_image_offer: str=None, sql_image_sku=None, wsfc_domain_profile=None, **kwargs) -> None: + super(SqlVirtualMachineGroup, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = None + self.sql_image_offer = sql_image_offer + self.sql_image_sku = sql_image_sku + self.scale_type = None + self.cluster_manager_type = None + self.cluster_configuration = None + self.wsfc_domain_profile = wsfc_domain_profile diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group_update.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group_update.py new file mode 100644 index 000000000000..bcc42061ed8e --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group_update.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SqlVirtualMachineGroupUpdate(Model): + """An update to a SQL virtual machine group. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(SqlVirtualMachineGroupUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group_update_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group_update_py3.py new file mode 100644 index 000000000000..281d1c4711c1 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_group_update_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SqlVirtualMachineGroupUpdate(Model): + """An update to a SQL virtual machine group. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(SqlVirtualMachineGroupUpdate, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_management_client_enums.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_management_client_enums.py new file mode 100644 index 000000000000..abede8d3d0de --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_management_client_enums.py @@ -0,0 +1,97 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class OperationOrigin(str, Enum): + + user = "user" + system = "system" + + +class SqlImageSku(str, Enum): + + developer = "Developer" + express = "Express" + standard = "Standard" + enterprise = "Enterprise" + web = "Web" + + +class ScaleType(str, Enum): + + ha = "HA" + + +class ClusterManagerType(str, Enum): + + wsfc = "WSFC" + + +class ClusterConfiguration(str, Enum): + + domainful = "Domainful" + + +class IdentityType(str, Enum): + + system_assigned = "SystemAssigned" + + +class SqlServerLicenseType(str, Enum): + + payg = "PAYG" + ahub = "AHUB" + + +class DayOfWeek(str, Enum): + + monday = "Monday" + tuesday = "Tuesday" + wednesday = "Wednesday" + thursday = "Thursday" + friday = "Friday" + saturday = "Saturday" + sunday = "Sunday" + + +class BackupScheduleType(str, Enum): + + manual = "Manual" + automated = "Automated" + + +class FullBackupFrequencyType(str, Enum): + + daily = "Daily" + weekly = "Weekly" + + +class ConnectivityType(str, Enum): + + local = "LOCAL" + private = "PRIVATE" + public = "PUBLIC" + + +class SqlWorkloadType(str, Enum): + + general = "GENERAL" + oltp = "OLTP" + dw = "DW" + + +class DiskConfigurationType(str, Enum): + + new = "NEW" + extend = "EXTEND" + add = "ADD" diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_paged.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_paged.py new file mode 100644 index 000000000000..5a5766e2bfc9 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class SqlVirtualMachinePaged(Paged): + """ + A paging container for iterating over a list of :class:`SqlVirtualMachine ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SqlVirtualMachine]'} + } + + def __init__(self, *args, **kwargs): + + super(SqlVirtualMachinePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_py3.py new file mode 100644 index 000000000000..d63a77f1c398 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_py3.py @@ -0,0 +1,118 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .tracked_resource_py3 import TrackedResource + + +class SqlVirtualMachine(TrackedResource): + """A SQL virtual machine. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param identity: Azure Active Directory identity of the server. + :type identity: ~azure.mgmt.sqlvirtualmachine.models.ResourceIdentity + :param virtual_machine_resource_id: ARM Resource id of underlying virtual + machine created from SQL marketplace image. + :type virtual_machine_resource_id: str + :ivar provisioning_state: Provisioning state to track the aysnc operation + status. + :vartype provisioning_state: str + :ivar sql_image_offer: SQL image offer. Examples include SQL2016-WS2016, + SQL2017-WS2016. + :vartype sql_image_offer: str + :param sql_server_license_type: SQL Server license type. Possible values + include: 'PAYG', 'AHUB' + :type sql_server_license_type: str or + ~azure.mgmt.sqlvirtualmachine.models.SqlServerLicenseType + :ivar sql_image_sku: SQL image sku. Possible values include: 'Developer', + 'Express', 'Standard', 'Enterprise', 'Web' + :vartype sql_image_sku: str or + ~azure.mgmt.sqlvirtualmachine.models.SqlImageSku + :param sql_virtual_machine_group_resource_id: ARM resource id of the SQL + virtual machine group this SQL virtual machine is or will be part of. + :type sql_virtual_machine_group_resource_id: str + :param wsfc_domain_credentials: Domain credentials for setting up Windows + Server Failover Cluster for SQL availability group. + :type wsfc_domain_credentials: + ~azure.mgmt.sqlvirtualmachine.models.WsfcDomainCredentials + :param auto_patching_settings: Auto patching settings for applying + critical security updates to SQL virtual machine. + :type auto_patching_settings: + ~azure.mgmt.sqlvirtualmachine.models.AutoPatchingSettings + :param auto_backup_settings: Auto backup settings for SQL Server. + :type auto_backup_settings: + ~azure.mgmt.sqlvirtualmachine.models.AutoBackupSettings + :param key_vault_credential_settings: Key vault credential settings. + :type key_vault_credential_settings: + ~azure.mgmt.sqlvirtualmachine.models.KeyVaultCredentialSettings + :param server_configurations_management_settings: SQL Server configuration + management settings. + :type server_configurations_management_settings: + ~azure.mgmt.sqlvirtualmachine.models.ServerConfigurationsManagementSettings + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'sql_image_offer': {'readonly': True}, + 'sql_image_sku': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'virtual_machine_resource_id': {'key': 'properties.virtualMachineResourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sql_image_offer': {'key': 'properties.sqlImageOffer', 'type': 'str'}, + 'sql_server_license_type': {'key': 'properties.sqlServerLicenseType', 'type': 'str'}, + 'sql_image_sku': {'key': 'properties.sqlImageSku', 'type': 'str'}, + 'sql_virtual_machine_group_resource_id': {'key': 'properties.sqlVirtualMachineGroupResourceId', 'type': 'str'}, + 'wsfc_domain_credentials': {'key': 'properties.wsfcDomainCredentials', 'type': 'WsfcDomainCredentials'}, + 'auto_patching_settings': {'key': 'properties.autoPatchingSettings', 'type': 'AutoPatchingSettings'}, + 'auto_backup_settings': {'key': 'properties.autoBackupSettings', 'type': 'AutoBackupSettings'}, + 'key_vault_credential_settings': {'key': 'properties.keyVaultCredentialSettings', 'type': 'KeyVaultCredentialSettings'}, + 'server_configurations_management_settings': {'key': 'properties.serverConfigurationsManagementSettings', 'type': 'ServerConfigurationsManagementSettings'}, + } + + def __init__(self, *, location: str, tags=None, identity=None, virtual_machine_resource_id: str=None, sql_server_license_type=None, sql_virtual_machine_group_resource_id: str=None, wsfc_domain_credentials=None, auto_patching_settings=None, auto_backup_settings=None, key_vault_credential_settings=None, server_configurations_management_settings=None, **kwargs) -> None: + super(SqlVirtualMachine, self).__init__(location=location, tags=tags, **kwargs) + self.identity = identity + self.virtual_machine_resource_id = virtual_machine_resource_id + self.provisioning_state = None + self.sql_image_offer = None + self.sql_server_license_type = sql_server_license_type + self.sql_image_sku = None + self.sql_virtual_machine_group_resource_id = sql_virtual_machine_group_resource_id + self.wsfc_domain_credentials = wsfc_domain_credentials + self.auto_patching_settings = auto_patching_settings + self.auto_backup_settings = auto_backup_settings + self.key_vault_credential_settings = key_vault_credential_settings + self.server_configurations_management_settings = server_configurations_management_settings diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_update.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_update.py new file mode 100644 index 000000000000..ca4e030cf0da --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_update.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SqlVirtualMachineUpdate(Model): + """An update to a SQL virtual machine. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(SqlVirtualMachineUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_update_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_update_py3.py new file mode 100644 index 000000000000..230138c59880 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_virtual_machine_update_py3.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SqlVirtualMachineUpdate(Model): + """An update to a SQL virtual machine. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(SqlVirtualMachineUpdate, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_workload_type_update_settings.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_workload_type_update_settings.py new file mode 100644 index 000000000000..aee212c6081f --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_workload_type_update_settings.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 SqlWorkloadTypeUpdateSettings(Model): + """Set workload type to optimize storage for SQL Server. + + :param sql_workload_type: SQL Server workload type. Possible values + include: 'GENERAL', 'OLTP', 'DW' + :type sql_workload_type: str or + ~azure.mgmt.sqlvirtualmachine.models.SqlWorkloadType + """ + + _attribute_map = { + 'sql_workload_type': {'key': 'sqlWorkloadType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SqlWorkloadTypeUpdateSettings, self).__init__(**kwargs) + self.sql_workload_type = kwargs.get('sql_workload_type', None) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_workload_type_update_settings_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_workload_type_update_settings_py3.py new file mode 100644 index 000000000000..fbfe489a9173 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/sql_workload_type_update_settings_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 SqlWorkloadTypeUpdateSettings(Model): + """Set workload type to optimize storage for SQL Server. + + :param sql_workload_type: SQL Server workload type. Possible values + include: 'GENERAL', 'OLTP', 'DW' + :type sql_workload_type: str or + ~azure.mgmt.sqlvirtualmachine.models.SqlWorkloadType + """ + + _attribute_map = { + 'sql_workload_type': {'key': 'sqlWorkloadType', 'type': 'str'}, + } + + def __init__(self, *, sql_workload_type=None, **kwargs) -> None: + super(SqlWorkloadTypeUpdateSettings, self).__init__(**kwargs) + self.sql_workload_type = sql_workload_type diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/tracked_resource.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/tracked_resource.py new file mode 100644 index 000000000000..dc99e096cf18 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/tracked_resource.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class TrackedResource(Resource): + """ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/tracked_resource_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/tracked_resource_py3.py new file mode 100644 index 000000000000..5edf04ac0a73 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/tracked_resource_py3.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class TrackedResource(Resource): + """ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.location = location + self.tags = tags diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/wsfc_domain_credentials.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/wsfc_domain_credentials.py new file mode 100644 index 000000000000..76ad60deb524 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/wsfc_domain_credentials.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WsfcDomainCredentials(Model): + """Domain credentials for setting up Windows Server Failover Cluster for SQL + availability group. + + :param cluster_bootstrap_account_password: Cluster bootstrap account + password. + :type cluster_bootstrap_account_password: str + :param cluster_operator_account_password: Cluster operator account + password. + :type cluster_operator_account_password: str + :param sql_service_account_password: SQL service account password. + :type sql_service_account_password: str + """ + + _attribute_map = { + 'cluster_bootstrap_account_password': {'key': 'clusterBootstrapAccountPassword', 'type': 'str'}, + 'cluster_operator_account_password': {'key': 'clusterOperatorAccountPassword', 'type': 'str'}, + 'sql_service_account_password': {'key': 'sqlServiceAccountPassword', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WsfcDomainCredentials, self).__init__(**kwargs) + self.cluster_bootstrap_account_password = kwargs.get('cluster_bootstrap_account_password', None) + self.cluster_operator_account_password = kwargs.get('cluster_operator_account_password', None) + self.sql_service_account_password = kwargs.get('sql_service_account_password', None) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/wsfc_domain_credentials_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/wsfc_domain_credentials_py3.py new file mode 100644 index 000000000000..a6dd9e173c81 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/wsfc_domain_credentials_py3.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class WsfcDomainCredentials(Model): + """Domain credentials for setting up Windows Server Failover Cluster for SQL + availability group. + + :param cluster_bootstrap_account_password: Cluster bootstrap account + password. + :type cluster_bootstrap_account_password: str + :param cluster_operator_account_password: Cluster operator account + password. + :type cluster_operator_account_password: str + :param sql_service_account_password: SQL service account password. + :type sql_service_account_password: str + """ + + _attribute_map = { + 'cluster_bootstrap_account_password': {'key': 'clusterBootstrapAccountPassword', 'type': 'str'}, + 'cluster_operator_account_password': {'key': 'clusterOperatorAccountPassword', 'type': 'str'}, + 'sql_service_account_password': {'key': 'sqlServiceAccountPassword', 'type': 'str'}, + } + + def __init__(self, *, cluster_bootstrap_account_password: str=None, cluster_operator_account_password: str=None, sql_service_account_password: str=None, **kwargs) -> None: + super(WsfcDomainCredentials, self).__init__(**kwargs) + self.cluster_bootstrap_account_password = cluster_bootstrap_account_password + self.cluster_operator_account_password = cluster_operator_account_password + self.sql_service_account_password = sql_service_account_password diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/wsfc_domain_profile.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/wsfc_domain_profile.py new file mode 100644 index 000000000000..e83bf8f287a6 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/wsfc_domain_profile.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 WsfcDomainProfile(Model): + """Active Directory account details to operate Windows Server Failover + Cluster. + + :param domain_fqdn: Fully qualified name of the domain. + :type domain_fqdn: str + :param ou_path: Organizational Unit path in which the nodes and cluster + will be present. + :type ou_path: str + :param cluster_bootstrap_account: Account name used for creating cluster + (at minimum needs permissions to 'Create Computer Objects' in domain). + :type cluster_bootstrap_account: str + :param cluster_operator_account: Account name used for operating cluster + i.e. will be part of administrators group on all the participating virtual + machines in the cluster. + :type cluster_operator_account: str + :param sql_service_account: Account name under which SQL service will run + on all participating SQL virtual machines in the cluster. + :type sql_service_account: str + :param file_share_witness_path: Optional path for fileshare witness. + :type file_share_witness_path: str + :param storage_account_url: Fully qualified ARM resource id of the witness + storage account. + :type storage_account_url: str + :param storage_account_primary_key: Primary key of the witness storage + account. + :type storage_account_primary_key: str + """ + + _attribute_map = { + 'domain_fqdn': {'key': 'domainFqdn', 'type': 'str'}, + 'ou_path': {'key': 'ouPath', 'type': 'str'}, + 'cluster_bootstrap_account': {'key': 'clusterBootstrapAccount', 'type': 'str'}, + 'cluster_operator_account': {'key': 'clusterOperatorAccount', 'type': 'str'}, + 'sql_service_account': {'key': 'sqlServiceAccount', 'type': 'str'}, + 'file_share_witness_path': {'key': 'fileShareWitnessPath', 'type': 'str'}, + 'storage_account_url': {'key': 'storageAccountUrl', 'type': 'str'}, + 'storage_account_primary_key': {'key': 'storageAccountPrimaryKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WsfcDomainProfile, self).__init__(**kwargs) + self.domain_fqdn = kwargs.get('domain_fqdn', None) + self.ou_path = kwargs.get('ou_path', None) + self.cluster_bootstrap_account = kwargs.get('cluster_bootstrap_account', None) + self.cluster_operator_account = kwargs.get('cluster_operator_account', None) + self.sql_service_account = kwargs.get('sql_service_account', None) + self.file_share_witness_path = kwargs.get('file_share_witness_path', None) + self.storage_account_url = kwargs.get('storage_account_url', None) + self.storage_account_primary_key = kwargs.get('storage_account_primary_key', None) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/wsfc_domain_profile_py3.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/wsfc_domain_profile_py3.py new file mode 100644 index 000000000000..0d7864768ad8 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/models/wsfc_domain_profile_py3.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 WsfcDomainProfile(Model): + """Active Directory account details to operate Windows Server Failover + Cluster. + + :param domain_fqdn: Fully qualified name of the domain. + :type domain_fqdn: str + :param ou_path: Organizational Unit path in which the nodes and cluster + will be present. + :type ou_path: str + :param cluster_bootstrap_account: Account name used for creating cluster + (at minimum needs permissions to 'Create Computer Objects' in domain). + :type cluster_bootstrap_account: str + :param cluster_operator_account: Account name used for operating cluster + i.e. will be part of administrators group on all the participating virtual + machines in the cluster. + :type cluster_operator_account: str + :param sql_service_account: Account name under which SQL service will run + on all participating SQL virtual machines in the cluster. + :type sql_service_account: str + :param file_share_witness_path: Optional path for fileshare witness. + :type file_share_witness_path: str + :param storage_account_url: Fully qualified ARM resource id of the witness + storage account. + :type storage_account_url: str + :param storage_account_primary_key: Primary key of the witness storage + account. + :type storage_account_primary_key: str + """ + + _attribute_map = { + 'domain_fqdn': {'key': 'domainFqdn', 'type': 'str'}, + 'ou_path': {'key': 'ouPath', 'type': 'str'}, + 'cluster_bootstrap_account': {'key': 'clusterBootstrapAccount', 'type': 'str'}, + 'cluster_operator_account': {'key': 'clusterOperatorAccount', 'type': 'str'}, + 'sql_service_account': {'key': 'sqlServiceAccount', 'type': 'str'}, + 'file_share_witness_path': {'key': 'fileShareWitnessPath', 'type': 'str'}, + 'storage_account_url': {'key': 'storageAccountUrl', 'type': 'str'}, + 'storage_account_primary_key': {'key': 'storageAccountPrimaryKey', 'type': 'str'}, + } + + def __init__(self, *, domain_fqdn: str=None, ou_path: str=None, cluster_bootstrap_account: str=None, cluster_operator_account: str=None, sql_service_account: str=None, file_share_witness_path: str=None, storage_account_url: str=None, storage_account_primary_key: str=None, **kwargs) -> None: + super(WsfcDomainProfile, self).__init__(**kwargs) + self.domain_fqdn = domain_fqdn + self.ou_path = ou_path + self.cluster_bootstrap_account = cluster_bootstrap_account + self.cluster_operator_account = cluster_operator_account + self.sql_service_account = sql_service_account + self.file_share_witness_path = file_share_witness_path + self.storage_account_url = storage_account_url + self.storage_account_primary_key = storage_account_primary_key diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/__init__.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/__init__.py new file mode 100644 index 000000000000..f178ca4ed1a1 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/__init__.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .availability_group_listeners_operations import AvailabilityGroupListenersOperations +from .operations import Operations +from .sql_virtual_machine_groups_operations import SqlVirtualMachineGroupsOperations +from .sql_virtual_machines_operations import SqlVirtualMachinesOperations + +__all__ = [ + 'AvailabilityGroupListenersOperations', + 'Operations', + 'SqlVirtualMachineGroupsOperations', + 'SqlVirtualMachinesOperations', +] diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/availability_group_listeners_operations.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/availability_group_listeners_operations.py new file mode 100644 index 000000000000..733fa257a132 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/availability_group_listeners_operations.py @@ -0,0 +1,381 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class AvailabilityGroupListenersOperations(object): + """AvailabilityGroupListenersOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version to use for the request. Constant value: "2017-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-03-01-preview" + + self.config = config + + def get( + self, resource_group_name, sql_virtual_machine_group_name, availability_group_listener_name, custom_headers=None, raw=False, **operation_config): + """Gets an availability group listener. + + :param resource_group_name: 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 sql_virtual_machine_group_name: Name of the SQL virtual machine + group. + :type sql_virtual_machine_group_name: str + :param availability_group_listener_name: Name of the availability + group listener. + :type availability_group_listener_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: AvailabilityGroupListener or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sqlvirtualmachine.models.AvailabilityGroupListener + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlVirtualMachineGroupName': self._serialize.url("sql_virtual_machine_group_name", sql_virtual_machine_group_name, 'str'), + 'availabilityGroupListenerName': self._serialize.url("availability_group_listener_name", availability_group_listener_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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AvailabilityGroupListener', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}/availabilityGroupListeners/{availabilityGroupListenerName}'} + + + def _create_or_update_initial( + self, resource_group_name, sql_virtual_machine_group_name, availability_group_listener_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlVirtualMachineGroupName': self._serialize.url("sql_virtual_machine_group_name", sql_virtual_machine_group_name, 'str'), + 'availabilityGroupListenerName': self._serialize.url("availability_group_listener_name", availability_group_listener_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['Accept'] = 'application/json' + 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, 'AvailabilityGroupListener') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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('AvailabilityGroupListener', response) + if response.status_code == 201: + deserialized = self._deserialize('AvailabilityGroupListener', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, sql_virtual_machine_group_name, availability_group_listener_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates an availability group listener. + + :param resource_group_name: 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 sql_virtual_machine_group_name: Name of the SQL virtual machine + group. + :type sql_virtual_machine_group_name: str + :param availability_group_listener_name: Name of the availability + group listener. + :type availability_group_listener_name: str + :param parameters: The availability group listener. + :type parameters: + ~azure.mgmt.sqlvirtualmachine.models.AvailabilityGroupListener + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + AvailabilityGroupListener or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sqlvirtualmachine.models.AvailabilityGroupListener] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sqlvirtualmachine.models.AvailabilityGroupListener]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + sql_virtual_machine_group_name=sql_virtual_machine_group_name, + availability_group_listener_name=availability_group_listener_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('AvailabilityGroupListener', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}/availabilityGroupListeners/{availabilityGroupListenerName}'} + + + def _delete_initial( + self, resource_group_name, sql_virtual_machine_group_name, availability_group_listener_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlVirtualMachineGroupName': self._serialize.url("sql_virtual_machine_group_name", sql_virtual_machine_group_name, 'str'), + 'availabilityGroupListenerName': self._serialize.url("availability_group_listener_name", availability_group_listener_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 = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, 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, sql_virtual_machine_group_name, availability_group_listener_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an availability group listener. + + :param resource_group_name: 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 sql_virtual_machine_group_name: Name of the SQL virtual machine + group. + :type sql_virtual_machine_group_name: str + :param availability_group_listener_name: Name of the availability + group listener. + :type availability_group_listener_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + sql_virtual_machine_group_name=sql_virtual_machine_group_name, + availability_group_listener_name=availability_group_listener_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}/availabilityGroupListeners/{availabilityGroupListenerName}'} + + def list_by_group( + self, resource_group_name, sql_virtual_machine_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all availability group listeners in a SQL virtual machine group. + + :param resource_group_name: 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 sql_virtual_machine_group_name: Name of the SQL virtual machine + group. + :type sql_virtual_machine_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AvailabilityGroupListener + :rtype: + ~azure.mgmt.sqlvirtualmachine.models.AvailabilityGroupListenerPaged[~azure.mgmt.sqlvirtualmachine.models.AvailabilityGroupListener] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlVirtualMachineGroupName': self._serialize.url("sql_virtual_machine_group_name", sql_virtual_machine_group_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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.AvailabilityGroupListenerPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AvailabilityGroupListenerPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}/availabilityGroupListeners'} diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/operations.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/operations.py new file mode 100644 index 000000000000..5876680f0b93 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/operations.py @@ -0,0 +1,98 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version to use for the request. Constant value: "2017-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-03-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available SQL Rest API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.sqlvirtualmachine.models.OperationPaged[~azure.mgmt.sqlvirtualmachine.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.SqlVirtualMachine/operations'} diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/sql_virtual_machine_groups_operations.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/sql_virtual_machine_groups_operations.py new file mode 100644 index 000000000000..ba08176ddd41 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/sql_virtual_machine_groups_operations.py @@ -0,0 +1,531 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class SqlVirtualMachineGroupsOperations(object): + """SqlVirtualMachineGroupsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version to use for the request. Constant value: "2017-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-03-01-preview" + + self.config = config + + def get( + self, resource_group_name, sql_virtual_machine_group_name, custom_headers=None, raw=False, **operation_config): + """Gets a SQL virtual machine group. + + :param resource_group_name: 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 sql_virtual_machine_group_name: Name of the SQL virtual machine + group. + :type sql_virtual_machine_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SqlVirtualMachineGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachineGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlVirtualMachineGroupName': self._serialize.url("sql_virtual_machine_group_name", sql_virtual_machine_group_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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SqlVirtualMachineGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}'} + + + def _create_or_update_initial( + self, resource_group_name, sql_virtual_machine_group_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlVirtualMachineGroupName': self._serialize.url("sql_virtual_machine_group_name", sql_virtual_machine_group_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['Accept'] = 'application/json' + 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, 'SqlVirtualMachineGroup') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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('SqlVirtualMachineGroup', response) + if response.status_code == 201: + deserialized = self._deserialize('SqlVirtualMachineGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, sql_virtual_machine_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a SQL virtual machine group. + + :param resource_group_name: 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 sql_virtual_machine_group_name: Name of the SQL virtual machine + group. + :type sql_virtual_machine_group_name: str + :param parameters: The SQL virtual machine group. + :type parameters: + ~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachineGroup + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SqlVirtualMachineGroup + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachineGroup] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachineGroup]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + sql_virtual_machine_group_name=sql_virtual_machine_group_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('SqlVirtualMachineGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}'} + + + def _delete_initial( + self, resource_group_name, sql_virtual_machine_group_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlVirtualMachineGroupName': self._serialize.url("sql_virtual_machine_group_name", sql_virtual_machine_group_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 = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, 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, sql_virtual_machine_group_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a SQL virtual machine group. + + :param resource_group_name: 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 sql_virtual_machine_group_name: Name of the SQL virtual machine + group. + :type sql_virtual_machine_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + sql_virtual_machine_group_name=sql_virtual_machine_group_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}'} + + + def _update_initial( + self, resource_group_name, sql_virtual_machine_group_name, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.SqlVirtualMachineGroupUpdate(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlVirtualMachineGroupName': self._serialize.url("sql_virtual_machine_group_name", sql_virtual_machine_group_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['Accept'] = 'application/json' + 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, 'SqlVirtualMachineGroupUpdate') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SqlVirtualMachineGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, sql_virtual_machine_group_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates SQL virtual machine group tags. + + :param resource_group_name: 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 sql_virtual_machine_group_name: Name of the SQL virtual machine + group. + :type sql_virtual_machine_group_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SqlVirtualMachineGroup + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachineGroup] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachineGroup]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + sql_virtual_machine_group_name=sql_virtual_machine_group_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('SqlVirtualMachineGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/{sqlVirtualMachineGroupName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all SQL virtual machine groups in a resource group. + + :param resource_group_name: Name of the resource group that contains + the resource. You can obtain this value from the Azure Resource + Manager API or the portal. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SqlVirtualMachineGroup + :rtype: + ~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachineGroupPaged[~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachineGroup] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SqlVirtualMachineGroupPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SqlVirtualMachineGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets all SQL virtual machine groups in a 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 SqlVirtualMachineGroup + :rtype: + ~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachineGroupPaged[~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachineGroup] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SqlVirtualMachineGroupPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SqlVirtualMachineGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups'} diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/sql_virtual_machines_operations.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/sql_virtual_machines_operations.py new file mode 100644 index 000000000000..efb68b3f404b --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/operations/sql_virtual_machines_operations.py @@ -0,0 +1,531 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class SqlVirtualMachinesOperations(object): + """SqlVirtualMachinesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: API version to use for the request. Constant value: "2017-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-03-01-preview" + + self.config = config + + def get( + self, resource_group_name, sql_virtual_machine_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets a SQL virtual machine. + + :param resource_group_name: 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 sql_virtual_machine_name: Name of the SQL virtual machine. + :type sql_virtual_machine_name: str + :param expand: The child resources to include in the response. + :type expand: 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: SqlVirtualMachine or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachine or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlVirtualMachineName': self._serialize.url("sql_virtual_machine_name", sql_virtual_machine_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 = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SqlVirtualMachine', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}'} + + + def _create_or_update_initial( + self, resource_group_name, sql_virtual_machine_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlVirtualMachineName': self._serialize.url("sql_virtual_machine_name", sql_virtual_machine_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['Accept'] = 'application/json' + 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, 'SqlVirtualMachine') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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('SqlVirtualMachine', response) + if response.status_code == 201: + deserialized = self._deserialize('SqlVirtualMachine', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, sql_virtual_machine_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a SQL virtual machine. + + :param resource_group_name: 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 sql_virtual_machine_name: Name of the SQL virtual machine. + :type sql_virtual_machine_name: str + :param parameters: The SQL virtual machine. + :type parameters: + ~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachine + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SqlVirtualMachine or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachine] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachine]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + sql_virtual_machine_name=sql_virtual_machine_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('SqlVirtualMachine', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}'} + + + def _delete_initial( + self, resource_group_name, sql_virtual_machine_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlVirtualMachineName': self._serialize.url("sql_virtual_machine_name", sql_virtual_machine_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 = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, 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, sql_virtual_machine_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a SQL virtual machine. + + :param resource_group_name: 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 sql_virtual_machine_name: Name of the SQL virtual machine. + :type sql_virtual_machine_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + sql_virtual_machine_name=sql_virtual_machine_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}'} + + + def _update_initial( + self, resource_group_name, sql_virtual_machine_name, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.SqlVirtualMachineUpdate(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'sqlVirtualMachineName': self._serialize.url("sql_virtual_machine_name", sql_virtual_machine_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['Accept'] = 'application/json' + 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, 'SqlVirtualMachineUpdate') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SqlVirtualMachine', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, sql_virtual_machine_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a SQL virtual machine. + + :param resource_group_name: 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 sql_virtual_machine_name: Name of the SQL virtual machine. + :type sql_virtual_machine_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns SqlVirtualMachine or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachine] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachine]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + sql_virtual_machine_name=sql_virtual_machine_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('SqlVirtualMachine', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/{sqlVirtualMachineName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all SQL virtual machines in a resource group. + + :param resource_group_name: Name of the resource group that contains + the resource. You can obtain this value from the Azure Resource + Manager API or the portal. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SqlVirtualMachine + :rtype: + ~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachinePaged[~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachine] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SqlVirtualMachinePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SqlVirtualMachinePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets all SQL virtual machines in a 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 SqlVirtualMachine + :rtype: + ~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachinePaged[~azure.mgmt.sqlvirtualmachine.models.SqlVirtualMachine] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.SqlVirtualMachinePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SqlVirtualMachinePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines'} diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/sql_virtual_machine_management_client.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/sql_virtual_machine_management_client.py new file mode 100644 index 000000000000..6dfec102442c --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/sql_virtual_machine_management_client.py @@ -0,0 +1,98 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.availability_group_listeners_operations import AvailabilityGroupListenersOperations +from .operations.operations import Operations +from .operations.sql_virtual_machine_groups_operations import SqlVirtualMachineGroupsOperations +from .operations.sql_virtual_machines_operations import SqlVirtualMachinesOperations +from . import models + + +class SqlVirtualMachineManagementClientConfiguration(AzureConfiguration): + """Configuration for SqlVirtualMachineManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription ID that identifies an Azure + subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(SqlVirtualMachineManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-sqlvirtualmachine/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class SqlVirtualMachineManagementClient(SDKClient): + """The SQL virtual machine management API provides a RESTful set of web APIs that interact with Azure Compute, Network & Storage services to manage your SQL Server virtual machine. The API enables users to create, delete and retrieve a SQL virtual machine, SQL virtual machine group or availability group listener. + + :ivar config: Configuration for client. + :vartype config: SqlVirtualMachineManagementClientConfiguration + + :ivar availability_group_listeners: AvailabilityGroupListeners operations + :vartype availability_group_listeners: azure.mgmt.sqlvirtualmachine.operations.AvailabilityGroupListenersOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.sqlvirtualmachine.operations.Operations + :ivar sql_virtual_machine_groups: SqlVirtualMachineGroups operations + :vartype sql_virtual_machine_groups: azure.mgmt.sqlvirtualmachine.operations.SqlVirtualMachineGroupsOperations + :ivar sql_virtual_machines: SqlVirtualMachines operations + :vartype sql_virtual_machines: azure.mgmt.sqlvirtualmachine.operations.SqlVirtualMachinesOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription ID that identifies an Azure + subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = SqlVirtualMachineManagementClientConfiguration(credentials, subscription_id, base_url) + super(SqlVirtualMachineManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2017-03-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.availability_group_listeners = AvailabilityGroupListenersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.sql_virtual_machine_groups = SqlVirtualMachineGroupsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.sql_virtual_machines = SqlVirtualMachinesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/version.py b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/version.py new file mode 100644 index 000000000000..87acb1634c35 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/azure/mgmt/sqlvirtualmachine/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "2017-03-01-preview" + diff --git a/azure-mgmt-sqlvirtualmachine/sdk_packaging.toml b/azure-mgmt-sqlvirtualmachine/sdk_packaging.toml new file mode 100644 index 000000000000..5f3174a71a13 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/sdk_packaging.toml @@ -0,0 +1,7 @@ +[packaging] +package_name = "azure-mgmt-sqlvirtualmachine" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true diff --git a/azure-mgmt-sqlvirtualmachine/setup.cfg b/azure-mgmt-sqlvirtualmachine/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/azure-mgmt-sqlvirtualmachine/setup.py b/azure-mgmt-sqlvirtualmachine/setup.py new file mode 100644 index 000000000000..89391a1db145 --- /dev/null +++ b/azure-mgmt-sqlvirtualmachine/setup.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-sqlvirtualmachine" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +)