diff --git a/azure-mgmt-rdbms/README.rst b/azure-mgmt-rdbms/README.rst index fd71c9b33560..fd482c8d4e95 100644 --- a/azure-mgmt-rdbms/README.rst +++ b/azure-mgmt-rdbms/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure RDBMS Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +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. @@ -36,12 +36,8 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first: Usage ===== -For code examples, see `PostgreSQL -`__ -on docs.microsoft.com. - -For code examples, see `MySQL -`__ +For code examples, see `RDBMS Management +`__ on docs.microsoft.com. diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/__init__.py new file mode 100644 index 000000000000..9aa3b679e73c --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/__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 .maria_db_management_client import MariaDBManagementClient +from .version import VERSION + +__all__ = ['MariaDBManagementClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/maria_db_management_client.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/maria_db_management_client.py new file mode 100644 index 000000000000..601db5394773 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/maria_db_management_client.py @@ -0,0 +1,123 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.servers_operations import ServersOperations +from .operations.firewall_rules_operations import FirewallRulesOperations +from .operations.databases_operations import DatabasesOperations +from .operations.configurations_operations import ConfigurationsOperations +from .operations.log_files_operations import LogFilesOperations +from .operations.location_based_performance_tier_operations import LocationBasedPerformanceTierOperations +from .operations.check_name_availability_operations import CheckNameAvailabilityOperations +from .operations.server_security_alert_policies_operations import ServerSecurityAlertPoliciesOperations +from .operations.operations import Operations +from . import models + + +class MariaDBManagementClientConfiguration(AzureConfiguration): + """Configuration for MariaDBManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The subscription ID that identifies an Azure + subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(MariaDBManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-rdbms/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class MariaDBManagementClient(SDKClient): + """MariaDB Client + + :ivar config: Configuration for client. + :vartype config: MariaDBManagementClientConfiguration + + :ivar servers: Servers operations + :vartype servers: azure.mgmt.rdbms.mariadb.operations.ServersOperations + :ivar firewall_rules: FirewallRules operations + :vartype firewall_rules: azure.mgmt.rdbms.mariadb.operations.FirewallRulesOperations + :ivar databases: Databases operations + :vartype databases: azure.mgmt.rdbms.mariadb.operations.DatabasesOperations + :ivar configurations: Configurations operations + :vartype configurations: azure.mgmt.rdbms.mariadb.operations.ConfigurationsOperations + :ivar log_files: LogFiles operations + :vartype log_files: azure.mgmt.rdbms.mariadb.operations.LogFilesOperations + :ivar location_based_performance_tier: LocationBasedPerformanceTier operations + :vartype location_based_performance_tier: azure.mgmt.rdbms.mariadb.operations.LocationBasedPerformanceTierOperations + :ivar check_name_availability: CheckNameAvailability operations + :vartype check_name_availability: azure.mgmt.rdbms.mariadb.operations.CheckNameAvailabilityOperations + :ivar server_security_alert_policies: ServerSecurityAlertPolicies operations + :vartype server_security_alert_policies: azure.mgmt.rdbms.mariadb.operations.ServerSecurityAlertPoliciesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.rdbms.mariadb.operations.Operations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The subscription ID that identifies an Azure + subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = MariaDBManagementClientConfiguration(credentials, subscription_id, base_url) + super(MariaDBManagementClient, 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 = '2018-06-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.servers = ServersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.firewall_rules = FirewallRulesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.databases = DatabasesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.configurations = ConfigurationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.log_files = LogFilesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.location_based_performance_tier = LocationBasedPerformanceTierOperations( + self._client, self.config, self._serialize, self._deserialize) + self.check_name_availability = CheckNameAvailabilityOperations( + self._client, self.config, self._serialize, self._deserialize) + self.server_security_alert_policies = ServerSecurityAlertPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/__init__.py new file mode 100644 index 000000000000..66806b08a5b0 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/__init__.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 .proxy_resource_py3 import ProxyResource + from .tracked_resource_py3 import TrackedResource + from .storage_profile_py3 import StorageProfile + from .server_properties_for_create_py3 import ServerPropertiesForCreate + from .server_properties_for_default_create_py3 import ServerPropertiesForDefaultCreate + from .server_properties_for_restore_py3 import ServerPropertiesForRestore + from .server_properties_for_geo_restore_py3 import ServerPropertiesForGeoRestore + from .sku_py3 import Sku + from .server_py3 import Server + from .server_for_create_py3 import ServerForCreate + from .server_update_parameters_py3 import ServerUpdateParameters + from .firewall_rule_py3 import FirewallRule + from .database_py3 import Database + from .configuration_py3 import Configuration + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation + from .operation_list_result_py3 import OperationListResult + from .log_file_py3 import LogFile + from .performance_tier_service_level_objectives_py3 import PerformanceTierServiceLevelObjectives + from .performance_tier_properties_py3 import PerformanceTierProperties + from .name_availability_request_py3 import NameAvailabilityRequest + from .name_availability_py3 import NameAvailability + from .server_security_alert_policy_py3 import ServerSecurityAlertPolicy +except (SyntaxError, ImportError): + from .proxy_resource import ProxyResource + from .tracked_resource import TrackedResource + from .storage_profile import StorageProfile + from .server_properties_for_create import ServerPropertiesForCreate + from .server_properties_for_default_create import ServerPropertiesForDefaultCreate + from .server_properties_for_restore import ServerPropertiesForRestore + from .server_properties_for_geo_restore import ServerPropertiesForGeoRestore + from .sku import Sku + from .server import Server + from .server_for_create import ServerForCreate + from .server_update_parameters import ServerUpdateParameters + from .firewall_rule import FirewallRule + from .database import Database + from .configuration import Configuration + from .operation_display import OperationDisplay + from .operation import Operation + from .operation_list_result import OperationListResult + from .log_file import LogFile + from .performance_tier_service_level_objectives import PerformanceTierServiceLevelObjectives + from .performance_tier_properties import PerformanceTierProperties + from .name_availability_request import NameAvailabilityRequest + from .name_availability import NameAvailability + from .server_security_alert_policy import ServerSecurityAlertPolicy +from .server_paged import ServerPaged +from .firewall_rule_paged import FirewallRulePaged +from .database_paged import DatabasePaged +from .configuration_paged import ConfigurationPaged +from .log_file_paged import LogFilePaged +from .performance_tier_properties_paged import PerformanceTierPropertiesPaged +from .maria_db_management_client_enums import ( + ServerVersion, + SslEnforcementEnum, + ServerState, + GeoRedundantBackup, + SkuTier, + OperationOrigin, + ServerSecurityAlertPolicyState, +) + +__all__ = [ + 'ProxyResource', + 'TrackedResource', + 'StorageProfile', + 'ServerPropertiesForCreate', + 'ServerPropertiesForDefaultCreate', + 'ServerPropertiesForRestore', + 'ServerPropertiesForGeoRestore', + 'Sku', + 'Server', + 'ServerForCreate', + 'ServerUpdateParameters', + 'FirewallRule', + 'Database', + 'Configuration', + 'OperationDisplay', + 'Operation', + 'OperationListResult', + 'LogFile', + 'PerformanceTierServiceLevelObjectives', + 'PerformanceTierProperties', + 'NameAvailabilityRequest', + 'NameAvailability', + 'ServerSecurityAlertPolicy', + 'ServerPaged', + 'FirewallRulePaged', + 'DatabasePaged', + 'ConfigurationPaged', + 'LogFilePaged', + 'PerformanceTierPropertiesPaged', + 'ServerVersion', + 'SslEnforcementEnum', + 'ServerState', + 'GeoRedundantBackup', + 'SkuTier', + 'OperationOrigin', + 'ServerSecurityAlertPolicyState', +] diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/configuration.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/configuration.py new file mode 100644 index 000000000000..8d95fc4a0f25 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/configuration.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class Configuration(ProxyResource): + """Represents a Configuration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param value: Value of the configuration. + :type value: str + :ivar description: Description of the configuration. + :vartype description: str + :ivar default_value: Default value of the configuration. + :vartype default_value: str + :ivar data_type: Data type of the configuration. + :vartype data_type: str + :ivar allowed_values: Allowed values of the configuration. + :vartype allowed_values: str + :param source: Source of the configuration. + :type source: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'default_value': {'readonly': True}, + 'data_type': {'readonly': True}, + 'allowed_values': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'default_value': {'key': 'properties.defaultValue', 'type': 'str'}, + 'data_type': {'key': 'properties.dataType', 'type': 'str'}, + 'allowed_values': {'key': 'properties.allowedValues', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Configuration, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.description = None + self.default_value = None + self.data_type = None + self.allowed_values = None + self.source = kwargs.get('source', None) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/configuration_paged.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/configuration_paged.py new file mode 100644 index 000000000000..c70c45f28d4e --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/configuration_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 ConfigurationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Configuration ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Configuration]'} + } + + def __init__(self, *args, **kwargs): + + super(ConfigurationPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/configuration_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/configuration_py3.py new file mode 100644 index 000000000000..59929c953a7e --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/configuration_py3.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource_py3 import ProxyResource + + +class Configuration(ProxyResource): + """Represents a Configuration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param value: Value of the configuration. + :type value: str + :ivar description: Description of the configuration. + :vartype description: str + :ivar default_value: Default value of the configuration. + :vartype default_value: str + :ivar data_type: Data type of the configuration. + :vartype data_type: str + :ivar allowed_values: Allowed values of the configuration. + :vartype allowed_values: str + :param source: Source of the configuration. + :type source: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'readonly': True}, + 'default_value': {'readonly': True}, + 'data_type': {'readonly': True}, + 'allowed_values': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'default_value': {'key': 'properties.defaultValue', 'type': 'str'}, + 'data_type': {'key': 'properties.dataType', 'type': 'str'}, + 'allowed_values': {'key': 'properties.allowedValues', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, source: str=None, **kwargs) -> None: + super(Configuration, self).__init__(**kwargs) + self.value = value + self.description = None + self.default_value = None + self.data_type = None + self.allowed_values = None + self.source = source diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/database.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/database.py new file mode 100644 index 000000000000..f503efb9fa34 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/database.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class Database(ProxyResource): + """Represents a Database. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param charset: The charset of the database. + :type charset: str + :param collation: The collation of the database. + :type collation: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'charset': {'key': 'properties.charset', 'type': 'str'}, + 'collation': {'key': 'properties.collation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Database, self).__init__(**kwargs) + self.charset = kwargs.get('charset', None) + self.collation = kwargs.get('collation', None) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/database_paged.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/database_paged.py new file mode 100644 index 000000000000..0085e88f5c49 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/database_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class DatabasePaged(Paged): + """ + A paging container for iterating over a list of :class:`Database ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Database]'} + } + + def __init__(self, *args, **kwargs): + + super(DatabasePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/database_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/database_py3.py new file mode 100644 index 000000000000..af8b0ce61e7c --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/database_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource_py3 import ProxyResource + + +class Database(ProxyResource): + """Represents a Database. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param charset: The charset of the database. + :type charset: str + :param collation: The collation of the database. + :type collation: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'charset': {'key': 'properties.charset', 'type': 'str'}, + 'collation': {'key': 'properties.collation', 'type': 'str'}, + } + + def __init__(self, *, charset: str=None, collation: str=None, **kwargs) -> None: + super(Database, self).__init__(**kwargs) + self.charset = charset + self.collation = collation diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/firewall_rule.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/firewall_rule.py new file mode 100644 index 000000000000..af9a04f835d9 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/firewall_rule.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class FirewallRule(ProxyResource): + """Represents a server firewall rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + 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 start_ip_address: Required. The start IP address of the server + firewall rule. Must be IPv4 format. + :type start_ip_address: str + :param end_ip_address: Required. The end IP address of the server firewall + rule. Must be IPv4 format. + :type end_ip_address: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'start_ip_address': {'required': True, 'pattern': r'^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$'}, + 'end_ip_address': {'required': True, 'pattern': r'^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$'}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_ip_address': {'key': 'properties.startIpAddress', 'type': 'str'}, + 'end_ip_address': {'key': 'properties.endIpAddress', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(FirewallRule, self).__init__(**kwargs) + self.start_ip_address = kwargs.get('start_ip_address', None) + self.end_ip_address = kwargs.get('end_ip_address', None) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/firewall_rule_paged.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/firewall_rule_paged.py new file mode 100644 index 000000000000..8b2f23768209 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/firewall_rule_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class FirewallRulePaged(Paged): + """ + A paging container for iterating over a list of :class:`FirewallRule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[FirewallRule]'} + } + + def __init__(self, *args, **kwargs): + + super(FirewallRulePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/firewall_rule_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/firewall_rule_py3.py new file mode 100644 index 000000000000..f5da7a6331e5 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/firewall_rule_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource_py3 import ProxyResource + + +class FirewallRule(ProxyResource): + """Represents a server firewall rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + 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 start_ip_address: Required. The start IP address of the server + firewall rule. Must be IPv4 format. + :type start_ip_address: str + :param end_ip_address: Required. The end IP address of the server firewall + rule. Must be IPv4 format. + :type end_ip_address: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'start_ip_address': {'required': True, 'pattern': r'^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$'}, + 'end_ip_address': {'required': True, 'pattern': r'^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$'}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_ip_address': {'key': 'properties.startIpAddress', 'type': 'str'}, + 'end_ip_address': {'key': 'properties.endIpAddress', 'type': 'str'}, + } + + def __init__(self, *, start_ip_address: str, end_ip_address: str, **kwargs) -> None: + super(FirewallRule, self).__init__(**kwargs) + self.start_ip_address = start_ip_address + self.end_ip_address = end_ip_address diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/log_file.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/log_file.py new file mode 100644 index 000000000000..557c79536e1d --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/log_file.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class LogFile(ProxyResource): + """Represents a log file. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param size_in_kb: Size of the log file. + :type size_in_kb: long + :ivar created_time: Creation timestamp of the log file. + :vartype created_time: datetime + :ivar last_modified_time: Last modified timestamp of the log file. + :vartype last_modified_time: datetime + :param log_file_type: Type of the log file. + :type log_file_type: str + :ivar url: The url to download the log file from. + :vartype url: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'url': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'size_in_kb': {'key': 'properties.sizeInKB', 'type': 'long'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'log_file_type': {'key': 'properties.type', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LogFile, self).__init__(**kwargs) + self.size_in_kb = kwargs.get('size_in_kb', None) + self.created_time = None + self.last_modified_time = None + self.log_file_type = kwargs.get('log_file_type', None) + self.url = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/log_file_paged.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/log_file_paged.py new file mode 100644 index 000000000000..aaa67eb18dd9 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/log_file_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class LogFilePaged(Paged): + """ + A paging container for iterating over a list of :class:`LogFile ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[LogFile]'} + } + + def __init__(self, *args, **kwargs): + + super(LogFilePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/log_file_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/log_file_py3.py new file mode 100644 index 000000000000..c5ff4ea6d345 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/log_file_py3.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 LogFile(ProxyResource): + """Represents a log file. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param size_in_kb: Size of the log file. + :type size_in_kb: long + :ivar created_time: Creation timestamp of the log file. + :vartype created_time: datetime + :ivar last_modified_time: Last modified timestamp of the log file. + :vartype last_modified_time: datetime + :param log_file_type: Type of the log file. + :type log_file_type: str + :ivar url: The url to download the log file from. + :vartype url: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'url': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'size_in_kb': {'key': 'properties.sizeInKB', 'type': 'long'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'log_file_type': {'key': 'properties.type', 'type': 'str'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + } + + def __init__(self, *, size_in_kb: int=None, log_file_type: str=None, **kwargs) -> None: + super(LogFile, self).__init__(**kwargs) + self.size_in_kb = size_in_kb + self.created_time = None + self.last_modified_time = None + self.log_file_type = log_file_type + self.url = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/maria_db_management_client_enums.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/maria_db_management_client_enums.py new file mode 100644 index 000000000000..5be37af621e5 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/maria_db_management_client_enums.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class ServerVersion(str, Enum): + + five_full_stop_six = "5.6" + five_full_stop_seven = "5.7" + + +class SslEnforcementEnum(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class ServerState(str, Enum): + + ready = "Ready" + dropping = "Dropping" + disabled = "Disabled" + + +class GeoRedundantBackup(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class SkuTier(str, Enum): + + basic = "Basic" + general_purpose = "GeneralPurpose" + memory_optimized = "MemoryOptimized" + + +class OperationOrigin(str, Enum): + + not_specified = "NotSpecified" + user = "user" + system = "system" + + +class ServerSecurityAlertPolicyState(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/name_availability.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/name_availability.py new file mode 100644 index 000000000000..327a74ca8a48 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/name_availability.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NameAvailability(Model): + """Represents a resource name availability. + + :param message: Error Message. + :type message: str + :param name_available: Indicates whether the resource name is available. + :type name_available: bool + :param reason: Reason for name being unavailable. + :type reason: str + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NameAvailability, self).__init__(**kwargs) + self.message = kwargs.get('message', None) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/name_availability_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/name_availability_py3.py new file mode 100644 index 000000000000..f7b52a09e29f --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/name_availability_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NameAvailability(Model): + """Represents a resource name availability. + + :param message: Error Message. + :type message: str + :param name_available: Indicates whether the resource name is available. + :type name_available: bool + :param reason: Reason for name being unavailable. + :type reason: str + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__(self, *, message: str=None, name_available: bool=None, reason: str=None, **kwargs) -> None: + super(NameAvailability, self).__init__(**kwargs) + self.message = message + self.name_available = name_available + self.reason = reason diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/name_availability_request.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/name_availability_request.py new file mode 100644 index 000000000000..33cac8ab5308 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/name_availability_request.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NameAvailabilityRequest(Model): + """Request from client to check resource name availability. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name to verify. + :type name: str + :param type: Resource type used for verification. + :type type: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NameAvailabilityRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/name_availability_request_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/name_availability_request_py3.py new file mode 100644 index 000000000000..ec45bb2e4730 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/name_availability_request_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NameAvailabilityRequest(Model): + """Request from client to check resource name availability. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name to verify. + :type name: str + :param type: Resource type used for verification. + :type type: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str, type: str=None, **kwargs) -> None: + super(NameAvailabilityRequest, self).__init__(**kwargs) + self.name = name + self.type = type diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/operation.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/operation.py new file mode 100644 index 000000000000..a4d12d9c276b --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/operation.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """REST API operation definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the operation being performed on this particular + object. + :vartype name: str + :ivar display: The localized display information for this particular + operation or action. + :vartype display: ~azure.mgmt.rdbms.mariadb.models.OperationDisplay + :ivar origin: The intended executor of the operation. Possible values + include: 'NotSpecified', 'user', 'system' + :vartype origin: str or ~azure.mgmt.rdbms.mariadb.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-rdbms/azure/mgmt/rdbms/mariadb/models/operation_display.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/operation_display.py new file mode 100644 index 000000000000..98314a2871d5 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/operation_display.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Operation resource provider name. + :vartype provider: str + :ivar resource: Resource on which the operation is performed. + :vartype resource: str + :ivar operation: Localized friendly name for the operation. + :vartype operation: str + :ivar description: Operation description. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/operation_display_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/operation_display_py3.py new file mode 100644 index 000000000000..9b5a77c699a9 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/operation_display_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: Operation resource provider name. + :vartype provider: str + :ivar resource: Resource on which the operation is performed. + :vartype resource: str + :ivar operation: Localized friendly name for the operation. + :vartype operation: str + :ivar description: Operation description. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/operation_list_result.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/operation_list_result.py new file mode 100644 index 000000000000..5d6b31a6fe76 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/operation_list_result.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationListResult(Model): + """A list of resource provider operations. + + :param value: The list of resource provider operations. + :type value: list[~azure.mgmt.rdbms.mariadb.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__(self, **kwargs): + super(OperationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/operation_list_result_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/operation_list_result_py3.py new file mode 100644 index 000000000000..cff8b627ecd5 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/operation_list_result_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 OperationListResult(Model): + """A list of resource provider operations. + + :param value: The list of resource provider operations. + :type value: list[~azure.mgmt.rdbms.mariadb.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(OperationListResult, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/operation_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/operation_py3.py new file mode 100644 index 000000000000..fe3b01b0a8e1 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/operation_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 msrest.serialization import Model + + +class Operation(Model): + """REST API operation definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the operation being performed on this particular + object. + :vartype name: str + :ivar display: The localized display information for this particular + operation or action. + :vartype display: ~azure.mgmt.rdbms.mariadb.models.OperationDisplay + :ivar origin: The intended executor of the operation. Possible values + include: 'NotSpecified', 'user', 'system' + :vartype origin: str or ~azure.mgmt.rdbms.mariadb.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-rdbms/azure/mgmt/rdbms/mariadb/models/performance_tier_properties.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/performance_tier_properties.py new file mode 100644 index 000000000000..c33af34599e1 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/performance_tier_properties.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 PerformanceTierProperties(Model): + """Performance tier properties. + + :param id: ID of the performance tier. + :type id: str + :param service_level_objectives: Service level objectives associated with + the performance tier + :type service_level_objectives: + list[~azure.mgmt.rdbms.mariadb.models.PerformanceTierServiceLevelObjectives] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'service_level_objectives': {'key': 'serviceLevelObjectives', 'type': '[PerformanceTierServiceLevelObjectives]'}, + } + + def __init__(self, **kwargs): + super(PerformanceTierProperties, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.service_level_objectives = kwargs.get('service_level_objectives', None) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/performance_tier_properties_paged.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/performance_tier_properties_paged.py new file mode 100644 index 000000000000..17c6acdcff18 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/performance_tier_properties_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class PerformanceTierPropertiesPaged(Paged): + """ + A paging container for iterating over a list of :class:`PerformanceTierProperties ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PerformanceTierProperties]'} + } + + def __init__(self, *args, **kwargs): + + super(PerformanceTierPropertiesPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/performance_tier_properties_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/performance_tier_properties_py3.py new file mode 100644 index 000000000000..e2839d4114ae --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/performance_tier_properties_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 PerformanceTierProperties(Model): + """Performance tier properties. + + :param id: ID of the performance tier. + :type id: str + :param service_level_objectives: Service level objectives associated with + the performance tier + :type service_level_objectives: + list[~azure.mgmt.rdbms.mariadb.models.PerformanceTierServiceLevelObjectives] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'service_level_objectives': {'key': 'serviceLevelObjectives', 'type': '[PerformanceTierServiceLevelObjectives]'}, + } + + def __init__(self, *, id: str=None, service_level_objectives=None, **kwargs) -> None: + super(PerformanceTierProperties, self).__init__(**kwargs) + self.id = id + self.service_level_objectives = service_level_objectives diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/performance_tier_service_level_objectives.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/performance_tier_service_level_objectives.py new file mode 100644 index 000000000000..4f653dc28347 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/performance_tier_service_level_objectives.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PerformanceTierServiceLevelObjectives(Model): + """Service level objectives for performance tier. + + :param id: ID for the service level objective. + :type id: str + :param edition: Edition of the performance tier. + :type edition: str + :param v_core: vCore associated with the service level objective + :type v_core: int + :param hardware_generation: Hardware generation associated with the + service level objective + :type hardware_generation: str + :param max_backup_retention_days: Maximum Backup retention in days for the + performance tier edition + :type max_backup_retention_days: int + :param min_backup_retention_days: Minimum Backup retention in days for the + performance tier edition + :type min_backup_retention_days: int + :param max_storage_mb: Max storage allowed for a server. + :type max_storage_mb: int + :param min_storage_mb: Max storage allowed for a server. + :type min_storage_mb: int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'edition': {'key': 'edition', 'type': 'str'}, + 'v_core': {'key': 'vCore', 'type': 'int'}, + 'hardware_generation': {'key': 'hardwareGeneration', 'type': 'str'}, + 'max_backup_retention_days': {'key': 'maxBackupRetentionDays', 'type': 'int'}, + 'min_backup_retention_days': {'key': 'minBackupRetentionDays', 'type': 'int'}, + 'max_storage_mb': {'key': 'maxStorageMB', 'type': 'int'}, + 'min_storage_mb': {'key': 'minStorageMB', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(PerformanceTierServiceLevelObjectives, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.edition = kwargs.get('edition', None) + self.v_core = kwargs.get('v_core', None) + self.hardware_generation = kwargs.get('hardware_generation', None) + self.max_backup_retention_days = kwargs.get('max_backup_retention_days', None) + self.min_backup_retention_days = kwargs.get('min_backup_retention_days', None) + self.max_storage_mb = kwargs.get('max_storage_mb', None) + self.min_storage_mb = kwargs.get('min_storage_mb', None) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/performance_tier_service_level_objectives_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/performance_tier_service_level_objectives_py3.py new file mode 100644 index 000000000000..083e4720ab47 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/performance_tier_service_level_objectives_py3.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PerformanceTierServiceLevelObjectives(Model): + """Service level objectives for performance tier. + + :param id: ID for the service level objective. + :type id: str + :param edition: Edition of the performance tier. + :type edition: str + :param v_core: vCore associated with the service level objective + :type v_core: int + :param hardware_generation: Hardware generation associated with the + service level objective + :type hardware_generation: str + :param max_backup_retention_days: Maximum Backup retention in days for the + performance tier edition + :type max_backup_retention_days: int + :param min_backup_retention_days: Minimum Backup retention in days for the + performance tier edition + :type min_backup_retention_days: int + :param max_storage_mb: Max storage allowed for a server. + :type max_storage_mb: int + :param min_storage_mb: Max storage allowed for a server. + :type min_storage_mb: int + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'edition': {'key': 'edition', 'type': 'str'}, + 'v_core': {'key': 'vCore', 'type': 'int'}, + 'hardware_generation': {'key': 'hardwareGeneration', 'type': 'str'}, + 'max_backup_retention_days': {'key': 'maxBackupRetentionDays', 'type': 'int'}, + 'min_backup_retention_days': {'key': 'minBackupRetentionDays', 'type': 'int'}, + 'max_storage_mb': {'key': 'maxStorageMB', 'type': 'int'}, + 'min_storage_mb': {'key': 'minStorageMB', 'type': 'int'}, + } + + def __init__(self, *, id: str=None, edition: str=None, v_core: int=None, hardware_generation: str=None, max_backup_retention_days: int=None, min_backup_retention_days: int=None, max_storage_mb: int=None, min_storage_mb: int=None, **kwargs) -> None: + super(PerformanceTierServiceLevelObjectives, self).__init__(**kwargs) + self.id = id + self.edition = edition + self.v_core = v_core + self.hardware_generation = hardware_generation + self.max_backup_retention_days = max_backup_retention_days + self.min_backup_retention_days = min_backup_retention_days + self.max_storage_mb = max_storage_mb + self.min_storage_mb = min_storage_mb diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/proxy_resource.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/proxy_resource.py new file mode 100644 index 000000000000..1223f4670fe9 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/proxy_resource.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ProxyResource(Model): + """Resource properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/proxy_resource_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/proxy_resource_py3.py new file mode 100644 index 000000000000..e0dde467e583 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/proxy_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 ProxyResource(Model): + """Resource properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server.py new file mode 100644 index 000000000000..df51a63c87fe --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .tracked_resource import TrackedResource + + +class Server(TrackedResource): + """Represents a server. + + Variables are only populated by the server, and will be ignored when + sending a request. + + 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. The location the resource resides in. + :type location: str + :param tags: Application-specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :param sku: The SKU (pricing tier) of the server. + :type sku: ~azure.mgmt.rdbms.mariadb.models.Sku + :param administrator_login: The administrator's login name of a server. + Can only be specified when the server is being created (and is required + for creation). + :type administrator_login: str + :param version: Server version. Possible values include: '5.6', '5.7' + :type version: str or ~azure.mgmt.rdbms.mariadb.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.mariadb.models.SslEnforcementEnum + :param user_visible_state: A state of a server that is visible to user. + Possible values include: 'Ready', 'Dropping', 'Disabled' + :type user_visible_state: str or + ~azure.mgmt.rdbms.mariadb.models.ServerState + :param fully_qualified_domain_name: The fully qualified domain name of a + server. + :type fully_qualified_domain_name: str + :param earliest_restore_date: Earliest restore point creation time + (ISO8601 format) + :type earliest_restore_date: datetime + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.mariadb.models.StorageProfile + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'properties.sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'user_visible_state': {'key': 'properties.userVisibleState', 'type': 'str'}, + 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, + 'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + } + + def __init__(self, **kwargs): + super(Server, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.administrator_login = kwargs.get('administrator_login', None) + self.version = kwargs.get('version', None) + self.ssl_enforcement = kwargs.get('ssl_enforcement', None) + self.user_visible_state = kwargs.get('user_visible_state', None) + self.fully_qualified_domain_name = kwargs.get('fully_qualified_domain_name', None) + self.earliest_restore_date = kwargs.get('earliest_restore_date', None) + self.storage_profile = kwargs.get('storage_profile', None) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_for_create.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_for_create.py new file mode 100644 index 000000000000..50a281d34eb1 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_for_create.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServerForCreate(Model): + """Represents a server to be created. + + All required parameters must be populated in order to send to Azure. + + :param sku: The SKU (pricing tier) of the server. + :type sku: ~azure.mgmt.rdbms.mariadb.models.Sku + :param properties: Required. Properties of the server. + :type properties: + ~azure.mgmt.rdbms.mariadb.models.ServerPropertiesForCreate + :param location: Required. The location the resource resides in. + :type location: str + :param tags: Application-specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'properties': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'properties': {'key': 'properties', 'type': 'ServerPropertiesForCreate'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ServerForCreate, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.properties = kwargs.get('properties', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_for_create_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_for_create_py3.py new file mode 100644 index 000000000000..ecc98cbe3e11 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_for_create_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServerForCreate(Model): + """Represents a server to be created. + + All required parameters must be populated in order to send to Azure. + + :param sku: The SKU (pricing tier) of the server. + :type sku: ~azure.mgmt.rdbms.mariadb.models.Sku + :param properties: Required. Properties of the server. + :type properties: + ~azure.mgmt.rdbms.mariadb.models.ServerPropertiesForCreate + :param location: Required. The location the resource resides in. + :type location: str + :param tags: Application-specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'properties': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'properties': {'key': 'properties', 'type': 'ServerPropertiesForCreate'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, properties, location: str, sku=None, tags=None, **kwargs) -> None: + super(ServerForCreate, self).__init__(**kwargs) + self.sku = sku + self.properties = properties + self.location = location + self.tags = tags diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_paged.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_paged.py new file mode 100644 index 000000000000..02a6b22a2370 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ServerPaged(Paged): + """ + A paging container for iterating over a list of :class:`Server ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Server]'} + } + + def __init__(self, *args, **kwargs): + + super(ServerPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_create.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_create.py new file mode 100644 index 000000000000..5b6ce7ecf2ae --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_create.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServerPropertiesForCreate(Model): + """The properties used to create a new server. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ServerPropertiesForDefaultCreate, + ServerPropertiesForRestore, ServerPropertiesForGeoRestore + + All required parameters must be populated in order to send to Azure. + + :param version: Server version. Possible values include: '5.6', '5.7' + :type version: str or ~azure.mgmt.rdbms.mariadb.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.mariadb.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.mariadb.models.StorageProfile + :param create_mode: Required. Constant filled by server. + :type create_mode: str + """ + + _validation = { + 'create_mode': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + } + + _subtype_map = { + 'create_mode': {'Default': 'ServerPropertiesForDefaultCreate', 'PointInTimeRestore': 'ServerPropertiesForRestore', 'GeoRestore': 'ServerPropertiesForGeoRestore'} + } + + def __init__(self, **kwargs): + super(ServerPropertiesForCreate, self).__init__(**kwargs) + self.version = kwargs.get('version', None) + self.ssl_enforcement = kwargs.get('ssl_enforcement', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.create_mode = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_create_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_create_py3.py new file mode 100644 index 000000000000..840a39854adf --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_create_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServerPropertiesForCreate(Model): + """The properties used to create a new server. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ServerPropertiesForDefaultCreate, + ServerPropertiesForRestore, ServerPropertiesForGeoRestore + + All required parameters must be populated in order to send to Azure. + + :param version: Server version. Possible values include: '5.6', '5.7' + :type version: str or ~azure.mgmt.rdbms.mariadb.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.mariadb.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.mariadb.models.StorageProfile + :param create_mode: Required. Constant filled by server. + :type create_mode: str + """ + + _validation = { + 'create_mode': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + } + + _subtype_map = { + 'create_mode': {'Default': 'ServerPropertiesForDefaultCreate', 'PointInTimeRestore': 'ServerPropertiesForRestore', 'GeoRestore': 'ServerPropertiesForGeoRestore'} + } + + def __init__(self, *, version=None, ssl_enforcement=None, storage_profile=None, **kwargs) -> None: + super(ServerPropertiesForCreate, self).__init__(**kwargs) + self.version = version + self.ssl_enforcement = ssl_enforcement + self.storage_profile = storage_profile + self.create_mode = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_default_create.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_default_create.py new file mode 100644 index 000000000000..9f77a8e405b0 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_default_create.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .server_properties_for_create import ServerPropertiesForCreate + + +class ServerPropertiesForDefaultCreate(ServerPropertiesForCreate): + """The properties used to create a new server. + + All required parameters must be populated in order to send to Azure. + + :param version: Server version. Possible values include: '5.6', '5.7' + :type version: str or ~azure.mgmt.rdbms.mariadb.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.mariadb.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.mariadb.models.StorageProfile + :param create_mode: Required. Constant filled by server. + :type create_mode: str + :param administrator_login: Required. The administrator's login name of a + server. Can only be specified when the server is being created (and is + required for creation). + :type administrator_login: str + :param administrator_login_password: Required. The password of the + administrator login. + :type administrator_login_password: str + """ + + _validation = { + 'create_mode': {'required': True}, + 'administrator_login': {'required': True}, + 'administrator_login_password': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'administrator_login': {'key': 'administratorLogin', 'type': 'str'}, + 'administrator_login_password': {'key': 'administratorLoginPassword', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServerPropertiesForDefaultCreate, self).__init__(**kwargs) + self.administrator_login = kwargs.get('administrator_login', None) + self.administrator_login_password = kwargs.get('administrator_login_password', None) + self.create_mode = 'Default' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_default_create_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_default_create_py3.py new file mode 100644 index 000000000000..f2f8089ff376 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_default_create_py3.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .server_properties_for_create_py3 import ServerPropertiesForCreate + + +class ServerPropertiesForDefaultCreate(ServerPropertiesForCreate): + """The properties used to create a new server. + + All required parameters must be populated in order to send to Azure. + + :param version: Server version. Possible values include: '5.6', '5.7' + :type version: str or ~azure.mgmt.rdbms.mariadb.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.mariadb.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.mariadb.models.StorageProfile + :param create_mode: Required. Constant filled by server. + :type create_mode: str + :param administrator_login: Required. The administrator's login name of a + server. Can only be specified when the server is being created (and is + required for creation). + :type administrator_login: str + :param administrator_login_password: Required. The password of the + administrator login. + :type administrator_login_password: str + """ + + _validation = { + 'create_mode': {'required': True}, + 'administrator_login': {'required': True}, + 'administrator_login_password': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'administrator_login': {'key': 'administratorLogin', 'type': 'str'}, + 'administrator_login_password': {'key': 'administratorLoginPassword', 'type': 'str'}, + } + + def __init__(self, *, administrator_login: str, administrator_login_password: str, version=None, ssl_enforcement=None, storage_profile=None, **kwargs) -> None: + super(ServerPropertiesForDefaultCreate, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile, **kwargs) + self.administrator_login = administrator_login + self.administrator_login_password = administrator_login_password + self.create_mode = 'Default' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_geo_restore.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_geo_restore.py new file mode 100644 index 000000000000..deb90b6ffa9e --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_geo_restore.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 .server_properties_for_create import ServerPropertiesForCreate + + +class ServerPropertiesForGeoRestore(ServerPropertiesForCreate): + """The properties used to create a new server by restoring to a different + region from a geo replicated backup. + + All required parameters must be populated in order to send to Azure. + + :param version: Server version. Possible values include: '5.6', '5.7' + :type version: str or ~azure.mgmt.rdbms.mariadb.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.mariadb.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.mariadb.models.StorageProfile + :param create_mode: Required. Constant filled by server. + :type create_mode: str + :param source_server_id: Required. The source server id to restore from. + :type source_server_id: str + """ + + _validation = { + 'create_mode': {'required': True}, + 'source_server_id': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'source_server_id': {'key': 'sourceServerId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServerPropertiesForGeoRestore, self).__init__(**kwargs) + self.source_server_id = kwargs.get('source_server_id', None) + self.create_mode = 'GeoRestore' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_geo_restore_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_geo_restore_py3.py new file mode 100644 index 000000000000..33ebbba962d0 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_geo_restore_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 .server_properties_for_create_py3 import ServerPropertiesForCreate + + +class ServerPropertiesForGeoRestore(ServerPropertiesForCreate): + """The properties used to create a new server by restoring to a different + region from a geo replicated backup. + + All required parameters must be populated in order to send to Azure. + + :param version: Server version. Possible values include: '5.6', '5.7' + :type version: str or ~azure.mgmt.rdbms.mariadb.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.mariadb.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.mariadb.models.StorageProfile + :param create_mode: Required. Constant filled by server. + :type create_mode: str + :param source_server_id: Required. The source server id to restore from. + :type source_server_id: str + """ + + _validation = { + 'create_mode': {'required': True}, + 'source_server_id': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'source_server_id': {'key': 'sourceServerId', 'type': 'str'}, + } + + def __init__(self, *, source_server_id: str, version=None, ssl_enforcement=None, storage_profile=None, **kwargs) -> None: + super(ServerPropertiesForGeoRestore, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile, **kwargs) + self.source_server_id = source_server_id + self.create_mode = 'GeoRestore' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_restore.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_restore.py new file mode 100644 index 000000000000..620a7e7ba2cf --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_restore.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .server_properties_for_create import ServerPropertiesForCreate + + +class ServerPropertiesForRestore(ServerPropertiesForCreate): + """The properties used to create a new server by restoring from a backup. + + All required parameters must be populated in order to send to Azure. + + :param version: Server version. Possible values include: '5.6', '5.7' + :type version: str or ~azure.mgmt.rdbms.mariadb.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.mariadb.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.mariadb.models.StorageProfile + :param create_mode: Required. Constant filled by server. + :type create_mode: str + :param source_server_id: Required. The source server id to restore from. + :type source_server_id: str + :param restore_point_in_time: Required. Restore point creation time + (ISO8601 format), specifying the time to restore from. + :type restore_point_in_time: datetime + """ + + _validation = { + 'create_mode': {'required': True}, + 'source_server_id': {'required': True}, + 'restore_point_in_time': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'source_server_id': {'key': 'sourceServerId', 'type': 'str'}, + 'restore_point_in_time': {'key': 'restorePointInTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(ServerPropertiesForRestore, self).__init__(**kwargs) + self.source_server_id = kwargs.get('source_server_id', None) + self.restore_point_in_time = kwargs.get('restore_point_in_time', None) + self.create_mode = 'PointInTimeRestore' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_restore_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_restore_py3.py new file mode 100644 index 000000000000..7b6fa4702bb5 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_properties_for_restore_py3.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .server_properties_for_create_py3 import ServerPropertiesForCreate + + +class ServerPropertiesForRestore(ServerPropertiesForCreate): + """The properties used to create a new server by restoring from a backup. + + All required parameters must be populated in order to send to Azure. + + :param version: Server version. Possible values include: '5.6', '5.7' + :type version: str or ~azure.mgmt.rdbms.mariadb.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.mariadb.models.SslEnforcementEnum + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.mariadb.models.StorageProfile + :param create_mode: Required. Constant filled by server. + :type create_mode: str + :param source_server_id: Required. The source server id to restore from. + :type source_server_id: str + :param restore_point_in_time: Required. Restore point creation time + (ISO8601 format), specifying the time to restore from. + :type restore_point_in_time: datetime + """ + + _validation = { + 'create_mode': {'required': True}, + 'source_server_id': {'required': True}, + 'restore_point_in_time': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'source_server_id': {'key': 'sourceServerId', 'type': 'str'}, + 'restore_point_in_time': {'key': 'restorePointInTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, source_server_id: str, restore_point_in_time, version=None, ssl_enforcement=None, storage_profile=None, **kwargs) -> None: + super(ServerPropertiesForRestore, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile, **kwargs) + self.source_server_id = source_server_id + self.restore_point_in_time = restore_point_in_time + self.create_mode = 'PointInTimeRestore' diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_py3.py new file mode 100644 index 000000000000..0a2ec517b6c9 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_py3.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 Server(TrackedResource): + """Represents a server. + + 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. The location the resource resides in. + :type location: str + :param tags: Application-specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :param sku: The SKU (pricing tier) of the server. + :type sku: ~azure.mgmt.rdbms.mariadb.models.Sku + :param administrator_login: The administrator's login name of a server. + Can only be specified when the server is being created (and is required + for creation). + :type administrator_login: str + :param version: Server version. Possible values include: '5.6', '5.7' + :type version: str or ~azure.mgmt.rdbms.mariadb.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.mariadb.models.SslEnforcementEnum + :param user_visible_state: A state of a server that is visible to user. + Possible values include: 'Ready', 'Dropping', 'Disabled' + :type user_visible_state: str or + ~azure.mgmt.rdbms.mariadb.models.ServerState + :param fully_qualified_domain_name: The fully qualified domain name of a + server. + :type fully_qualified_domain_name: str + :param earliest_restore_date: Earliest restore point creation time + (ISO8601 format) + :type earliest_restore_date: datetime + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.mariadb.models.StorageProfile + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'properties.sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'user_visible_state': {'key': 'properties.userVisibleState', 'type': 'str'}, + 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, + 'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + } + + def __init__(self, *, location: str, tags=None, sku=None, administrator_login: str=None, version=None, ssl_enforcement=None, user_visible_state=None, fully_qualified_domain_name: str=None, earliest_restore_date=None, storage_profile=None, **kwargs) -> None: + super(Server, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.administrator_login = administrator_login + self.version = version + self.ssl_enforcement = ssl_enforcement + self.user_visible_state = user_visible_state + self.fully_qualified_domain_name = fully_qualified_domain_name + self.earliest_restore_date = earliest_restore_date + self.storage_profile = storage_profile diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_security_alert_policy.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_security_alert_policy.py new file mode 100644 index 000000000000..5fa0f877316a --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_security_alert_policy.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 .proxy_resource import ProxyResource + + +class ServerSecurityAlertPolicy(ProxyResource): + """A server security alert policy. + + 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 state: Required. Specifies the state of the policy, whether it is + enabled or disabled. Possible values include: 'Enabled', 'Disabled' + :type state: str or + ~azure.mgmt.rdbms.mariadb.models.ServerSecurityAlertPolicyState + :param disabled_alerts: Specifies an array of alerts that are disabled. + Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, + Access_Anomaly + :type disabled_alerts: list[str] + :param email_addresses: Specifies an array of e-mail addresses to which + the alert is sent. + :type email_addresses: list[str] + :param email_account_admins: Specifies that the alert is sent to the + account administrators. + :type email_account_admins: bool + :param storage_endpoint: Specifies the blob storage endpoint (e.g. + https://MyAccount.blob.core.windows.net). This blob storage will hold all + Threat Detection audit logs. + :type storage_endpoint: str + :param storage_account_access_key: Specifies the identifier key of the + Threat Detection audit storage account. + :type storage_account_access_key: str + :param retention_days: Specifies the number of days to keep in the Threat + Detection audit logs. + :type retention_days: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'ServerSecurityAlertPolicyState'}, + 'disabled_alerts': {'key': 'properties.disabledAlerts', 'type': '[str]'}, + 'email_addresses': {'key': 'properties.emailAddresses', 'type': '[str]'}, + 'email_account_admins': {'key': 'properties.emailAccountAdmins', 'type': 'bool'}, + 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, + 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, + 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ServerSecurityAlertPolicy, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.disabled_alerts = kwargs.get('disabled_alerts', None) + self.email_addresses = kwargs.get('email_addresses', None) + self.email_account_admins = kwargs.get('email_account_admins', None) + self.storage_endpoint = kwargs.get('storage_endpoint', None) + self.storage_account_access_key = kwargs.get('storage_account_access_key', None) + self.retention_days = kwargs.get('retention_days', None) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_security_alert_policy_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_security_alert_policy_py3.py new file mode 100644 index 000000000000..4a44fb648913 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_security_alert_policy_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 .proxy_resource_py3 import ProxyResource + + +class ServerSecurityAlertPolicy(ProxyResource): + """A server security alert policy. + + 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 state: Required. Specifies the state of the policy, whether it is + enabled or disabled. Possible values include: 'Enabled', 'Disabled' + :type state: str or + ~azure.mgmt.rdbms.mariadb.models.ServerSecurityAlertPolicyState + :param disabled_alerts: Specifies an array of alerts that are disabled. + Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, + Access_Anomaly + :type disabled_alerts: list[str] + :param email_addresses: Specifies an array of e-mail addresses to which + the alert is sent. + :type email_addresses: list[str] + :param email_account_admins: Specifies that the alert is sent to the + account administrators. + :type email_account_admins: bool + :param storage_endpoint: Specifies the blob storage endpoint (e.g. + https://MyAccount.blob.core.windows.net). This blob storage will hold all + Threat Detection audit logs. + :type storage_endpoint: str + :param storage_account_access_key: Specifies the identifier key of the + Threat Detection audit storage account. + :type storage_account_access_key: str + :param retention_days: Specifies the number of days to keep in the Threat + Detection audit logs. + :type retention_days: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'ServerSecurityAlertPolicyState'}, + 'disabled_alerts': {'key': 'properties.disabledAlerts', 'type': '[str]'}, + 'email_addresses': {'key': 'properties.emailAddresses', 'type': '[str]'}, + 'email_account_admins': {'key': 'properties.emailAccountAdmins', 'type': 'bool'}, + 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, + 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, + 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, + } + + def __init__(self, *, state, disabled_alerts=None, email_addresses=None, email_account_admins: bool=None, storage_endpoint: str=None, storage_account_access_key: str=None, retention_days: int=None, **kwargs) -> None: + super(ServerSecurityAlertPolicy, self).__init__(**kwargs) + self.state = state + self.disabled_alerts = disabled_alerts + self.email_addresses = email_addresses + self.email_account_admins = email_account_admins + self.storage_endpoint = storage_endpoint + self.storage_account_access_key = storage_account_access_key + self.retention_days = retention_days diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_update_parameters.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_update_parameters.py new file mode 100644 index 000000000000..f9f703cf8685 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_update_parameters.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServerUpdateParameters(Model): + """Parameters allowd to update for a server. + + :param sku: The SKU (pricing tier) of the server. + :type sku: ~azure.mgmt.rdbms.mariadb.models.Sku + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.mariadb.models.StorageProfile + :param administrator_login_password: The password of the administrator + login. + :type administrator_login_password: str + :param version: The version of a server. Possible values include: '5.6', + '5.7' + :type version: str or ~azure.mgmt.rdbms.mariadb.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.mariadb.models.SslEnforcementEnum + :param tags: Application-specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'properties.sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ServerUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.storage_profile = kwargs.get('storage_profile', None) + self.administrator_login_password = kwargs.get('administrator_login_password', None) + self.version = kwargs.get('version', None) + self.ssl_enforcement = kwargs.get('ssl_enforcement', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_update_parameters_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_update_parameters_py3.py new file mode 100644 index 000000000000..b4ebb57dce5c --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/server_update_parameters_py3.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServerUpdateParameters(Model): + """Parameters allowd to update for a server. + + :param sku: The SKU (pricing tier) of the server. + :type sku: ~azure.mgmt.rdbms.mariadb.models.Sku + :param storage_profile: Storage profile of a server. + :type storage_profile: ~azure.mgmt.rdbms.mariadb.models.StorageProfile + :param administrator_login_password: The password of the administrator + login. + :type administrator_login_password: str + :param version: The version of a server. Possible values include: '5.6', + '5.7' + :type version: str or ~azure.mgmt.rdbms.mariadb.models.ServerVersion + :param ssl_enforcement: Enable ssl enforcement or not when connect to + server. Possible values include: 'Enabled', 'Disabled' + :type ssl_enforcement: str or + ~azure.mgmt.rdbms.mariadb.models.SslEnforcementEnum + :param tags: Application-specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, + 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'ssl_enforcement': {'key': 'properties.sslEnforcement', 'type': 'SslEnforcementEnum'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, sku=None, storage_profile=None, administrator_login_password: str=None, version=None, ssl_enforcement=None, tags=None, **kwargs) -> None: + super(ServerUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.storage_profile = storage_profile + self.administrator_login_password = administrator_login_password + self.version = version + self.ssl_enforcement = ssl_enforcement + self.tags = tags diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/sku.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/sku.py new file mode 100644 index 000000000000..3652595b01c2 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/sku.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Sku(Model): + """Billing information related properties of a server. + + :param name: The name of the sku, typically, tier + family + cores, e.g. + B_Gen4_1, GP_Gen5_8. + :type name: str + :param tier: The tier of the particular SKU, e.g. Basic. Possible values + include: 'Basic', 'GeneralPurpose', 'MemoryOptimized' + :type tier: str or ~azure.mgmt.rdbms.mariadb.models.SkuTier + :param capacity: The scale up/out capacity, representing server's compute + units. + :type capacity: int + :param size: The size code, to be interpreted by resource as appropriate. + :type size: str + :param family: The family of hardware. + :type family: str + """ + + _validation = { + 'capacity': {'minimum': 0}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) + self.size = kwargs.get('size', None) + self.family = kwargs.get('family', None) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/sku_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/sku_py3.py new file mode 100644 index 000000000000..04332a36f924 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/sku_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 Sku(Model): + """Billing information related properties of a server. + + :param name: The name of the sku, typically, tier + family + cores, e.g. + B_Gen4_1, GP_Gen5_8. + :type name: str + :param tier: The tier of the particular SKU, e.g. Basic. Possible values + include: 'Basic', 'GeneralPurpose', 'MemoryOptimized' + :type tier: str or ~azure.mgmt.rdbms.mariadb.models.SkuTier + :param capacity: The scale up/out capacity, representing server's compute + units. + :type capacity: int + :param size: The size code, to be interpreted by resource as appropriate. + :type size: str + :param family: The family of hardware. + :type family: str + """ + + _validation = { + 'capacity': {'minimum': 0}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, tier=None, capacity: int=None, size: str=None, family: str=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity + self.size = size + self.family = family diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/storage_profile.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/storage_profile.py new file mode 100644 index 000000000000..3af4d11079a5 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/storage_profile.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageProfile(Model): + """Storage Profile properties of a server. + + :param backup_retention_days: Backup retention days for the server. + :type backup_retention_days: int + :param geo_redundant_backup: Enable Geo-redundant or not for server + backup. Possible values include: 'Enabled', 'Disabled' + :type geo_redundant_backup: str or + ~azure.mgmt.rdbms.mariadb.models.GeoRedundantBackup + :param storage_mb: Max storage allowed for a server. + :type storage_mb: int + """ + + _attribute_map = { + 'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'}, + 'geo_redundant_backup': {'key': 'geoRedundantBackup', 'type': 'str'}, + 'storage_mb': {'key': 'storageMB', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(StorageProfile, self).__init__(**kwargs) + self.backup_retention_days = kwargs.get('backup_retention_days', None) + self.geo_redundant_backup = kwargs.get('geo_redundant_backup', None) + self.storage_mb = kwargs.get('storage_mb', None) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/storage_profile_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/storage_profile_py3.py new file mode 100644 index 000000000000..e231ef1873a7 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/storage_profile_py3.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageProfile(Model): + """Storage Profile properties of a server. + + :param backup_retention_days: Backup retention days for the server. + :type backup_retention_days: int + :param geo_redundant_backup: Enable Geo-redundant or not for server + backup. Possible values include: 'Enabled', 'Disabled' + :type geo_redundant_backup: str or + ~azure.mgmt.rdbms.mariadb.models.GeoRedundantBackup + :param storage_mb: Max storage allowed for a server. + :type storage_mb: int + """ + + _attribute_map = { + 'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'}, + 'geo_redundant_backup': {'key': 'geoRedundantBackup', 'type': 'str'}, + 'storage_mb': {'key': 'storageMB', 'type': 'int'}, + } + + def __init__(self, *, backup_retention_days: int=None, geo_redundant_backup=None, storage_mb: int=None, **kwargs) -> None: + super(StorageProfile, self).__init__(**kwargs) + self.backup_retention_days = backup_retention_days + self.geo_redundant_backup = geo_redundant_backup + self.storage_mb = storage_mb diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/tracked_resource.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/tracked_resource.py new file mode 100644 index 000000000000..67e93dd79e77 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/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 .proxy_resource import ProxyResource + + +class TrackedResource(ProxyResource): + """Resource properties including location and tags for track resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + 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. The location the resource resides in. + :type location: str + :param tags: Application-specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/tracked_resource_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/tracked_resource_py3.py new file mode 100644 index 000000000000..0fbc3cc3edc9 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/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 .proxy_resource_py3 import ProxyResource + + +class TrackedResource(ProxyResource): + """Resource properties including location and tags for track resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + 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. The location the resource resides in. + :type location: str + :param tags: Application-specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.location = location + self.tags = tags diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/__init__.py new file mode 100644 index 000000000000..8da462eefd31 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/__init__.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .servers_operations import ServersOperations +from .firewall_rules_operations import FirewallRulesOperations +from .databases_operations import DatabasesOperations +from .configurations_operations import ConfigurationsOperations +from .log_files_operations import LogFilesOperations +from .location_based_performance_tier_operations import LocationBasedPerformanceTierOperations +from .check_name_availability_operations import CheckNameAvailabilityOperations +from .server_security_alert_policies_operations import ServerSecurityAlertPoliciesOperations +from .operations import Operations + +__all__ = [ + 'ServersOperations', + 'FirewallRulesOperations', + 'DatabasesOperations', + 'ConfigurationsOperations', + 'LogFilesOperations', + 'LocationBasedPerformanceTierOperations', + 'CheckNameAvailabilityOperations', + 'ServerSecurityAlertPoliciesOperations', + 'Operations', +] diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/check_name_availability_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/check_name_availability_operations.py new file mode 100644 index 000000000000..86103593a2e9 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/check_name_availability_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class CheckNameAvailabilityOperations(object): + """CheckNameAvailabilityOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2018-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-06-01-preview" + + self.config = config + + def execute( + self, name, type=None, custom_headers=None, raw=False, **operation_config): + """Check the availability of name for resource. + + :param name: Resource name to verify. + :type name: str + :param type: Resource type used for verification. + :type type: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NameAvailability or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.rdbms.mariadb.models.NameAvailability or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + name_availability_request = models.NameAvailabilityRequest(name=name, type=type) + + # Construct URL + url = self.execute.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') + + # 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(name_availability_request, 'NameAvailabilityRequest') + + # Construct and send request + request = self._client.post(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('NameAvailability', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + execute.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DBforMariaDB/checkNameAvailability'} diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/configurations_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/configurations_operations.py new file mode 100644 index 000000000000..7321c3ad897d --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/configurations_operations.py @@ -0,0 +1,290 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 ConfigurationsOperations(object): + """ConfigurationsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2018-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-06-01-preview" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, server_name, configuration_name, value=None, source=None, custom_headers=None, raw=False, **operation_config): + parameters = models.Configuration(value=value, source=source) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['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, 'Configuration') + + # 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, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Configuration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, server_name, configuration_name, value=None, source=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a configuration of a server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param configuration_name: The name of the server configuration. + :type configuration_name: str + :param value: Value of the configuration. + :type value: str + :param source: Source of the configuration. + :type source: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: 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 Configuration or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mariadb.models.Configuration] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.rdbms.mariadb.models.Configuration]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + configuration_name=configuration_name, + value=value, + source=source, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Configuration', 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.DBforMariaDB/servers/{serverName}/configurations/{configurationName}'} + + def get( + self, resource_group_name, server_name, configuration_name, custom_headers=None, raw=False, **operation_config): + """Gets information about a configuration of server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param configuration_name: The name of the server configuration. + :type configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Configuration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.rdbms.mariadb.models.Configuration or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['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('Configuration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/configurations/{configurationName}'} + + def list_by_server( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """List all the configurations in a given server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Configuration + :rtype: + ~azure.mgmt.rdbms.mariadb.models.ConfigurationPaged[~azure.mgmt.rdbms.mariadb.models.Configuration] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_server.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['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.ConfigurationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/configurations'} diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/databases_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/databases_operations.py new file mode 100644 index 000000000000..5e1d7985f4bc --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/databases_operations.py @@ -0,0 +1,377 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 DatabasesOperations(object): + """DatabasesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2018-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-06-01-preview" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, server_name, database_name, charset=None, collation=None, custom_headers=None, raw=False, **operation_config): + parameters = models.Database(charset=charset, collation=collation) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['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, 'Database') + + # 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, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Database', response) + if response.status_code == 201: + deserialized = self._deserialize('Database', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, server_name, database_name, charset=None, collation=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a new database or updates an existing database. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param charset: The charset of the database. + :type charset: str + :param collation: The collation of the database. + :type collation: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: 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 Database or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mariadb.models.Database] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.rdbms.mariadb.models.Database]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + charset=charset, + collation=collation, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Database', 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.DBforMariaDB/servers/{serverName}/databases/{databaseName}'} + + + def _delete_initial( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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, server_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a database. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: 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, + server_name=server_name, + database_name=database_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.DBforMariaDB/servers/{serverName}/databases/{databaseName}'} + + def get( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """Gets information about a database. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Database or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.rdbms.mariadb.models.Database or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['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('Database', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/databases/{databaseName}'} + + def list_by_server( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """List all the databases in a given server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Database + :rtype: + ~azure.mgmt.rdbms.mariadb.models.DatabasePaged[~azure.mgmt.rdbms.mariadb.models.Database] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_server.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['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.DatabasePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DatabasePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/databases'} diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/firewall_rules_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/firewall_rules_operations.py new file mode 100644 index 000000000000..7a411597b3bd --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/firewall_rules_operations.py @@ -0,0 +1,379 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 FirewallRulesOperations(object): + """FirewallRulesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2018-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-06-01-preview" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, server_name, firewall_rule_name, start_ip_address, end_ip_address, custom_headers=None, raw=False, **operation_config): + parameters = models.FirewallRule(start_ip_address=start_ip_address, end_ip_address=end_ip_address) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['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, 'FirewallRule') + + # 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, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('FirewallRule', response) + if response.status_code == 201: + deserialized = self._deserialize('FirewallRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, server_name, firewall_rule_name, start_ip_address, end_ip_address, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a new firewall rule or updates an existing firewall rule. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param firewall_rule_name: The name of the server firewall rule. + :type firewall_rule_name: str + :param start_ip_address: The start IP address of the server firewall + rule. Must be IPv4 format. + :type start_ip_address: str + :param end_ip_address: The end IP address of the server firewall rule. + Must be IPv4 format. + :type end_ip_address: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: 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 FirewallRule or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mariadb.models.FirewallRule] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.rdbms.mariadb.models.FirewallRule]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + firewall_rule_name=firewall_rule_name, + start_ip_address=start_ip_address, + end_ip_address=end_ip_address, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('FirewallRule', 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.DBforMariaDB/servers/{serverName}/firewallRules/{firewallRuleName}'} + + + def _delete_initial( + self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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, server_name, firewall_rule_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a server firewall rule. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param firewall_rule_name: The name of the server firewall rule. + :type firewall_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: 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, + server_name=server_name, + firewall_rule_name=firewall_rule_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.DBforMariaDB/servers/{serverName}/firewallRules/{firewallRuleName}'} + + def get( + self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): + """Gets information about a server firewall rule. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param firewall_rule_name: The name of the server firewall rule. + :type firewall_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: FirewallRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.rdbms.mariadb.models.FirewallRule or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['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('FirewallRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/firewallRules/{firewallRuleName}'} + + def list_by_server( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """List all the firewall rules in a given server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of FirewallRule + :rtype: + ~azure.mgmt.rdbms.mariadb.models.FirewallRulePaged[~azure.mgmt.rdbms.mariadb.models.FirewallRule] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_server.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['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.FirewallRulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.FirewallRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/firewallRules'} diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/location_based_performance_tier_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/location_based_performance_tier_operations.py new file mode 100644 index 000000000000..bf20bf9e5f7d --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/location_based_performance_tier_operations.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class LocationBasedPerformanceTierOperations(object): + """LocationBasedPerformanceTierOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2018-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-06-01-preview" + + self.config = config + + def list( + self, location_name, custom_headers=None, raw=False, **operation_config): + """List all the performance tiers at specified location in a given + subscription. + + :param location_name: The name of the location. + :type location_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PerformanceTierProperties + :rtype: + ~azure.mgmt.rdbms.mariadb.models.PerformanceTierPropertiesPaged[~azure.mgmt.rdbms.mariadb.models.PerformanceTierProperties] + :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'), + 'locationName': self._serialize.url("location_name", location_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['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.PerformanceTierPropertiesPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PerformanceTierPropertiesPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DBforMariaDB/locations/{locationName}/performanceTiers'} diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/log_files_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/log_files_operations.py new file mode 100644 index 000000000000..936807aaecd6 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/log_files_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class LogFilesOperations(object): + """LogFilesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2018-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-06-01-preview" + + self.config = config + + def list_by_server( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """List all the log files in a given server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of LogFile + :rtype: + ~azure.mgmt.rdbms.mariadb.models.LogFilePaged[~azure.mgmt.rdbms.mariadb.models.LogFile] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_server.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['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.LogFilePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.LogFilePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/logFiles'} diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/operations.py new file mode 100644 index 000000000000..2953ff26f771 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/operations.py @@ -0,0 +1,90 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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: The API version to use for the request. Constant value: "2018-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-06-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available REST API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OperationListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.rdbms.mariadb.models.OperationListResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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') + + # 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('OperationListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.DBforMariaDB/operations'} diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/server_security_alert_policies_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/server_security_alert_policies_operations.py new file mode 100644 index 000000000000..a2814dd51ff3 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/server_security_alert_policies_operations.py @@ -0,0 +1,212 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 ServerSecurityAlertPoliciesOperations(object): + """ServerSecurityAlertPoliciesOperations 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 security_alert_policy_name: The name of the security alert policy. Constant value: "Default". + :ivar api_version: The API version to use for the request. Constant value: "2018-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.security_alert_policy_name = "Default" + self.api_version = "2018-06-01-preview" + + self.config = config + + def get( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """Get a server's security alert policy. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ServerSecurityAlertPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.rdbms.mariadb.models.ServerSecurityAlertPolicy 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'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'securityAlertPolicyName': self._serialize.url("self.security_alert_policy_name", self.security_alert_policy_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('ServerSecurityAlertPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}'} + + + def _create_or_update_initial( + self, resource_group_name, server_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'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'securityAlertPolicyName': self._serialize.url("self.security_alert_policy_name", self.security_alert_policy_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, 'ServerSecurityAlertPolicy') + + # 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, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ServerSecurityAlertPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a threat detection policy. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param parameters: The server security alert policy. + :type parameters: + ~azure.mgmt.rdbms.mariadb.models.ServerSecurityAlertPolicy + :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 + ServerSecurityAlertPolicy or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mariadb.models.ServerSecurityAlertPolicy] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.rdbms.mariadb.models.ServerSecurityAlertPolicy]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ServerSecurityAlertPolicy', 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.DBforMariaDB/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}'} diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/servers_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/servers_operations.py new file mode 100644 index 000000000000..3d654d865f0c --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/servers_operations.py @@ -0,0 +1,528 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 ServersOperations(object): + """ServersOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2018-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-06-01-preview" + + self.config = config + + + def _create_initial( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['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, 'ServerForCreate') + + # 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, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Server', response) + if response.status_code == 201: + deserialized = self._deserialize('Server', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a new server or updates an existing server. The update action + will overwrite the existing server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param parameters: The required parameters for creating or updating a + server. + :type parameters: ~azure.mgmt.rdbms.mariadb.models.ServerForCreate + :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 Server or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mariadb.models.Server] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.rdbms.mariadb.models.Server]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + server_name=server_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Server', 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}'} + + + def _update_initial( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['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, 'ServerUpdateParameters') + + # 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, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Server', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates an existing server. The request body can contain one to many of + the properties present in the normal server definition. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param parameters: The required parameters for updating a server. + :type parameters: + ~azure.mgmt.rdbms.mariadb.models.ServerUpdateParameters + :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 Server or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mariadb.models.Server] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.rdbms.mariadb.models.Server]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Server', 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.DBforMariaDB/servers/{serverName}'} + + + def _delete_initial( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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, server_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: 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, + server_name=server_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.DBforMariaDB/servers/{serverName}'} + + def get( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """Gets information about a server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Server or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.rdbms.mariadb.models.Server or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['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('Server', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """List all the servers in a given resource group. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Server + :rtype: + ~azure.mgmt.rdbms.mariadb.models.ServerPaged[~azure.mgmt.rdbms.mariadb.models.Server] + :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 = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['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.ServerPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ServerPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List all the servers in a given subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Server + :rtype: + ~azure.mgmt.rdbms.mariadb.models.ServerPaged[~azure.mgmt.rdbms.mariadb.models.Server] + :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.ServerPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ServerPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DBforMariaDB/servers'} diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/version.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/version.py new file mode 100644 index 000000000000..fcb31ad1686d --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/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 = "2018-06-01-preview" + diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/version.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/version.py index aa163582f188..815b838ddcb8 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/version.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/version.py @@ -5,5 +5,5 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "1.2.0" +VERSION = "1.3.0" diff --git a/azure-mgmt-rdbms/setup.py b/azure-mgmt-rdbms/setup.py index 11cabf50fc31..8dd6109a94ff 100644 --- a/azure-mgmt-rdbms/setup.py +++ b/azure-mgmt-rdbms/setup.py @@ -72,12 +72,14 @@ '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"]), install_requires=[ - 'msrestazure>=0.4.27,<2.0.0', + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', 'azure-common~=1.1', ], cmdclass=cmdclass