diff --git a/azure-mgmt-rdbms/HISTORY.rst b/azure-mgmt-rdbms/HISTORY.rst index 2217d6d9961c..15c09b04999f 100644 --- a/azure-mgmt-rdbms/HISTORY.rst +++ b/azure-mgmt-rdbms/HISTORY.rst @@ -3,6 +3,13 @@ Release History =============== +1.5.0 (2018-10-30) +++++++++++++++++++ + +**Features** + +- Added operation group VirtualNetworkRulesOperations for MariaDB + 1.4.1 (2018-10-16) ++++++++++++++++++ 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 index 601db5394773..0181f41782d5 100644 --- 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 @@ -15,6 +15,7 @@ from .version import VERSION from .operations.servers_operations import ServersOperations from .operations.firewall_rules_operations import FirewallRulesOperations +from .operations.virtual_network_rules_operations import VirtualNetworkRulesOperations from .operations.databases_operations import DatabasesOperations from .operations.configurations_operations import ConfigurationsOperations from .operations.log_files_operations import LogFilesOperations @@ -68,6 +69,8 @@ class MariaDBManagementClient(SDKClient): :vartype servers: azure.mgmt.rdbms.mariadb.operations.ServersOperations :ivar firewall_rules: FirewallRules operations :vartype firewall_rules: azure.mgmt.rdbms.mariadb.operations.FirewallRulesOperations + :ivar virtual_network_rules: VirtualNetworkRules operations + :vartype virtual_network_rules: azure.mgmt.rdbms.mariadb.operations.VirtualNetworkRulesOperations :ivar databases: Databases operations :vartype databases: azure.mgmt.rdbms.mariadb.operations.DatabasesOperations :ivar configurations: Configurations operations @@ -107,6 +110,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.firewall_rules = FirewallRulesOperations( self._client, self.config, self._serialize, self._deserialize) + self.virtual_network_rules = VirtualNetworkRulesOperations( + self._client, self.config, self._serialize, self._deserialize) self.databases = DatabasesOperations( self._client, self.config, self._serialize, self._deserialize) self.configurations = ConfigurationsOperations( diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/__init__.py index 66806b08a5b0..5e35abaa7759 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/__init__.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/__init__.py @@ -22,6 +22,7 @@ from .server_for_create_py3 import ServerForCreate from .server_update_parameters_py3 import ServerUpdateParameters from .firewall_rule_py3 import FirewallRule + from .virtual_network_rule_py3 import VirtualNetworkRule from .database_py3 import Database from .configuration_py3 import Configuration from .operation_display_py3 import OperationDisplay @@ -46,6 +47,7 @@ from .server_for_create import ServerForCreate from .server_update_parameters import ServerUpdateParameters from .firewall_rule import FirewallRule + from .virtual_network_rule import VirtualNetworkRule from .database import Database from .configuration import Configuration from .operation_display import OperationDisplay @@ -59,6 +61,7 @@ from .server_security_alert_policy import ServerSecurityAlertPolicy from .server_paged import ServerPaged from .firewall_rule_paged import FirewallRulePaged +from .virtual_network_rule_paged import VirtualNetworkRulePaged from .database_paged import DatabasePaged from .configuration_paged import ConfigurationPaged from .log_file_paged import LogFilePaged @@ -69,6 +72,7 @@ ServerState, GeoRedundantBackup, SkuTier, + VirtualNetworkRuleState, OperationOrigin, ServerSecurityAlertPolicyState, ) @@ -86,6 +90,7 @@ 'ServerForCreate', 'ServerUpdateParameters', 'FirewallRule', + 'VirtualNetworkRule', 'Database', 'Configuration', 'OperationDisplay', @@ -99,6 +104,7 @@ 'ServerSecurityAlertPolicy', 'ServerPaged', 'FirewallRulePaged', + 'VirtualNetworkRulePaged', 'DatabasePaged', 'ConfigurationPaged', 'LogFilePaged', @@ -108,6 +114,7 @@ 'ServerState', 'GeoRedundantBackup', 'SkuTier', + 'VirtualNetworkRuleState', 'OperationOrigin', 'ServerSecurityAlertPolicyState', ] 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 index 5be37af621e5..9ee8ed1ee785 100644 --- 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 @@ -44,6 +44,15 @@ class SkuTier(str, Enum): memory_optimized = "MemoryOptimized" +class VirtualNetworkRuleState(str, Enum): + + initializing = "Initializing" + in_progress = "InProgress" + ready = "Ready" + deleting = "Deleting" + unknown = "Unknown" + + class OperationOrigin(str, Enum): not_specified = "NotSpecified" diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/virtual_network_rule.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/virtual_network_rule.py new file mode 100644 index 000000000000..8746b864bbd7 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/virtual_network_rule.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class VirtualNetworkRule(ProxyResource): + """A virtual network rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + 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 virtual_network_subnet_id: Required. The ARM resource id of the + virtual network subnet. + :type virtual_network_subnet_id: str + :param ignore_missing_vnet_service_endpoint: Create firewall rule before + the virtual network has vnet service endpoint enabled. + :type ignore_missing_vnet_service_endpoint: bool + :ivar state: Virtual Network Rule State. Possible values include: + 'Initializing', 'InProgress', 'Ready', 'Deleting', 'Unknown' + :vartype state: str or + ~azure.mgmt.rdbms.mariadb.models.VirtualNetworkRuleState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_subnet_id': {'required': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'virtual_network_subnet_id': {'key': 'properties.virtualNetworkSubnetId', 'type': 'str'}, + 'ignore_missing_vnet_service_endpoint': {'key': 'properties.ignoreMissingVnetServiceEndpoint', 'type': 'bool'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_subnet_id = kwargs.get('virtual_network_subnet_id', None) + self.ignore_missing_vnet_service_endpoint = kwargs.get('ignore_missing_vnet_service_endpoint', None) + self.state = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/virtual_network_rule_paged.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/virtual_network_rule_paged.py new file mode 100644 index 000000000000..c590c551cebe --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/virtual_network_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 VirtualNetworkRulePaged(Paged): + """ + A paging container for iterating over a list of :class:`VirtualNetworkRule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[VirtualNetworkRule]'} + } + + def __init__(self, *args, **kwargs): + + super(VirtualNetworkRulePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/virtual_network_rule_py3.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/virtual_network_rule_py3.py new file mode 100644 index 000000000000..5cf92b6b2928 --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/models/virtual_network_rule_py3.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license 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 VirtualNetworkRule(ProxyResource): + """A virtual network 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 virtual_network_subnet_id: Required. The ARM resource id of the + virtual network subnet. + :type virtual_network_subnet_id: str + :param ignore_missing_vnet_service_endpoint: Create firewall rule before + the virtual network has vnet service endpoint enabled. + :type ignore_missing_vnet_service_endpoint: bool + :ivar state: Virtual Network Rule State. Possible values include: + 'Initializing', 'InProgress', 'Ready', 'Deleting', 'Unknown' + :vartype state: str or + ~azure.mgmt.rdbms.mariadb.models.VirtualNetworkRuleState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_network_subnet_id': {'required': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'virtual_network_subnet_id': {'key': 'properties.virtualNetworkSubnetId', 'type': 'str'}, + 'ignore_missing_vnet_service_endpoint': {'key': 'properties.ignoreMissingVnetServiceEndpoint', 'type': 'bool'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, *, virtual_network_subnet_id: str, ignore_missing_vnet_service_endpoint: bool=None, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_subnet_id = virtual_network_subnet_id + self.ignore_missing_vnet_service_endpoint = ignore_missing_vnet_service_endpoint + self.state = None diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/__init__.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/__init__.py index 8da462eefd31..27ac2e7b90d4 100644 --- a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/__init__.py +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/__init__.py @@ -11,6 +11,7 @@ from .servers_operations import ServersOperations from .firewall_rules_operations import FirewallRulesOperations +from .virtual_network_rules_operations import VirtualNetworkRulesOperations from .databases_operations import DatabasesOperations from .configurations_operations import ConfigurationsOperations from .log_files_operations import LogFilesOperations @@ -22,6 +23,7 @@ __all__ = [ 'ServersOperations', 'FirewallRulesOperations', + 'VirtualNetworkRulesOperations', 'DatabasesOperations', 'ConfigurationsOperations', 'LogFilesOperations', diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/virtual_network_rules_operations.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/virtual_network_rules_operations.py new file mode 100644 index 000000000000..39d78278bb8a --- /dev/null +++ b/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/operations/virtual_network_rules_operations.py @@ -0,0 +1,382 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# 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 VirtualNetworkRulesOperations(object): + """VirtualNetworkRulesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An 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 get( + self, resource_group_name, server_name, virtual_network_rule_name, custom_headers=None, raw=False, **operation_config): + """Gets a virtual network rule. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param virtual_network_rule_name: The name of the virtual network + rule. + :type virtual_network_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: VirtualNetworkRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.rdbms.mariadb.models.VirtualNetworkRule 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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'virtualNetworkRuleName': self._serialize.url("virtual_network_rule_name", virtual_network_rule_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['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('VirtualNetworkRule', 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}/virtualNetworkRules/{virtualNetworkRuleName}'} + + + def _create_or_update_initial( + self, resource_group_name, server_name, virtual_network_rule_name, virtual_network_subnet_id, ignore_missing_vnet_service_endpoint=None, custom_headers=None, raw=False, **operation_config): + parameters = models.VirtualNetworkRule(virtual_network_subnet_id=virtual_network_subnet_id, ignore_missing_vnet_service_endpoint=ignore_missing_vnet_service_endpoint) + + # 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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'virtualNetworkRuleName': self._serialize.url("virtual_network_rule_name", virtual_network_rule_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['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, 'VirtualNetworkRule') + + # 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('VirtualNetworkRule', response) + if response.status_code == 201: + deserialized = self._deserialize('VirtualNetworkRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, server_name, virtual_network_rule_name, virtual_network_subnet_id, ignore_missing_vnet_service_endpoint=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates an existing virtual network rule. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param virtual_network_rule_name: The name of the virtual network + rule. + :type virtual_network_rule_name: str + :param virtual_network_subnet_id: The ARM resource id of the virtual + network subnet. + :type virtual_network_subnet_id: str + :param ignore_missing_vnet_service_endpoint: Create firewall rule + before the virtual network has vnet service endpoint enabled. + :type ignore_missing_vnet_service_endpoint: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: 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 VirtualNetworkRule or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mariadb.models.VirtualNetworkRule] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.rdbms.mariadb.models.VirtualNetworkRule]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + virtual_network_rule_name=virtual_network_rule_name, + virtual_network_subnet_id=virtual_network_subnet_id, + ignore_missing_vnet_service_endpoint=ignore_missing_vnet_service_endpoint, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('VirtualNetworkRule', 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}/virtualNetworkRules/{virtualNetworkRuleName}'} + + + def _delete_initial( + self, resource_group_name, server_name, virtual_network_rule_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'virtualNetworkRuleName': self._serialize.url("virtual_network_rule_name", virtual_network_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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, virtual_network_rule_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the virtual network rule with the given name. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param virtual_network_rule_name: The name of the virtual network + rule. + :type virtual_network_rule_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: 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, + virtual_network_rule_name=virtual_network_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}/virtualNetworkRules/{virtualNetworkRuleName}'} + + def list_by_server( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of virtual network rules in a server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of VirtualNetworkRule + :rtype: + ~azure.mgmt.rdbms.mariadb.models.VirtualNetworkRulePaged[~azure.mgmt.rdbms.mariadb.models.VirtualNetworkRule] + :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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['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.VirtualNetworkRulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VirtualNetworkRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/virtualNetworkRules'} diff --git a/azure-mgmt-rdbms/azure/mgmt/rdbms/version.py b/azure-mgmt-rdbms/azure/mgmt/rdbms/version.py index 2f41fc5a7c37..a4fc40fc9049 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.4.1" +VERSION = "1.5.0"