From 68bc937cbb588d8393feca65b47bd70d69f433c2 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 25 Jun 2021 03:34:00 +0000 Subject: [PATCH] CodeGen from PR 14985 in Azure/azure-rest-api-specs Merge cc86dfdd4149ee0752143dc2e9f7738263191ddd into 8dff86df71bee429af84ea4713288ef3cdd1db2f --- sdk/rdbms/azure-mgmt-rdbms/_meta.json | 8 +- .../_configuration.py | 1 + .../postgresql_flexibleservers/_metadata.json | 4 +- .../_postgre_sql_management_client.py | 18 +- .../postgresql_flexibleservers/_version.py | 2 +- .../aio/_configuration.py | 1 + .../aio/_postgre_sql_management_client.py | 18 +- .../_check_name_availability_operations.py | 10 +- .../operations/_configurations_operations.py | 169 ++++- .../aio/operations/_databases_operations.py | 50 +- .../operations/_firewall_rules_operations.py | 50 +- ..._get_private_dns_zone_suffix_operations.py | 24 +- ..._location_based_capabilities_operations.py | 8 +- .../aio/operations/_operations.py | 8 +- .../aio/operations/_servers_operations.py | 131 ++-- ...virtual_network_subnet_usage_operations.py | 10 +- .../models/__init__.py | 51 +- .../models/_models.py | 659 +++++++++++----- .../models/_models_py3.py | 706 ++++++++++++------ .../_postgre_sql_management_client_enums.py | 34 +- .../_check_name_availability_operations.py | 8 +- .../operations/_configurations_operations.py | 163 +++- .../operations/_databases_operations.py | 38 +- .../operations/_firewall_rules_operations.py | 38 +- ..._get_private_dns_zone_suffix_operations.py | 22 +- ..._location_based_capabilities_operations.py | 6 +- .../operations/_operations.py | 6 +- .../operations/_servers_operations.py | 101 +-- ...virtual_network_subnet_usage_operations.py | 8 +- 29 files changed, 1587 insertions(+), 765 deletions(-) diff --git a/sdk/rdbms/azure-mgmt-rdbms/_meta.json b/sdk/rdbms/azure-mgmt-rdbms/_meta.json index dfe36a6bd651..7e7844589c32 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/_meta.json +++ b/sdk/rdbms/azure-mgmt-rdbms/_meta.json @@ -1,11 +1,11 @@ { "autorest": "3.4.2", "use": [ - "@autorest/python@5.8.0", + "@autorest/python@5.8.1", "@autorest/modelerfour@4.19.2" ], - "commit": "5b141b3de81d3a38ee2406e1a9db5a9ecd08ff7d", + "commit": "4ff6a4d00615eb83fa840b6135391f1a86d9b725", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/mariadb/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.0 --use=@autorest/modelerfour@4.19.2 --version=3.4.2", - "readme": "specification/mariadb/resource-manager/readme.md" + "autorest_command": "autorest specification/postgresql/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.1 --use=@autorest/modelerfour@4.19.2 --version=3.4.2", + "readme": "specification/postgresql/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_configuration.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_configuration.py index ba1985981030..1c9f11b8401f 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_configuration.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_configuration.py @@ -48,6 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id + self.api_version = "2021-06-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-rdbms/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_metadata.json b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_metadata.json index bd177b54ed26..a47132ec89b1 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_metadata.json +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_metadata.json @@ -1,6 +1,6 @@ { - "chosen_version": "", - "total_api_version_list": ["2020-02-14-preview", "2020-11-05-preview", "2021-03-31-privatepreview"], + "chosen_version": "2021-06-01", + "total_api_version_list": ["2021-06-01"], "client": { "name": "PostgreSQLManagementClient", "filename": "_postgre_sql_management_client", diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_postgre_sql_management_client.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_postgre_sql_management_client.py index 0ff330675ab9..d56582a0d19b 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_postgre_sql_management_client.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_postgre_sql_management_client.py @@ -35,23 +35,23 @@ class PostgreSQLManagementClient(object): """The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model. :ivar servers: ServersOperations operations - :vartype servers: azure.mgmt.rdbms.postgresql_flexibleservers.operations.ServersOperations + :vartype servers: postgre_sql_management_client.operations.ServersOperations :ivar firewall_rules: FirewallRulesOperations operations - :vartype firewall_rules: azure.mgmt.rdbms.postgresql_flexibleservers.operations.FirewallRulesOperations + :vartype firewall_rules: postgre_sql_management_client.operations.FirewallRulesOperations :ivar configurations: ConfigurationsOperations operations - :vartype configurations: azure.mgmt.rdbms.postgresql_flexibleservers.operations.ConfigurationsOperations + :vartype configurations: postgre_sql_management_client.operations.ConfigurationsOperations :ivar check_name_availability: CheckNameAvailabilityOperations operations - :vartype check_name_availability: azure.mgmt.rdbms.postgresql_flexibleservers.operations.CheckNameAvailabilityOperations + :vartype check_name_availability: postgre_sql_management_client.operations.CheckNameAvailabilityOperations :ivar location_based_capabilities: LocationBasedCapabilitiesOperations operations - :vartype location_based_capabilities: azure.mgmt.rdbms.postgresql_flexibleservers.operations.LocationBasedCapabilitiesOperations + :vartype location_based_capabilities: postgre_sql_management_client.operations.LocationBasedCapabilitiesOperations :ivar virtual_network_subnet_usage: VirtualNetworkSubnetUsageOperations operations - :vartype virtual_network_subnet_usage: azure.mgmt.rdbms.postgresql_flexibleservers.operations.VirtualNetworkSubnetUsageOperations + :vartype virtual_network_subnet_usage: postgre_sql_management_client.operations.VirtualNetworkSubnetUsageOperations :ivar operations: Operations operations - :vartype operations: azure.mgmt.rdbms.postgresql_flexibleservers.operations.Operations + :vartype operations: postgre_sql_management_client.operations.Operations :ivar databases: DatabasesOperations operations - :vartype databases: azure.mgmt.rdbms.postgresql_flexibleservers.operations.DatabasesOperations + :vartype databases: postgre_sql_management_client.operations.DatabasesOperations :ivar get_private_dns_zone_suffix: GetPrivateDnsZoneSuffixOperations operations - :vartype get_private_dns_zone_suffix: azure.mgmt.rdbms.postgresql_flexibleservers.operations.GetPrivateDnsZoneSuffixOperations + :vartype get_private_dns_zone_suffix: postgre_sql_management_client.operations.GetPrivateDnsZoneSuffixOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_version.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_version.py index 920456322fa1..e5754a47ce68 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_version.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "8.1.0" +VERSION = "1.0.0b1" diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/_configuration.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/_configuration.py index cb0ff2719be3..9fb42d0b1fc3 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/_configuration.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/_configuration.py @@ -45,6 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id + self.api_version = "2021-06-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-rdbms/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/_postgre_sql_management_client.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/_postgre_sql_management_client.py index fa66d8f5af29..c11cccb22b61 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/_postgre_sql_management_client.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/_postgre_sql_management_client.py @@ -33,23 +33,23 @@ class PostgreSQLManagementClient(object): """The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model. :ivar servers: ServersOperations operations - :vartype servers: azure.mgmt.rdbms.postgresql_flexibleservers.aio.operations.ServersOperations + :vartype servers: postgre_sql_management_client.aio.operations.ServersOperations :ivar firewall_rules: FirewallRulesOperations operations - :vartype firewall_rules: azure.mgmt.rdbms.postgresql_flexibleservers.aio.operations.FirewallRulesOperations + :vartype firewall_rules: postgre_sql_management_client.aio.operations.FirewallRulesOperations :ivar configurations: ConfigurationsOperations operations - :vartype configurations: azure.mgmt.rdbms.postgresql_flexibleservers.aio.operations.ConfigurationsOperations + :vartype configurations: postgre_sql_management_client.aio.operations.ConfigurationsOperations :ivar check_name_availability: CheckNameAvailabilityOperations operations - :vartype check_name_availability: azure.mgmt.rdbms.postgresql_flexibleservers.aio.operations.CheckNameAvailabilityOperations + :vartype check_name_availability: postgre_sql_management_client.aio.operations.CheckNameAvailabilityOperations :ivar location_based_capabilities: LocationBasedCapabilitiesOperations operations - :vartype location_based_capabilities: azure.mgmt.rdbms.postgresql_flexibleservers.aio.operations.LocationBasedCapabilitiesOperations + :vartype location_based_capabilities: postgre_sql_management_client.aio.operations.LocationBasedCapabilitiesOperations :ivar virtual_network_subnet_usage: VirtualNetworkSubnetUsageOperations operations - :vartype virtual_network_subnet_usage: azure.mgmt.rdbms.postgresql_flexibleservers.aio.operations.VirtualNetworkSubnetUsageOperations + :vartype virtual_network_subnet_usage: postgre_sql_management_client.aio.operations.VirtualNetworkSubnetUsageOperations :ivar operations: Operations operations - :vartype operations: azure.mgmt.rdbms.postgresql_flexibleservers.aio.operations.Operations + :vartype operations: postgre_sql_management_client.aio.operations.Operations :ivar databases: DatabasesOperations operations - :vartype databases: azure.mgmt.rdbms.postgresql_flexibleservers.aio.operations.DatabasesOperations + :vartype databases: postgre_sql_management_client.aio.operations.DatabasesOperations :ivar get_private_dns_zone_suffix: GetPrivateDnsZoneSuffixOperations operations - :vartype get_private_dns_zone_suffix: azure.mgmt.rdbms.postgresql_flexibleservers.aio.operations.GetPrivateDnsZoneSuffixOperations + :vartype get_private_dns_zone_suffix: postgre_sql_management_client.aio.operations.GetPrivateDnsZoneSuffixOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_check_name_availability_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_check_name_availability_operations.py index 8a508a3c317a..50ddf31eb075 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_check_name_availability_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_check_name_availability_operations.py @@ -25,7 +25,7 @@ class CheckNameAvailabilityOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.rdbms.postgresql_flexibleservers.models + :type models: ~postgre_sql_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -43,16 +43,16 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def execute( self, name_availability_request: "_models.NameAvailabilityRequest", - **kwargs + **kwargs: Any ) -> "_models.NameAvailability": """Check the availability of name for resource. :param name_availability_request: The required parameters for checking if resource name is available. - :type name_availability_request: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.NameAvailabilityRequest + :type name_availability_request: ~postgre_sql_management_client.models.NameAvailabilityRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability, or the result of cls(response) - :rtype: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.NameAvailability + :rtype: ~postgre_sql_management_client.models.NameAvailability :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NameAvailability"] @@ -60,7 +60,7 @@ async def execute( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_configurations_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_configurations_operations.py index c498e468e01c..089034bf42ba 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_configurations_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_configurations_operations.py @@ -28,7 +28,7 @@ class ConfigurationsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.rdbms.postgresql_flexibleservers.models + :type models: ~postgre_sql_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -47,7 +47,7 @@ def list_by_server( self, resource_group_name: str, server_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ConfigurationListResult"]: """List all the configurations in a given server. @@ -57,7 +57,7 @@ def list_by_server( :type server_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.rdbms.postgresql_flexibleservers.models.ConfigurationListResult] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~postgre_sql_management_client.models.ConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationListResult"] @@ -65,7 +65,7 @@ def list_by_server( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -78,7 +78,7 @@ def prepare_request(next_link=None): url = self.list_by_server.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -122,7 +122,7 @@ async def get( resource_group_name: str, server_name: str, configuration_name: str, - **kwargs + **kwargs: Any ) -> "_models.Configuration": """Gets information about a configuration of server. @@ -134,7 +134,7 @@ async def get( :type configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Configuration, or the result of cls(response) - :rtype: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Configuration + :rtype: ~postgre_sql_management_client.models.Configuration :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Configuration"] @@ -142,14 +142,14 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), } @@ -185,14 +185,14 @@ async def _update_initial( server_name: str, configuration_name: str, parameters: "_models.Configuration", - **kwargs + **kwargs: Any ) -> Optional["_models.Configuration"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Configuration"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -200,7 +200,7 @@ async def _update_initial( url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), } @@ -242,7 +242,7 @@ async def begin_update( server_name: str, configuration_name: str, parameters: "_models.Configuration", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.Configuration"]: """Updates a configuration of a server. @@ -253,15 +253,15 @@ async def begin_update( :param configuration_name: The name of the server configuration. :type configuration_name: str :param parameters: The required parameters for updating a server configuration. - :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Configuration + :type parameters: ~postgre_sql_management_client.models.Configuration :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either Configuration or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.rdbms.postgresql_flexibleservers.models.Configuration] + :rtype: ~azure.core.polling.AsyncLROPoller[~postgre_sql_management_client.models.Configuration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -293,7 +293,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), } @@ -311,3 +311,136 @@ def get_long_running_output(pipeline_response): else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/flexibleServers/{serverName}/configurations/{configurationName}'} # type: ignore + + async def _put_initial( + self, + resource_group_name: str, + server_name: str, + configuration_name: str, + parameters: "_models.Configuration", + **kwargs: Any + ) -> Optional["_models.Configuration"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Configuration"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._put_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + '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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Configuration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Configuration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _put_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/flexibleServers/{serverName}/configurations/{configurationName}'} # type: ignore + + async def begin_put( + self, + resource_group_name: str, + server_name: str, + configuration_name: str, + parameters: "_models.Configuration", + **kwargs: Any + ) -> AsyncLROPoller["_models.Configuration"]: + """Updates a configuration of a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :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 parameters: The required parameters for updating a server configuration. + :type parameters: ~postgre_sql_management_client.models.Configuration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Configuration or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~postgre_sql_management_client.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Configuration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_initial( + resource_group_name=resource_group_name, + server_name=server_name, + configuration_name=configuration_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Configuration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/flexibleServers/{serverName}/configurations/{configurationName}'} # type: ignore diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_databases_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_databases_operations.py index 83e3da04d926..8878ed373d23 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_databases_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_databases_operations.py @@ -28,7 +28,7 @@ class DatabasesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.rdbms.postgresql_flexibleservers.models + :type models: ~postgre_sql_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -49,14 +49,14 @@ async def _create_initial( server_name: str, database_name: str, parameters: "_models.Database", - **kwargs + **kwargs: Any ) -> Optional["_models.Database"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Database"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-05-preview" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -64,7 +64,7 @@ async def _create_initial( url = self._create_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), } @@ -109,7 +109,7 @@ async def begin_create( server_name: str, database_name: str, parameters: "_models.Database", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.Database"]: """Creates a new database or updates an existing database. @@ -120,15 +120,15 @@ async def begin_create( :param database_name: The name of the database. :type database_name: str :param parameters: The required parameters for creating or updating a database. - :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Database + :type parameters: ~postgre_sql_management_client.models.Database :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either Database or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.rdbms.postgresql_flexibleservers.models.Database] + :rtype: ~azure.core.polling.AsyncLROPoller[~postgre_sql_management_client.models.Database] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -160,7 +160,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), } @@ -184,21 +184,21 @@ async def _delete_initial( resource_group_name: str, server_name: str, database_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-05-preview" + api_version = "2021-06-01" accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), } @@ -230,7 +230,7 @@ async def begin_delete( resource_group_name: str, server_name: str, database_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a database. @@ -242,8 +242,8 @@ async def begin_delete( :type database_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -275,7 +275,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), } @@ -299,7 +299,7 @@ async def get( resource_group_name: str, server_name: str, database_name: str, - **kwargs + **kwargs: Any ) -> "_models.Database": """Gets information about a database. @@ -311,7 +311,7 @@ async def get( :type database_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Database, or the result of cls(response) - :rtype: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Database + :rtype: ~postgre_sql_management_client.models.Database :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Database"] @@ -319,14 +319,14 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-05-preview" + api_version = "2021-06-01" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), } @@ -360,7 +360,7 @@ def list_by_server( self, resource_group_name: str, server_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.DatabaseListResult"]: """List all the databases in a given server. @@ -370,7 +370,7 @@ def list_by_server( :type server_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatabaseListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.rdbms.postgresql_flexibleservers.models.DatabaseListResult] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~postgre_sql_management_client.models.DatabaseListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseListResult"] @@ -378,7 +378,7 @@ def list_by_server( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-05-preview" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -391,7 +391,7 @@ def prepare_request(next_link=None): url = self.list_by_server.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_firewall_rules_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_firewall_rules_operations.py index 24a661b19127..3490786e27cb 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_firewall_rules_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_firewall_rules_operations.py @@ -28,7 +28,7 @@ class FirewallRulesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.rdbms.postgresql_flexibleservers.models + :type models: ~postgre_sql_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -49,14 +49,14 @@ async def _create_or_update_initial( server_name: str, firewall_rule_name: str, parameters: "_models.FirewallRule", - **kwargs + **kwargs: Any ) -> Optional["_models.FirewallRule"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.FirewallRule"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -64,7 +64,7 @@ async def _create_or_update_initial( url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str'), } @@ -109,7 +109,7 @@ async def begin_create_or_update( server_name: str, firewall_rule_name: str, parameters: "_models.FirewallRule", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.FirewallRule"]: """Creates a new firewall rule or updates an existing firewall rule. @@ -120,15 +120,15 @@ async def begin_create_or_update( :param firewall_rule_name: The name of the server firewall rule. :type firewall_rule_name: str :param parameters: The required parameters for creating or updating a firewall rule. - :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.FirewallRule + :type parameters: ~postgre_sql_management_client.models.FirewallRule :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either FirewallRule or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.rdbms.postgresql_flexibleservers.models.FirewallRule] + :rtype: ~azure.core.polling.AsyncLROPoller[~postgre_sql_management_client.models.FirewallRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -160,7 +160,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str'), } @@ -184,21 +184,21 @@ async def _delete_initial( resource_group_name: str, server_name: str, firewall_rule_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str'), } @@ -230,7 +230,7 @@ async def begin_delete( resource_group_name: str, server_name: str, firewall_rule_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a PostgreSQL server firewall rule. @@ -242,8 +242,8 @@ async def begin_delete( :type firewall_rule_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -275,7 +275,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str'), } @@ -299,7 +299,7 @@ async def get( resource_group_name: str, server_name: str, firewall_rule_name: str, - **kwargs + **kwargs: Any ) -> "_models.FirewallRule": """List all the firewall rules in a given server. @@ -311,7 +311,7 @@ async def get( :type firewall_rule_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: FirewallRule, or the result of cls(response) - :rtype: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.FirewallRule + :rtype: ~postgre_sql_management_client.models.FirewallRule :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallRule"] @@ -319,14 +319,14 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str'), } @@ -360,7 +360,7 @@ def list_by_server( self, resource_group_name: str, server_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.FirewallRuleListResult"]: """List all the firewall rules in a given PostgreSQL server. @@ -370,7 +370,7 @@ def list_by_server( :type server_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either FirewallRuleListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.rdbms.postgresql_flexibleservers.models.FirewallRuleListResult] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~postgre_sql_management_client.models.FirewallRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallRuleListResult"] @@ -378,7 +378,7 @@ def list_by_server( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -391,7 +391,7 @@ def prepare_request(next_link=None): url = self.list_by_server.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_get_private_dns_zone_suffix_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_get_private_dns_zone_suffix_operations.py index f0b6fc7141a1..5a879b70f9b3 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_get_private_dns_zone_suffix_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_get_private_dns_zone_suffix_operations.py @@ -5,7 +5,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -25,7 +25,7 @@ class GetPrivateDnsZoneSuffixOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.rdbms.postgresql_flexibleservers.models + :type models: ~postgre_sql_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -42,13 +42,10 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def execute( self, - body: Union[str, "_models.Enum8"], - **kwargs + **kwargs: Any ) -> str: """Get private DNS zone suffix in the cloud. - :param body: The required parameters for getting private DNS zone suffix based on server type. - :type body: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Enum8 :keyword callable cls: A custom type or function that will be passed the direct response :return: str, or the result of cls(response) :rtype: str @@ -59,16 +56,11 @@ async def execute( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-31-privatepreview" - content_type = kwargs.pop("content_type", "application/json") + api_version = "2021-06-01" accept = "application/json" # Construct URL url = self.execute.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] @@ -76,13 +68,9 @@ async def execute( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(body, 'str') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + request = self._client.post(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -96,4 +84,4 @@ async def execute( return cls(pipeline_response, deserialized, {}) return deserialized - execute.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DBForPostgreSql/getPrivateDnsZoneSuffix'} # type: ignore + execute.metadata = {'url': '/providers/Microsoft.DBForPostgreSql/getPrivateDnsZoneSuffix'} # type: ignore diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_location_based_capabilities_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_location_based_capabilities_operations.py index 3d6c9e41554f..c2ca0c38a855 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_location_based_capabilities_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_location_based_capabilities_operations.py @@ -26,7 +26,7 @@ class LocationBasedCapabilitiesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.rdbms.postgresql_flexibleservers.models + :type models: ~postgre_sql_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def execute( self, location_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.CapabilitiesListResult"]: """Get capabilities at specified location in a given subscription. @@ -52,7 +52,7 @@ def execute( :type location_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CapabilitiesListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.rdbms.postgresql_flexibleservers.models.CapabilitiesListResult] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~postgre_sql_management_client.models.CapabilitiesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CapabilitiesListResult"] @@ -60,7 +60,7 @@ def execute( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_operations.py index 823666cce7f0..02ba6c65ff05 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_operations.py @@ -25,7 +25,7 @@ class Operations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.rdbms.postgresql_flexibleservers.models + :type models: ~postgre_sql_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -42,13 +42,13 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list( self, - **kwargs + **kwargs: Any ) -> "_models.OperationListResult": """Lists all of the available REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: OperationListResult, or the result of cls(response) - :rtype: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.OperationListResult + :rtype: ~postgre_sql_management_client.models.OperationListResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -56,7 +56,7 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" # Construct URL diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_servers_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_servers_operations.py index 7213f93c472c..42e56c814bf3 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_servers_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_servers_operations.py @@ -28,7 +28,7 @@ class ServersOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.rdbms.postgresql_flexibleservers.models + :type models: ~postgre_sql_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -48,14 +48,14 @@ async def _create_initial( resource_group_name: str, server_name: str, parameters: "_models.Server", - **kwargs + **kwargs: Any ) -> Optional["_models.Server"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Server"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -63,7 +63,7 @@ async def _create_initial( url = self._create_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -106,7 +106,7 @@ async def begin_create( resource_group_name: str, server_name: str, parameters: "_models.Server", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.Server"]: """Creates a new server. @@ -115,15 +115,15 @@ async def begin_create( :param server_name: The name of the server. :type server_name: str :param parameters: The required parameters for creating or updating a server. - :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Server + :type parameters: ~postgre_sql_management_client.models.Server :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either Server or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.rdbms.postgresql_flexibleservers.models.Server] + :rtype: ~azure.core.polling.AsyncLROPoller[~postgre_sql_management_client.models.Server] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -154,7 +154,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } @@ -177,14 +177,14 @@ async def _update_initial( resource_group_name: str, server_name: str, parameters: "_models.ServerForUpdate", - **kwargs + **kwargs: Any ) -> Optional["_models.Server"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Server"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -192,7 +192,7 @@ async def _update_initial( url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -232,7 +232,7 @@ async def begin_update( resource_group_name: str, server_name: str, parameters: "_models.ServerForUpdate", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.Server"]: """Updates an existing server. The request body can contain one to many of the properties present in the normal server definition. @@ -242,15 +242,15 @@ async def begin_update( :param server_name: The name of the server. :type server_name: str :param parameters: The required parameters for updating a server. - :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerForUpdate + :type parameters: ~postgre_sql_management_client.models.ServerForUpdate :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either Server or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.rdbms.postgresql_flexibleservers.models.Server] + :rtype: ~azure.core.polling.AsyncLROPoller[~postgre_sql_management_client.models.Server] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -281,7 +281,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } @@ -303,21 +303,21 @@ async def _delete_initial( self, resource_group_name: str, server_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -347,7 +347,7 @@ async def begin_delete( self, resource_group_name: str, server_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a server. @@ -357,8 +357,8 @@ async def begin_delete( :type server_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -389,7 +389,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } @@ -411,7 +411,7 @@ async def get( self, resource_group_name: str, server_name: str, - **kwargs + **kwargs: Any ) -> "_models.Server": """Gets information about a server. @@ -421,7 +421,7 @@ async def get( :type server_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Server, or the result of cls(response) - :rtype: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Server + :rtype: ~postgre_sql_management_client.models.Server :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Server"] @@ -429,14 +429,14 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -468,7 +468,7 @@ async def get( def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ServerListResult"]: """List all the servers in a given resource group. @@ -476,7 +476,7 @@ def list_by_resource_group( :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServerListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerListResult] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~postgre_sql_management_client.models.ServerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerListResult"] @@ -484,7 +484,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -497,7 +497,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -537,13 +537,13 @@ async def get_next(next_link=None): def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ServerListResult"]: """List all the servers in a given subscription. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServerListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerListResult] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~postgre_sql_management_client.models.ServerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerListResult"] @@ -551,7 +551,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -605,21 +605,23 @@ async def _restart_initial( self, resource_group_name: str, server_name: str, - **kwargs + parameters: Optional["_models.RestartParameter"] = None, + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -630,9 +632,16 @@ async def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.post(url, query_parameters, header_parameters) + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'RestartParameter') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -649,7 +658,8 @@ async def begin_restart( self, resource_group_name: str, server_name: str, - **kwargs + parameters: Optional["_models.RestartParameter"] = None, + **kwargs: Any ) -> AsyncLROPoller[None]: """Restarts a server. @@ -657,10 +667,12 @@ async def begin_restart( :type resource_group_name: str :param server_name: The name of the server. :type server_name: str + :param parameters: The parameters for restarting a server. + :type parameters: ~postgre_sql_management_client.models.RestartParameter :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -678,6 +690,7 @@ async def begin_restart( raw_result = await self._restart_initial( resource_group_name=resource_group_name, server_name=server_name, + parameters=parameters, cls=lambda x,y,z: x, **kwargs ) @@ -691,7 +704,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } @@ -713,21 +726,21 @@ async def _start_initial( self, resource_group_name: str, server_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -757,7 +770,7 @@ async def begin_start( self, resource_group_name: str, server_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Starts a server. @@ -767,8 +780,8 @@ async def begin_start( :type server_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -799,7 +812,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } @@ -821,21 +834,21 @@ async def _stop_initial( self, resource_group_name: str, server_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" # Construct URL url = self._stop_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -865,7 +878,7 @@ async def begin_stop( self, resource_group_name: str, server_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Stops a server. @@ -875,8 +888,8 @@ async def begin_stop( :type server_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -907,7 +920,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_virtual_network_subnet_usage_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_virtual_network_subnet_usage_operations.py index 69b1e0b13b17..aba922a4432e 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_virtual_network_subnet_usage_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_virtual_network_subnet_usage_operations.py @@ -25,7 +25,7 @@ class VirtualNetworkSubnetUsageOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.rdbms.postgresql_flexibleservers.models + :type models: ~postgre_sql_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -44,17 +44,17 @@ async def execute( self, location_name: str, parameters: "_models.VirtualNetworkSubnetUsageParameter", - **kwargs + **kwargs: Any ) -> "_models.VirtualNetworkSubnetUsageResult": """Get virtual network subnet usage for a given vNet resource id. :param location_name: The name of the location. :type location_name: str :param parameters: The required parameters for creating or updating a server. - :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.VirtualNetworkSubnetUsageParameter + :type parameters: ~postgre_sql_management_client.models.VirtualNetworkSubnetUsageParameter :keyword callable cls: A custom type or function that will be passed the direct response :return: VirtualNetworkSubnetUsageResult, or the result of cls(response) - :rtype: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.VirtualNetworkSubnetUsageResult + :rtype: ~postgre_sql_management_client.models.VirtualNetworkSubnetUsageResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkSubnetUsageResult"] @@ -62,7 +62,7 @@ async def execute( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/__init__.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/__init__.py index dcd6b080799e..1cd0378a581b 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/__init__.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/__init__.py @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import Backup from ._models_py3 import CapabilitiesListResult from ._models_py3 import CapabilityProperties from ._models_py3 import Configuration @@ -18,31 +19,36 @@ from ._models_py3 import ErrorResponse from ._models_py3 import FirewallRule from ._models_py3 import FirewallRuleListResult + from ._models_py3 import FlexibleServerEditionCapability + from ._models_py3 import HighAvailability + from ._models_py3 import HyperscaleNodeEditionCapability from ._models_py3 import Identity from ._models_py3 import MaintenanceWindow from ._models_py3 import NameAvailability from ._models_py3 import NameAvailabilityRequest + from ._models_py3 import Network + from ._models_py3 import NodeTypeCapability from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationListResult from ._models_py3 import ProxyResource from ._models_py3 import Resource + from ._models_py3 import RestartParameter from ._models_py3 import Server - from ._models_py3 import ServerEditionCapability from ._models_py3 import ServerForUpdate from ._models_py3 import ServerListResult - from ._models_py3 import ServerPropertiesDelegatedSubnetArguments - from ._models_py3 import ServerPropertiesPrivateDnsZoneArguments from ._models_py3 import ServerVersionCapability from ._models_py3 import Sku + from ._models_py3 import Storage from ._models_py3 import StorageEditionCapability from ._models_py3 import StorageMBCapability - from ._models_py3 import StorageProfile + from ._models_py3 import SystemData from ._models_py3 import TrackedResource from ._models_py3 import VcoreCapability from ._models_py3 import VirtualNetworkSubnetUsageParameter from ._models_py3 import VirtualNetworkSubnetUsageResult except (SyntaxError, ImportError): + from ._models import Backup # type: ignore from ._models import CapabilitiesListResult # type: ignore from ._models import CapabilityProperties # type: ignore from ._models import Configuration # type: ignore @@ -54,26 +60,30 @@ from ._models import ErrorResponse # type: ignore from ._models import FirewallRule # type: ignore from ._models import FirewallRuleListResult # type: ignore + from ._models import FlexibleServerEditionCapability # type: ignore + from ._models import HighAvailability # type: ignore + from ._models import HyperscaleNodeEditionCapability # type: ignore from ._models import Identity # type: ignore from ._models import MaintenanceWindow # type: ignore from ._models import NameAvailability # type: ignore from ._models import NameAvailabilityRequest # type: ignore + from ._models import Network # type: ignore + from ._models import NodeTypeCapability # type: ignore from ._models import Operation # type: ignore from ._models import OperationDisplay # type: ignore from ._models import OperationListResult # type: ignore from ._models import ProxyResource # type: ignore from ._models import Resource # type: ignore + from ._models import RestartParameter # type: ignore from ._models import Server # type: ignore - from ._models import ServerEditionCapability # type: ignore from ._models import ServerForUpdate # type: ignore from ._models import ServerListResult # type: ignore - from ._models import ServerPropertiesDelegatedSubnetArguments # type: ignore - from ._models import ServerPropertiesPrivateDnsZoneArguments # type: ignore from ._models import ServerVersionCapability # type: ignore from ._models import Sku # type: ignore + from ._models import Storage # type: ignore from ._models import StorageEditionCapability # type: ignore from ._models import StorageMBCapability # type: ignore - from ._models import StorageProfile # type: ignore + from ._models import SystemData # type: ignore from ._models import TrackedResource # type: ignore from ._models import VcoreCapability # type: ignore from ._models import VirtualNetworkSubnetUsageParameter # type: ignore @@ -82,8 +92,10 @@ from ._postgre_sql_management_client_enums import ( ConfigurationDataType, CreateMode, - Enum8, - HAEnabledEnum, + CreateModeForUpdate, + CreatedByType, + GeoRedundantBackupEnum, + HighAvailabilityMode, OperationOrigin, ServerHAState, ServerPublicNetworkAccessState, @@ -93,6 +105,7 @@ ) __all__ = [ + 'Backup', 'CapabilitiesListResult', 'CapabilityProperties', 'Configuration', @@ -104,34 +117,40 @@ 'ErrorResponse', 'FirewallRule', 'FirewallRuleListResult', + 'FlexibleServerEditionCapability', + 'HighAvailability', + 'HyperscaleNodeEditionCapability', 'Identity', 'MaintenanceWindow', 'NameAvailability', 'NameAvailabilityRequest', + 'Network', + 'NodeTypeCapability', 'Operation', 'OperationDisplay', 'OperationListResult', 'ProxyResource', 'Resource', + 'RestartParameter', 'Server', - 'ServerEditionCapability', 'ServerForUpdate', 'ServerListResult', - 'ServerPropertiesDelegatedSubnetArguments', - 'ServerPropertiesPrivateDnsZoneArguments', 'ServerVersionCapability', 'Sku', + 'Storage', 'StorageEditionCapability', 'StorageMBCapability', - 'StorageProfile', + 'SystemData', 'TrackedResource', 'VcoreCapability', 'VirtualNetworkSubnetUsageParameter', 'VirtualNetworkSubnetUsageResult', 'ConfigurationDataType', 'CreateMode', - 'Enum8', - 'HAEnabledEnum', + 'CreateModeForUpdate', + 'CreatedByType', + 'GeoRedundantBackupEnum', + 'HighAvailabilityMode', 'OperationOrigin', 'ServerHAState', 'ServerPublicNetworkAccessState', diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_models.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_models.py index f9eedae1b825..e32b065d8bfb 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_models.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_models.py @@ -9,13 +9,47 @@ import msrest.serialization +class Backup(msrest.serialization.Model): + """Backup properties of a server. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param backup_retention_days: Backup retention days for the server. + :type backup_retention_days: int + :param geo_redundant_backup: A value indicating whether Geo-Redundant backup is enabled on the + server. Possible values include: "Enabled", "Disabled". + :type geo_redundant_backup: str or ~postgre_sql_management_client.models.GeoRedundantBackupEnum + :ivar earliest_restore_date: The earliest restore point time (ISO8601 format) for server. + :vartype earliest_restore_date: ~datetime.datetime + """ + + _validation = { + 'earliest_restore_date': {'readonly': True}, + } + + _attribute_map = { + 'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'}, + 'geo_redundant_backup': {'key': 'geoRedundantBackup', 'type': 'str'}, + 'earliest_restore_date': {'key': 'earliestRestoreDate', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(Backup, self).__init__(**kwargs) + self.backup_retention_days = kwargs.get('backup_retention_days', None) + self.geo_redundant_backup = kwargs.get('geo_redundant_backup', None) + self.earliest_restore_date = None + + class CapabilitiesListResult(msrest.serialization.Model): """location capability. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: A list of supported capabilities. - :vartype value: list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.CapabilityProperties] + :vartype value: list[~postgre_sql_management_client.models.CapabilityProperties] :ivar next_link: Link to retrieve next page of results. :vartype next_link: str """ @@ -46,19 +80,43 @@ class CapabilityProperties(msrest.serialization.Model): :ivar zone: zone name. :vartype zone: str + :ivar geo_backup_supported: A value indicating whether a new server in this region can have + geo-backups to paired region. + :vartype geo_backup_supported: bool + :ivar zone_redundant_ha_supported: A value indicating whether a new server in this region can + support multi zone HA. + :vartype zone_redundant_ha_supported: bool + :ivar zone_redundant_ha_and_geo_backup_supported: A value indicating whether a new server in + this region can have geo-backups to paired region. + :vartype zone_redundant_ha_and_geo_backup_supported: bool :ivar supported_flexible_server_editions: :vartype supported_flexible_server_editions: - list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerEditionCapability] + list[~postgre_sql_management_client.models.FlexibleServerEditionCapability] + :ivar supported_hyperscale_node_editions: + :vartype supported_hyperscale_node_editions: + list[~postgre_sql_management_client.models.HyperscaleNodeEditionCapability] + :ivar status: The status. + :vartype status: str """ _validation = { 'zone': {'readonly': True}, + 'geo_backup_supported': {'readonly': True}, + 'zone_redundant_ha_supported': {'readonly': True}, + 'zone_redundant_ha_and_geo_backup_supported': {'readonly': True}, 'supported_flexible_server_editions': {'readonly': True}, + 'supported_hyperscale_node_editions': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { 'zone': {'key': 'zone', 'type': 'str'}, - 'supported_flexible_server_editions': {'key': 'supportedFlexibleServerEditions', 'type': '[ServerEditionCapability]'}, + 'geo_backup_supported': {'key': 'geoBackupSupported', 'type': 'bool'}, + 'zone_redundant_ha_supported': {'key': 'zoneRedundantHaSupported', 'type': 'bool'}, + 'zone_redundant_ha_and_geo_backup_supported': {'key': 'zoneRedundantHaAndGeoBackupSupported', 'type': 'bool'}, + 'supported_flexible_server_editions': {'key': 'supportedFlexibleServerEditions', 'type': '[FlexibleServerEditionCapability]'}, + 'supported_hyperscale_node_editions': {'key': 'supportedHyperscaleNodeEditions', 'type': '[HyperscaleNodeEditionCapability]'}, + 'status': {'key': 'status', 'type': 'str'}, } def __init__( @@ -67,7 +125,12 @@ def __init__( ): super(CapabilityProperties, self).__init__(**kwargs) self.zone = None + self.geo_backup_supported = None + self.zone_redundant_ha_supported = None + self.zone_redundant_ha_and_geo_backup_supported = None self.supported_flexible_server_editions = None + self.supported_hyperscale_node_editions = None + self.status = None class Resource(msrest.serialization.Model): @@ -154,6 +217,8 @@ class Configuration(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~postgre_sql_management_client.models.SystemData :param value: Value of the configuration. :type value: str :ivar description: Description of the configuration. @@ -162,8 +227,7 @@ class Configuration(ProxyResource): :vartype default_value: str :ivar data_type: Data type of the configuration. Possible values include: "Boolean", "Numeric", "Integer", "Enumeration". - :vartype data_type: str or - ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ConfigurationDataType + :vartype data_type: str or ~postgre_sql_management_client.models.ConfigurationDataType :ivar allowed_values: Allowed values of the configuration. :vartype allowed_values: str :param source: Source of the configuration. @@ -174,6 +238,7 @@ class Configuration(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'description': {'readonly': True}, 'default_value': {'readonly': True}, 'data_type': {'readonly': True}, @@ -184,6 +249,7 @@ class Configuration(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'value': {'key': 'properties.value', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'default_value': {'key': 'properties.defaultValue', 'type': 'str'}, @@ -197,6 +263,7 @@ def __init__( **kwargs ): super(Configuration, self).__init__(**kwargs) + self.system_data = None self.value = kwargs.get('value', None) self.description = None self.default_value = None @@ -209,7 +276,7 @@ class ConfigurationListResult(msrest.serialization.Model): """A list of server configurations. :param value: The list of server configurations. - :type value: list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.Configuration] + :type value: list[~postgre_sql_management_client.models.Configuration] :param next_link: The link used to get the next page of operations. :type next_link: str """ @@ -241,6 +308,8 @@ class Database(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~postgre_sql_management_client.models.SystemData :param charset: The charset of the database. :type charset: str :param collation: The collation of the database. @@ -251,12 +320,14 @@ class Database(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'charset': {'key': 'properties.charset', 'type': 'str'}, 'collation': {'key': 'properties.collation', 'type': 'str'}, } @@ -266,6 +337,7 @@ def __init__( **kwargs ): super(Database, self).__init__(**kwargs) + self.system_data = None self.charset = kwargs.get('charset', None) self.collation = kwargs.get('collation', None) @@ -274,7 +346,7 @@ class DatabaseListResult(msrest.serialization.Model): """A List of databases. :param value: The list of databases housed in a server. - :type value: list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.Database] + :type value: list[~postgre_sql_management_client.models.Database] :param next_link: The link used to get the next page of databases. :type next_link: str """ @@ -331,7 +403,7 @@ class ErrorAdditionalInfo(msrest.serialization.Model): :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. - :vartype info: str + :vartype info: any """ _validation = { @@ -341,7 +413,7 @@ class ErrorAdditionalInfo(msrest.serialization.Model): _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, } def __init__( @@ -365,10 +437,9 @@ class ErrorResponse(msrest.serialization.Model): :ivar target: The error target. :vartype target: str :ivar details: The error details. - :vartype details: list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.ErrorResponse] + :vartype details: list[~postgre_sql_management_client.models.ErrorResponse] :ivar additional_info: The error additional info. - :vartype additional_info: - list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.ErrorAdditionalInfo] + :vartype additional_info: list[~postgre_sql_management_client.models.ErrorAdditionalInfo] """ _validation = { @@ -414,6 +485,8 @@ class FirewallRule(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~postgre_sql_management_client.models.SystemData :param start_ip_address: Required. The start IP address of the server firewall rule. Must be IPv4 format. :type start_ip_address: str @@ -426,6 +499,7 @@ class FirewallRule(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'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])$'}, } @@ -434,6 +508,7 @@ class FirewallRule(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'start_ip_address': {'key': 'properties.startIpAddress', 'type': 'str'}, 'end_ip_address': {'key': 'properties.endIpAddress', 'type': 'str'}, } @@ -443,6 +518,7 @@ def __init__( **kwargs ): super(FirewallRule, self).__init__(**kwargs) + self.system_data = None self.start_ip_address = kwargs['start_ip_address'] self.end_ip_address = kwargs['end_ip_address'] @@ -451,7 +527,7 @@ class FirewallRuleListResult(msrest.serialization.Model): """A list of firewall rules. :param value: The list of firewall rules in a server. - :type value: list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.FirewallRule] + :type value: list[~postgre_sql_management_client.models.FirewallRule] :param next_link: The link used to get the next page of operations. :type next_link: str """ @@ -470,6 +546,130 @@ def __init__( self.next_link = kwargs.get('next_link', None) +class FlexibleServerEditionCapability(msrest.serialization.Model): + """Flexible server edition capabilities. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Server edition name. + :vartype name: str + :ivar supported_storage_editions: The list of editions supported by this server edition. + :vartype supported_storage_editions: + list[~postgre_sql_management_client.models.StorageEditionCapability] + :ivar supported_server_versions: The list of server versions supported by this server edition. + :vartype supported_server_versions: + list[~postgre_sql_management_client.models.ServerVersionCapability] + :ivar status: The status. + :vartype status: str + """ + + _validation = { + 'name': {'readonly': True}, + 'supported_storage_editions': {'readonly': True}, + 'supported_server_versions': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'supported_storage_editions': {'key': 'supportedStorageEditions', 'type': '[StorageEditionCapability]'}, + 'supported_server_versions': {'key': 'supportedServerVersions', 'type': '[ServerVersionCapability]'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FlexibleServerEditionCapability, self).__init__(**kwargs) + self.name = None + self.supported_storage_editions = None + self.supported_server_versions = None + self.status = None + + +class HighAvailability(msrest.serialization.Model): + """High availability properties of a server. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param mode: The HA mode for the server. Possible values include: "Disabled", "ZoneRedundant". + :type mode: str or ~postgre_sql_management_client.models.HighAvailabilityMode + :ivar state: A state of a HA server that is visible to user. Possible values include: + "NotEnabled", "CreatingStandby", "ReplicatingData", "FailingOver", "Healthy", + "RemovingStandby". + :vartype state: str or ~postgre_sql_management_client.models.ServerHAState + :param standby_availability_zone: availability zone information of the standby. + :type standby_availability_zone: str + """ + + _validation = { + 'state': {'readonly': True}, + } + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'standby_availability_zone': {'key': 'standbyAvailabilityZone', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HighAvailability, self).__init__(**kwargs) + self.mode = kwargs.get('mode', None) + self.state = None + self.standby_availability_zone = kwargs.get('standby_availability_zone', None) + + +class HyperscaleNodeEditionCapability(msrest.serialization.Model): + """Hyperscale node edition capabilities. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Server edition name. + :vartype name: str + :ivar supported_storage_editions: The list of editions supported by this server edition. + :vartype supported_storage_editions: + list[~postgre_sql_management_client.models.StorageEditionCapability] + :ivar supported_server_versions: The list of server versions supported by this server edition. + :vartype supported_server_versions: + list[~postgre_sql_management_client.models.ServerVersionCapability] + :ivar supported_node_types: The list of Node Types supported by this server edition. + :vartype supported_node_types: list[~postgre_sql_management_client.models.NodeTypeCapability] + :ivar status: The status. + :vartype status: str + """ + + _validation = { + 'name': {'readonly': True}, + 'supported_storage_editions': {'readonly': True}, + 'supported_server_versions': {'readonly': True}, + 'supported_node_types': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'supported_storage_editions': {'key': 'supportedStorageEditions', 'type': '[StorageEditionCapability]'}, + 'supported_server_versions': {'key': 'supportedServerVersions', 'type': '[ServerVersionCapability]'}, + 'supported_node_types': {'key': 'supportedNodeTypes', 'type': '[NodeTypeCapability]'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HyperscaleNodeEditionCapability, self).__init__(**kwargs) + self.name = None + self.supported_storage_editions = None + self.supported_server_versions = None + self.supported_node_types = None + self.status = None + + class Identity(msrest.serialization.Model): """Identity for the resource. @@ -479,14 +679,14 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: The identity type. Default value: "SystemAssigned". - :vartype type: str + :param type: The identity type. The only acceptable values to pass in are None and + "SystemAssigned". The default value is None. + :type type: str """ _validation = { 'principal_id': {'readonly': True}, 'tenant_id': {'readonly': True}, - 'type': {'constant': True}, } _attribute_map = { @@ -495,8 +695,6 @@ class Identity(msrest.serialization.Model): 'type': {'key': 'type', 'type': 'str'}, } - type = "SystemAssigned" - def __init__( self, **kwargs @@ -504,10 +702,11 @@ def __init__( super(Identity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None + self.type = kwargs.get('type', None) class MaintenanceWindow(msrest.serialization.Model): - """Maintenance window of a server. + """Maintenance window properties of a server. :param custom_window: indicates whether custom window is enabled or disabled. :type custom_window: str @@ -597,6 +796,76 @@ def __init__( self.type = kwargs.get('type', None) +class Network(msrest.serialization.Model): + """Network properties of a server. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar public_network_access: public network access is enabled or not. Possible values include: + "Enabled", "Disabled". + :vartype public_network_access: str or + ~postgre_sql_management_client.models.ServerPublicNetworkAccessState + :param delegated_subnet_resource_id: delegated subnet arm resource id. + :type delegated_subnet_resource_id: str + :param private_dns_zone_arm_resource_id: private dns zone arm resource id. + :type private_dns_zone_arm_resource_id: str + """ + + _validation = { + 'public_network_access': {'readonly': True}, + } + + _attribute_map = { + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'delegated_subnet_resource_id': {'key': 'delegatedSubnetResourceId', 'type': 'str'}, + 'private_dns_zone_arm_resource_id': {'key': 'privateDnsZoneArmResourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Network, self).__init__(**kwargs) + self.public_network_access = None + self.delegated_subnet_resource_id = kwargs.get('delegated_subnet_resource_id', None) + self.private_dns_zone_arm_resource_id = kwargs.get('private_dns_zone_arm_resource_id', None) + + +class NodeTypeCapability(msrest.serialization.Model): + """node type capability. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: note type name. + :vartype name: str + :ivar node_type: note type. + :vartype node_type: str + :ivar status: The status. + :vartype status: str + """ + + _validation = { + 'name': {'readonly': True}, + 'node_type': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'node_type': {'key': 'nodeType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NodeTypeCapability, self).__init__(**kwargs) + self.name = None + self.node_type = None + self.status = None + + class Operation(msrest.serialization.Model): """REST API operation definition. @@ -605,14 +874,14 @@ class Operation(msrest.serialization.Model): :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.postgresql_flexibleservers.models.OperationDisplay + :vartype display: ~postgre_sql_management_client.models.OperationDisplay :param is_data_action: Indicates whether the operation is a data action. :type is_data_action: bool :ivar origin: The intended executor of the operation. Possible values include: "NotSpecified", "user", "system". - :vartype origin: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.OperationOrigin + :vartype origin: str or ~postgre_sql_management_client.models.OperationOrigin :ivar properties: Additional descriptions for the operation. - :vartype properties: dict[str, str] + :vartype properties: dict[str, any] """ _validation = { @@ -627,7 +896,7 @@ class Operation(msrest.serialization.Model): 'display': {'key': 'display', 'type': 'OperationDisplay'}, 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': '{object}'}, } def __init__( @@ -686,7 +955,7 @@ class OperationListResult(msrest.serialization.Model): """A list of resource provider operations. :param value: Collection of available operation details. - :type value: list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.Operation] + :type value: list[~postgre_sql_management_client.models.Operation] :param next_link: URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. :type next_link: str @@ -706,6 +975,29 @@ def __init__( self.next_link = kwargs.get('next_link', None) +class RestartParameter(msrest.serialization.Model): + """Represents server restart parameters. + + :param restart_with_failover: Indicates whether to restart the server with failover. + :type restart_with_failover: bool + :param failover_mode: Failover mode. + :type failover_mode: str + """ + + _attribute_map = { + 'restart_with_failover': {'key': 'restartWithFailover', 'type': 'bool'}, + 'failover_mode': {'key': 'failoverMode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RestartParameter, self).__init__(**kwargs) + self.restart_with_failover = kwargs.get('restart_with_failover', None) + self.failover_mode = kwargs.get('failover_mode', None) + + class TrackedResource(Resource): """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. @@ -771,66 +1063,47 @@ class Server(TrackedResource): :param location: Required. The geo-location where the resource lives. :type location: str :param identity: The Azure Active Directory identity of the server. - :type identity: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Identity + :type identity: ~postgre_sql_management_client.models.Identity :param sku: The SKU (pricing tier) of the server. - :type sku: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Sku + :type sku: ~postgre_sql_management_client.models.Sku + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~postgre_sql_management_client.models.SystemData :param administrator_login: The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). :type administrator_login: str :param administrator_login_password: The administrator login password (required for server creation). :type administrator_login_password: str - :param version: PostgreSQL Server version. Possible values include: "12", "11". - :type version: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerVersion + :param version: PostgreSQL Server version. Possible values include: "13", "12", "11". + :type version: str or ~postgre_sql_management_client.models.ServerVersion + :ivar minor_version: The minor version of the server. + :vartype minor_version: str :ivar state: A state of a server that is visible to user. Possible values include: "Ready", "Dropping", "Disabled", "Starting", "Stopping", "Stopped", "Updating". - :vartype state: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerState - :ivar ha_state: A state of a HA server that is visible to user. Possible values include: - "NotEnabled", "CreatingStandby", "ReplicatingData", "FailingOver", "Healthy", - "RemovingStandby". - :vartype ha_state: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerHAState + :vartype state: str or ~postgre_sql_management_client.models.ServerState :ivar fully_qualified_domain_name: The fully qualified domain name of a server. :vartype fully_qualified_domain_name: str - :param display_name: The display name of a server. - :type display_name: str - :param storage_profile: Storage profile of a server. - :type storage_profile: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.StorageProfile - :ivar public_network_access: public network access is enabled or not. Possible values include: - "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerPublicNetworkAccessState - :param maintenance_window: Maintenance window of a server. - :type maintenance_window: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.MaintenanceWindow - :param ha_enabled: stand by count value can be either enabled or disabled. Possible values - include: "Enabled", "Disabled". - :type ha_enabled: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.HAEnabledEnum - :param source_server_name: The source PostgreSQL server name to restore from. - :type source_server_name: str - :param source_subscription_id: The subscription id of source serve PostgreSQL server name to - restore from. - :type source_subscription_id: str - :param source_resource_group_name: The resource group name of source serve PostgreSQL server - name to restore from. - :type source_resource_group_name: str + :param storage: Storage properties of a server. + :type storage: ~postgre_sql_management_client.models.Storage + :param backup: Backup properties of a server. + :type backup: ~postgre_sql_management_client.models.Backup + :param network: Network properties of a server. + :type network: ~postgre_sql_management_client.models.Network + :param high_availability: High availability properties of a server. + :type high_availability: ~postgre_sql_management_client.models.HighAvailability + :param maintenance_window: Maintenance window properties of a server. + :type maintenance_window: ~postgre_sql_management_client.models.MaintenanceWindow + :param source_server_resource_id: The source server resource ID to restore from. It's required + when 'createMode' is 'PointInTimeRestore'. + :type source_server_resource_id: str :param point_in_time_utc: Restore point creation time (ISO8601 format), specifying the time to - restore from. + restore from. It's required when 'createMode' is 'PointInTimeRestore'. :type point_in_time_utc: ~datetime.datetime - :param availability_zone: availability Zone information of the server. + :param availability_zone: availability zone information of the server. :type availability_zone: str - :ivar standby_availability_zone: availability Zone information of the server. - :vartype standby_availability_zone: str - :ivar byok_enforcement: Status showing whether the data encryption is enabled with - customer-managed keys. - :vartype byok_enforcement: str - :param delegated_subnet_arguments: - :type delegated_subnet_arguments: - ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerPropertiesDelegatedSubnetArguments - :param private_dns_zone_arguments: - :type private_dns_zone_arguments: - ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerPropertiesPrivateDnsZoneArguments :param create_mode: The mode to create a new PostgreSQL server. Possible values include: - "Default", "PointInTimeRestore". - :type create_mode: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.CreateMode + "Default", "Create", "Update", "PointInTimeRestore". + :type create_mode: str or ~postgre_sql_management_client.models.CreateMode :param tags_properties_tags: Application-specific metadata in the form of key-value pairs. :type tags_properties_tags: dict[str, str] """ @@ -840,12 +1113,10 @@ class Server(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'minor_version': {'readonly': True}, 'state': {'readonly': True}, - 'ha_state': {'readonly': True}, 'fully_qualified_domain_name': {'readonly': True}, - 'public_network_access': {'readonly': True}, - 'standby_availability_zone': {'readonly': True}, - 'byok_enforcement': {'readonly': True}, } _attribute_map = { @@ -856,26 +1127,21 @@ class Server(TrackedResource): 'location': {'key': 'location', 'type': 'str'}, 'identity': {'key': 'identity', 'type': 'Identity'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, 'version': {'key': 'properties.version', 'type': 'str'}, + 'minor_version': {'key': 'properties.minorVersion', 'type': 'str'}, 'state': {'key': 'properties.state', 'type': 'str'}, - 'ha_state': {'key': 'properties.haState', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'storage': {'key': 'properties.storage', 'type': 'Storage'}, + 'backup': {'key': 'properties.backup', 'type': 'Backup'}, + 'network': {'key': 'properties.network', 'type': 'Network'}, + 'high_availability': {'key': 'properties.highAvailability', 'type': 'HighAvailability'}, 'maintenance_window': {'key': 'properties.maintenanceWindow', 'type': 'MaintenanceWindow'}, - 'ha_enabled': {'key': 'properties.haEnabled', 'type': 'str'}, - 'source_server_name': {'key': 'properties.sourceServerName', 'type': 'str'}, - 'source_subscription_id': {'key': 'properties.sourceSubscriptionId', 'type': 'str'}, - 'source_resource_group_name': {'key': 'properties.sourceResourceGroupName', 'type': 'str'}, + 'source_server_resource_id': {'key': 'properties.sourceServerResourceId', 'type': 'str'}, 'point_in_time_utc': {'key': 'properties.pointInTimeUTC', 'type': 'iso-8601'}, 'availability_zone': {'key': 'properties.availabilityZone', 'type': 'str'}, - 'standby_availability_zone': {'key': 'properties.standbyAvailabilityZone', 'type': 'str'}, - 'byok_enforcement': {'key': 'properties.byokEnforcement', 'type': 'str'}, - 'delegated_subnet_arguments': {'key': 'properties.delegatedSubnetArguments', 'type': 'ServerPropertiesDelegatedSubnetArguments'}, - 'private_dns_zone_arguments': {'key': 'properties.privateDnsZoneArguments', 'type': 'ServerPropertiesPrivateDnsZoneArguments'}, 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, 'tags_properties_tags': {'key': 'properties.tags', 'type': '{str}'}, } @@ -887,85 +1153,47 @@ def __init__( super(Server, self).__init__(**kwargs) self.identity = kwargs.get('identity', None) self.sku = kwargs.get('sku', None) + self.system_data = None self.administrator_login = kwargs.get('administrator_login', None) self.administrator_login_password = kwargs.get('administrator_login_password', None) self.version = kwargs.get('version', None) + self.minor_version = None self.state = None - self.ha_state = None self.fully_qualified_domain_name = None - self.display_name = kwargs.get('display_name', None) - self.storage_profile = kwargs.get('storage_profile', None) - self.public_network_access = None + self.storage = kwargs.get('storage', None) + self.backup = kwargs.get('backup', None) + self.network = kwargs.get('network', None) + self.high_availability = kwargs.get('high_availability', None) self.maintenance_window = kwargs.get('maintenance_window', None) - self.ha_enabled = kwargs.get('ha_enabled', None) - self.source_server_name = kwargs.get('source_server_name', None) - self.source_subscription_id = kwargs.get('source_subscription_id', None) - self.source_resource_group_name = kwargs.get('source_resource_group_name', None) + self.source_server_resource_id = kwargs.get('source_server_resource_id', None) self.point_in_time_utc = kwargs.get('point_in_time_utc', None) self.availability_zone = kwargs.get('availability_zone', None) - self.standby_availability_zone = None - self.byok_enforcement = None - self.delegated_subnet_arguments = kwargs.get('delegated_subnet_arguments', None) - self.private_dns_zone_arguments = kwargs.get('private_dns_zone_arguments', None) self.create_mode = kwargs.get('create_mode', None) self.tags_properties_tags = kwargs.get('tags_properties_tags', None) -class ServerEditionCapability(msrest.serialization.Model): - """Server edition capabilities. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Server edition name. - :vartype name: str - :ivar supported_storage_editions: - :vartype supported_storage_editions: - list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.StorageEditionCapability] - :ivar supported_server_versions: - :vartype supported_server_versions: - list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerVersionCapability] - """ - - _validation = { - 'name': {'readonly': True}, - 'supported_storage_editions': {'readonly': True}, - 'supported_server_versions': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'supported_storage_editions': {'key': 'supportedStorageEditions', 'type': '[StorageEditionCapability]'}, - 'supported_server_versions': {'key': 'supportedServerVersions', 'type': '[ServerVersionCapability]'}, - } - - def __init__( - self, - **kwargs - ): - super(ServerEditionCapability, self).__init__(**kwargs) - self.name = None - self.supported_storage_editions = None - self.supported_server_versions = None - - class ServerForUpdate(msrest.serialization.Model): """Represents a server to be updated. :param location: The location the resource resides in. :type location: str :param sku: The SKU (pricing tier) of the server. - :type sku: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Sku + :type sku: ~postgre_sql_management_client.models.Sku :param tags: A set of tags. Application-specific metadata in the form of key-value pairs. :type tags: dict[str, str] :param administrator_login_password: The password of the administrator login. :type administrator_login_password: str - :param storage_profile: Storage profile of a server. - :type storage_profile: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.StorageProfile - :param ha_enabled: stand by count value can be either enabled or disabled. Possible values - include: "Enabled", "Disabled". - :type ha_enabled: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.HAEnabledEnum - :param maintenance_window: Maintenance window of a server. - :type maintenance_window: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.MaintenanceWindow + :param storage: Storage properties of a server. + :type storage: ~postgre_sql_management_client.models.Storage + :param backup: Backup properties of a server. + :type backup: ~postgre_sql_management_client.models.Backup + :param high_availability: High availability properties of a server. + :type high_availability: ~postgre_sql_management_client.models.HighAvailability + :param maintenance_window: Maintenance window properties of a server. + :type maintenance_window: ~postgre_sql_management_client.models.MaintenanceWindow + :param create_mode: The mode to update a new PostgreSQL server. Possible values include: + "Default", "Update". + :type create_mode: str or ~postgre_sql_management_client.models.CreateModeForUpdate """ _attribute_map = { @@ -973,9 +1201,11 @@ class ServerForUpdate(msrest.serialization.Model): 'sku': {'key': 'sku', 'type': 'Sku'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, - 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, - 'ha_enabled': {'key': 'properties.haEnabled', 'type': 'str'}, + 'storage': {'key': 'properties.storage', 'type': 'Storage'}, + 'backup': {'key': 'properties.backup', 'type': 'Backup'}, + 'high_availability': {'key': 'properties.highAvailability', 'type': 'HighAvailability'}, 'maintenance_window': {'key': 'properties.maintenanceWindow', 'type': 'MaintenanceWindow'}, + 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, } def __init__( @@ -987,16 +1217,18 @@ def __init__( self.sku = kwargs.get('sku', None) self.tags = kwargs.get('tags', None) self.administrator_login_password = kwargs.get('administrator_login_password', None) - self.storage_profile = kwargs.get('storage_profile', None) - self.ha_enabled = kwargs.get('ha_enabled', None) + self.storage = kwargs.get('storage', None) + self.backup = kwargs.get('backup', None) + self.high_availability = kwargs.get('high_availability', None) self.maintenance_window = kwargs.get('maintenance_window', None) + self.create_mode = kwargs.get('create_mode', None) class ServerListResult(msrest.serialization.Model): """A list of servers. :param value: The list of flexible servers. - :type value: list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.Server] + :type value: list[~postgre_sql_management_client.models.Server] :param next_link: The link used to get the next page of operations. :type next_link: str """ @@ -1015,44 +1247,6 @@ def __init__( self.next_link = kwargs.get('next_link', None) -class ServerPropertiesDelegatedSubnetArguments(msrest.serialization.Model): - """ServerPropertiesDelegatedSubnetArguments. - - :param subnet_arm_resource_id: delegated subnet arm resource id. - :type subnet_arm_resource_id: str - """ - - _attribute_map = { - 'subnet_arm_resource_id': {'key': 'subnetArmResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ServerPropertiesDelegatedSubnetArguments, self).__init__(**kwargs) - self.subnet_arm_resource_id = kwargs.get('subnet_arm_resource_id', None) - - -class ServerPropertiesPrivateDnsZoneArguments(msrest.serialization.Model): - """ServerPropertiesPrivateDnsZoneArguments. - - :param private_dns_zone_arm_resource_id: private dns zone arm resource id. - :type private_dns_zone_arm_resource_id: str - """ - - _attribute_map = { - 'private_dns_zone_arm_resource_id': {'key': 'privateDnsZoneArmResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ServerPropertiesPrivateDnsZoneArguments, self).__init__(**kwargs) - self.private_dns_zone_arm_resource_id = kwargs.get('private_dns_zone_arm_resource_id', None) - - class ServerVersionCapability(msrest.serialization.Model): """Server version capabilities. @@ -1061,18 +1255,21 @@ class ServerVersionCapability(msrest.serialization.Model): :ivar name: server version. :vartype name: str :ivar supported_vcores: - :vartype supported_vcores: - list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.VcoreCapability] + :vartype supported_vcores: list[~postgre_sql_management_client.models.VcoreCapability] + :ivar status: The status. + :vartype status: str """ _validation = { 'name': {'readonly': True}, 'supported_vcores': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'supported_vcores': {'key': 'supportedVcores', 'type': '[VcoreCapability]'}, + 'status': {'key': 'status', 'type': 'str'}, } def __init__( @@ -1082,6 +1279,7 @@ def __init__( super(ServerVersionCapability, self).__init__(**kwargs) self.name = None self.supported_vcores = None + self.status = None class Sku(msrest.serialization.Model): @@ -1094,7 +1292,7 @@ class Sku(msrest.serialization.Model): :type name: str :param tier: Required. The tier of the particular SKU, e.g. Burstable. Possible values include: "Burstable", "GeneralPurpose", "MemoryOptimized". - :type tier: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.SkuTier + :type tier: str or ~postgre_sql_management_client.models.SkuTier """ _validation = { @@ -1116,6 +1314,25 @@ def __init__( self.tier = kwargs['tier'] +class Storage(msrest.serialization.Model): + """Storage properties of a server. + + :param storage_size_gb: Max storage allowed for a server. + :type storage_size_gb: int + """ + + _attribute_map = { + 'storage_size_gb': {'key': 'storageSizeGB', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(Storage, self).__init__(**kwargs) + self.storage_size_gb = kwargs.get('storage_size_gb', None) + + class StorageEditionCapability(msrest.serialization.Model): """storage edition capability. @@ -1124,18 +1341,21 @@ class StorageEditionCapability(msrest.serialization.Model): :ivar name: storage edition name. :vartype name: str :ivar supported_storage_mb: - :vartype supported_storage_mb: - list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.StorageMBCapability] + :vartype supported_storage_mb: list[~postgre_sql_management_client.models.StorageMBCapability] + :ivar status: The status. + :vartype status: str """ _validation = { 'name': {'readonly': True}, 'supported_storage_mb': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'supported_storage_mb': {'key': 'supportedStorageMB', 'type': '[StorageMBCapability]'}, + 'status': {'key': 'status', 'type': 'str'}, } def __init__( @@ -1145,6 +1365,7 @@ def __init__( super(StorageEditionCapability, self).__init__(**kwargs) self.name = None self.supported_storage_mb = None + self.status = None class StorageMBCapability(msrest.serialization.Model): @@ -1158,18 +1379,22 @@ class StorageMBCapability(msrest.serialization.Model): :vartype supported_iops: long :ivar storage_size_mb: storage size in MB. :vartype storage_size_mb: long + :ivar status: The status. + :vartype status: str """ _validation = { 'name': {'readonly': True}, 'supported_iops': {'readonly': True}, 'storage_size_mb': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'supported_iops': {'key': 'supportedIops', 'type': 'long'}, 'storage_size_mb': {'key': 'storageSizeMB', 'type': 'long'}, + 'status': {'key': 'status', 'type': 'str'}, } def __init__( @@ -1180,29 +1405,48 @@ def __init__( self.name = None self.supported_iops = None self.storage_size_mb = None - - -class StorageProfile(msrest.serialization.Model): - """Storage Profile properties of a server. - - :param backup_retention_days: Backup retention days for the server. - :type backup_retention_days: int - :param storage_mb: Max storage allowed for a server. - :type storage_mb: int + self.status = None + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~postgre_sql_management_client.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~postgre_sql_management_client.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime """ _attribute_map = { - 'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'}, - 'storage_mb': {'key': 'storageMB', 'type': 'int'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, } def __init__( self, **kwargs ): - super(StorageProfile, self).__init__(**kwargs) - self.backup_retention_days = kwargs.get('backup_retention_days', None) - self.storage_mb = kwargs.get('storage_mb', None) + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) class VcoreCapability(msrest.serialization.Model): @@ -1218,6 +1462,8 @@ class VcoreCapability(msrest.serialization.Model): :vartype supported_iops: long :ivar supported_memory_per_vcore_mb: supported memory per vCore in MB. :vartype supported_memory_per_vcore_mb: long + :ivar status: The status. + :vartype status: str """ _validation = { @@ -1225,6 +1471,7 @@ class VcoreCapability(msrest.serialization.Model): 'v_cores': {'readonly': True}, 'supported_iops': {'readonly': True}, 'supported_memory_per_vcore_mb': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { @@ -1232,6 +1479,7 @@ class VcoreCapability(msrest.serialization.Model): 'v_cores': {'key': 'vCores', 'type': 'long'}, 'supported_iops': {'key': 'supportedIops', 'type': 'long'}, 'supported_memory_per_vcore_mb': {'key': 'supportedMemoryPerVcoreMB', 'type': 'long'}, + 'status': {'key': 'status', 'type': 'str'}, } def __init__( @@ -1243,6 +1491,7 @@ def __init__( self.v_cores = None self.supported_iops = None self.supported_memory_per_vcore_mb = None + self.status = None class VirtualNetworkSubnetUsageParameter(msrest.serialization.Model): @@ -1271,7 +1520,7 @@ class VirtualNetworkSubnetUsageResult(msrest.serialization.Model): :ivar delegated_subnets_usage: :vartype delegated_subnets_usage: - list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.DelegatedSubnetUsage] + list[~postgre_sql_management_client.models.DelegatedSubnetUsage] """ _validation = { diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_models_py3.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_models_py3.py index d02a4e2a949a..9ba15077c648 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_models_py3.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_models_py3.py @@ -14,13 +14,50 @@ from ._postgre_sql_management_client_enums import * +class Backup(msrest.serialization.Model): + """Backup properties of a server. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param backup_retention_days: Backup retention days for the server. + :type backup_retention_days: int + :param geo_redundant_backup: A value indicating whether Geo-Redundant backup is enabled on the + server. Possible values include: "Enabled", "Disabled". + :type geo_redundant_backup: str or ~postgre_sql_management_client.models.GeoRedundantBackupEnum + :ivar earliest_restore_date: The earliest restore point time (ISO8601 format) for server. + :vartype earliest_restore_date: ~datetime.datetime + """ + + _validation = { + 'earliest_restore_date': {'readonly': True}, + } + + _attribute_map = { + 'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'}, + 'geo_redundant_backup': {'key': 'geoRedundantBackup', 'type': 'str'}, + 'earliest_restore_date': {'key': 'earliestRestoreDate', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + backup_retention_days: Optional[int] = None, + geo_redundant_backup: Optional[Union[str, "GeoRedundantBackupEnum"]] = None, + **kwargs + ): + super(Backup, self).__init__(**kwargs) + self.backup_retention_days = backup_retention_days + self.geo_redundant_backup = geo_redundant_backup + self.earliest_restore_date = None + + class CapabilitiesListResult(msrest.serialization.Model): """location capability. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: A list of supported capabilities. - :vartype value: list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.CapabilityProperties] + :vartype value: list[~postgre_sql_management_client.models.CapabilityProperties] :ivar next_link: Link to retrieve next page of results. :vartype next_link: str """ @@ -51,19 +88,43 @@ class CapabilityProperties(msrest.serialization.Model): :ivar zone: zone name. :vartype zone: str + :ivar geo_backup_supported: A value indicating whether a new server in this region can have + geo-backups to paired region. + :vartype geo_backup_supported: bool + :ivar zone_redundant_ha_supported: A value indicating whether a new server in this region can + support multi zone HA. + :vartype zone_redundant_ha_supported: bool + :ivar zone_redundant_ha_and_geo_backup_supported: A value indicating whether a new server in + this region can have geo-backups to paired region. + :vartype zone_redundant_ha_and_geo_backup_supported: bool :ivar supported_flexible_server_editions: :vartype supported_flexible_server_editions: - list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerEditionCapability] + list[~postgre_sql_management_client.models.FlexibleServerEditionCapability] + :ivar supported_hyperscale_node_editions: + :vartype supported_hyperscale_node_editions: + list[~postgre_sql_management_client.models.HyperscaleNodeEditionCapability] + :ivar status: The status. + :vartype status: str """ _validation = { 'zone': {'readonly': True}, + 'geo_backup_supported': {'readonly': True}, + 'zone_redundant_ha_supported': {'readonly': True}, + 'zone_redundant_ha_and_geo_backup_supported': {'readonly': True}, 'supported_flexible_server_editions': {'readonly': True}, + 'supported_hyperscale_node_editions': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { 'zone': {'key': 'zone', 'type': 'str'}, - 'supported_flexible_server_editions': {'key': 'supportedFlexibleServerEditions', 'type': '[ServerEditionCapability]'}, + 'geo_backup_supported': {'key': 'geoBackupSupported', 'type': 'bool'}, + 'zone_redundant_ha_supported': {'key': 'zoneRedundantHaSupported', 'type': 'bool'}, + 'zone_redundant_ha_and_geo_backup_supported': {'key': 'zoneRedundantHaAndGeoBackupSupported', 'type': 'bool'}, + 'supported_flexible_server_editions': {'key': 'supportedFlexibleServerEditions', 'type': '[FlexibleServerEditionCapability]'}, + 'supported_hyperscale_node_editions': {'key': 'supportedHyperscaleNodeEditions', 'type': '[HyperscaleNodeEditionCapability]'}, + 'status': {'key': 'status', 'type': 'str'}, } def __init__( @@ -72,7 +133,12 @@ def __init__( ): super(CapabilityProperties, self).__init__(**kwargs) self.zone = None + self.geo_backup_supported = None + self.zone_redundant_ha_supported = None + self.zone_redundant_ha_and_geo_backup_supported = None self.supported_flexible_server_editions = None + self.supported_hyperscale_node_editions = None + self.status = None class Resource(msrest.serialization.Model): @@ -159,6 +225,8 @@ class Configuration(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~postgre_sql_management_client.models.SystemData :param value: Value of the configuration. :type value: str :ivar description: Description of the configuration. @@ -167,8 +235,7 @@ class Configuration(ProxyResource): :vartype default_value: str :ivar data_type: Data type of the configuration. Possible values include: "Boolean", "Numeric", "Integer", "Enumeration". - :vartype data_type: str or - ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ConfigurationDataType + :vartype data_type: str or ~postgre_sql_management_client.models.ConfigurationDataType :ivar allowed_values: Allowed values of the configuration. :vartype allowed_values: str :param source: Source of the configuration. @@ -179,6 +246,7 @@ class Configuration(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'description': {'readonly': True}, 'default_value': {'readonly': True}, 'data_type': {'readonly': True}, @@ -189,6 +257,7 @@ class Configuration(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'value': {'key': 'properties.value', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'default_value': {'key': 'properties.defaultValue', 'type': 'str'}, @@ -205,6 +274,7 @@ def __init__( **kwargs ): super(Configuration, self).__init__(**kwargs) + self.system_data = None self.value = value self.description = None self.default_value = None @@ -217,7 +287,7 @@ class ConfigurationListResult(msrest.serialization.Model): """A list of server configurations. :param value: The list of server configurations. - :type value: list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.Configuration] + :type value: list[~postgre_sql_management_client.models.Configuration] :param next_link: The link used to get the next page of operations. :type next_link: str """ @@ -252,6 +322,8 @@ class Database(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~postgre_sql_management_client.models.SystemData :param charset: The charset of the database. :type charset: str :param collation: The collation of the database. @@ -262,12 +334,14 @@ class Database(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'charset': {'key': 'properties.charset', 'type': 'str'}, 'collation': {'key': 'properties.collation', 'type': 'str'}, } @@ -280,6 +354,7 @@ def __init__( **kwargs ): super(Database, self).__init__(**kwargs) + self.system_data = None self.charset = charset self.collation = collation @@ -288,7 +363,7 @@ class DatabaseListResult(msrest.serialization.Model): """A List of databases. :param value: The list of databases housed in a server. - :type value: list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.Database] + :type value: list[~postgre_sql_management_client.models.Database] :param next_link: The link used to get the next page of databases. :type next_link: str """ @@ -348,7 +423,7 @@ class ErrorAdditionalInfo(msrest.serialization.Model): :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. - :vartype info: str + :vartype info: any """ _validation = { @@ -358,7 +433,7 @@ class ErrorAdditionalInfo(msrest.serialization.Model): _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, } def __init__( @@ -382,10 +457,9 @@ class ErrorResponse(msrest.serialization.Model): :ivar target: The error target. :vartype target: str :ivar details: The error details. - :vartype details: list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.ErrorResponse] + :vartype details: list[~postgre_sql_management_client.models.ErrorResponse] :ivar additional_info: The error additional info. - :vartype additional_info: - list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.ErrorAdditionalInfo] + :vartype additional_info: list[~postgre_sql_management_client.models.ErrorAdditionalInfo] """ _validation = { @@ -431,6 +505,8 @@ class FirewallRule(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~postgre_sql_management_client.models.SystemData :param start_ip_address: Required. The start IP address of the server firewall rule. Must be IPv4 format. :type start_ip_address: str @@ -443,6 +519,7 @@ class FirewallRule(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'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])$'}, } @@ -451,6 +528,7 @@ class FirewallRule(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'start_ip_address': {'key': 'properties.startIpAddress', 'type': 'str'}, 'end_ip_address': {'key': 'properties.endIpAddress', 'type': 'str'}, } @@ -463,6 +541,7 @@ def __init__( **kwargs ): super(FirewallRule, self).__init__(**kwargs) + self.system_data = None self.start_ip_address = start_ip_address self.end_ip_address = end_ip_address @@ -471,7 +550,7 @@ class FirewallRuleListResult(msrest.serialization.Model): """A list of firewall rules. :param value: The list of firewall rules in a server. - :type value: list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.FirewallRule] + :type value: list[~postgre_sql_management_client.models.FirewallRule] :param next_link: The link used to get the next page of operations. :type next_link: str """ @@ -493,6 +572,133 @@ def __init__( self.next_link = next_link +class FlexibleServerEditionCapability(msrest.serialization.Model): + """Flexible server edition capabilities. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Server edition name. + :vartype name: str + :ivar supported_storage_editions: The list of editions supported by this server edition. + :vartype supported_storage_editions: + list[~postgre_sql_management_client.models.StorageEditionCapability] + :ivar supported_server_versions: The list of server versions supported by this server edition. + :vartype supported_server_versions: + list[~postgre_sql_management_client.models.ServerVersionCapability] + :ivar status: The status. + :vartype status: str + """ + + _validation = { + 'name': {'readonly': True}, + 'supported_storage_editions': {'readonly': True}, + 'supported_server_versions': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'supported_storage_editions': {'key': 'supportedStorageEditions', 'type': '[StorageEditionCapability]'}, + 'supported_server_versions': {'key': 'supportedServerVersions', 'type': '[ServerVersionCapability]'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FlexibleServerEditionCapability, self).__init__(**kwargs) + self.name = None + self.supported_storage_editions = None + self.supported_server_versions = None + self.status = None + + +class HighAvailability(msrest.serialization.Model): + """High availability properties of a server. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param mode: The HA mode for the server. Possible values include: "Disabled", "ZoneRedundant". + :type mode: str or ~postgre_sql_management_client.models.HighAvailabilityMode + :ivar state: A state of a HA server that is visible to user. Possible values include: + "NotEnabled", "CreatingStandby", "ReplicatingData", "FailingOver", "Healthy", + "RemovingStandby". + :vartype state: str or ~postgre_sql_management_client.models.ServerHAState + :param standby_availability_zone: availability zone information of the standby. + :type standby_availability_zone: str + """ + + _validation = { + 'state': {'readonly': True}, + } + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'standby_availability_zone': {'key': 'standbyAvailabilityZone', 'type': 'str'}, + } + + def __init__( + self, + *, + mode: Optional[Union[str, "HighAvailabilityMode"]] = None, + standby_availability_zone: Optional[str] = None, + **kwargs + ): + super(HighAvailability, self).__init__(**kwargs) + self.mode = mode + self.state = None + self.standby_availability_zone = standby_availability_zone + + +class HyperscaleNodeEditionCapability(msrest.serialization.Model): + """Hyperscale node edition capabilities. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Server edition name. + :vartype name: str + :ivar supported_storage_editions: The list of editions supported by this server edition. + :vartype supported_storage_editions: + list[~postgre_sql_management_client.models.StorageEditionCapability] + :ivar supported_server_versions: The list of server versions supported by this server edition. + :vartype supported_server_versions: + list[~postgre_sql_management_client.models.ServerVersionCapability] + :ivar supported_node_types: The list of Node Types supported by this server edition. + :vartype supported_node_types: list[~postgre_sql_management_client.models.NodeTypeCapability] + :ivar status: The status. + :vartype status: str + """ + + _validation = { + 'name': {'readonly': True}, + 'supported_storage_editions': {'readonly': True}, + 'supported_server_versions': {'readonly': True}, + 'supported_node_types': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'supported_storage_editions': {'key': 'supportedStorageEditions', 'type': '[StorageEditionCapability]'}, + 'supported_server_versions': {'key': 'supportedServerVersions', 'type': '[ServerVersionCapability]'}, + 'supported_node_types': {'key': 'supportedNodeTypes', 'type': '[NodeTypeCapability]'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HyperscaleNodeEditionCapability, self).__init__(**kwargs) + self.name = None + self.supported_storage_editions = None + self.supported_server_versions = None + self.supported_node_types = None + self.status = None + + class Identity(msrest.serialization.Model): """Identity for the resource. @@ -502,14 +708,14 @@ class Identity(msrest.serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: The identity type. Default value: "SystemAssigned". - :vartype type: str + :param type: The identity type. The only acceptable values to pass in are None and + "SystemAssigned". The default value is None. + :type type: str """ _validation = { 'principal_id': {'readonly': True}, 'tenant_id': {'readonly': True}, - 'type': {'constant': True}, } _attribute_map = { @@ -518,19 +724,20 @@ class Identity(msrest.serialization.Model): 'type': {'key': 'type', 'type': 'str'}, } - type = "SystemAssigned" - def __init__( self, + *, + type: Optional[str] = None, **kwargs ): super(Identity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None + self.type = type class MaintenanceWindow(msrest.serialization.Model): - """Maintenance window of a server. + """Maintenance window properties of a server. :param custom_window: indicates whether custom window is enabled or disabled. :type custom_window: str @@ -633,6 +840,79 @@ def __init__( self.type = type +class Network(msrest.serialization.Model): + """Network properties of a server. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar public_network_access: public network access is enabled or not. Possible values include: + "Enabled", "Disabled". + :vartype public_network_access: str or + ~postgre_sql_management_client.models.ServerPublicNetworkAccessState + :param delegated_subnet_resource_id: delegated subnet arm resource id. + :type delegated_subnet_resource_id: str + :param private_dns_zone_arm_resource_id: private dns zone arm resource id. + :type private_dns_zone_arm_resource_id: str + """ + + _validation = { + 'public_network_access': {'readonly': True}, + } + + _attribute_map = { + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'delegated_subnet_resource_id': {'key': 'delegatedSubnetResourceId', 'type': 'str'}, + 'private_dns_zone_arm_resource_id': {'key': 'privateDnsZoneArmResourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + delegated_subnet_resource_id: Optional[str] = None, + private_dns_zone_arm_resource_id: Optional[str] = None, + **kwargs + ): + super(Network, self).__init__(**kwargs) + self.public_network_access = None + self.delegated_subnet_resource_id = delegated_subnet_resource_id + self.private_dns_zone_arm_resource_id = private_dns_zone_arm_resource_id + + +class NodeTypeCapability(msrest.serialization.Model): + """node type capability. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: note type name. + :vartype name: str + :ivar node_type: note type. + :vartype node_type: str + :ivar status: The status. + :vartype status: str + """ + + _validation = { + 'name': {'readonly': True}, + 'node_type': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'node_type': {'key': 'nodeType', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NodeTypeCapability, self).__init__(**kwargs) + self.name = None + self.node_type = None + self.status = None + + class Operation(msrest.serialization.Model): """REST API operation definition. @@ -641,14 +921,14 @@ class Operation(msrest.serialization.Model): :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.postgresql_flexibleservers.models.OperationDisplay + :vartype display: ~postgre_sql_management_client.models.OperationDisplay :param is_data_action: Indicates whether the operation is a data action. :type is_data_action: bool :ivar origin: The intended executor of the operation. Possible values include: "NotSpecified", "user", "system". - :vartype origin: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.OperationOrigin + :vartype origin: str or ~postgre_sql_management_client.models.OperationOrigin :ivar properties: Additional descriptions for the operation. - :vartype properties: dict[str, str] + :vartype properties: dict[str, any] """ _validation = { @@ -663,7 +943,7 @@ class Operation(msrest.serialization.Model): 'display': {'key': 'display', 'type': 'OperationDisplay'}, 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': '{object}'}, } def __init__( @@ -724,7 +1004,7 @@ class OperationListResult(msrest.serialization.Model): """A list of resource provider operations. :param value: Collection of available operation details. - :type value: list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.Operation] + :type value: list[~postgre_sql_management_client.models.Operation] :param next_link: URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. :type next_link: str @@ -747,6 +1027,32 @@ def __init__( self.next_link = next_link +class RestartParameter(msrest.serialization.Model): + """Represents server restart parameters. + + :param restart_with_failover: Indicates whether to restart the server with failover. + :type restart_with_failover: bool + :param failover_mode: Failover mode. + :type failover_mode: str + """ + + _attribute_map = { + 'restart_with_failover': {'key': 'restartWithFailover', 'type': 'bool'}, + 'failover_mode': {'key': 'failoverMode', 'type': 'str'}, + } + + def __init__( + self, + *, + restart_with_failover: Optional[bool] = None, + failover_mode: Optional[str] = None, + **kwargs + ): + super(RestartParameter, self).__init__(**kwargs) + self.restart_with_failover = restart_with_failover + self.failover_mode = failover_mode + + class TrackedResource(Resource): """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. @@ -815,66 +1121,47 @@ class Server(TrackedResource): :param location: Required. The geo-location where the resource lives. :type location: str :param identity: The Azure Active Directory identity of the server. - :type identity: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Identity + :type identity: ~postgre_sql_management_client.models.Identity :param sku: The SKU (pricing tier) of the server. - :type sku: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Sku + :type sku: ~postgre_sql_management_client.models.Sku + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~postgre_sql_management_client.models.SystemData :param administrator_login: The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). :type administrator_login: str :param administrator_login_password: The administrator login password (required for server creation). :type administrator_login_password: str - :param version: PostgreSQL Server version. Possible values include: "12", "11". - :type version: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerVersion + :param version: PostgreSQL Server version. Possible values include: "13", "12", "11". + :type version: str or ~postgre_sql_management_client.models.ServerVersion + :ivar minor_version: The minor version of the server. + :vartype minor_version: str :ivar state: A state of a server that is visible to user. Possible values include: "Ready", "Dropping", "Disabled", "Starting", "Stopping", "Stopped", "Updating". - :vartype state: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerState - :ivar ha_state: A state of a HA server that is visible to user. Possible values include: - "NotEnabled", "CreatingStandby", "ReplicatingData", "FailingOver", "Healthy", - "RemovingStandby". - :vartype ha_state: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerHAState + :vartype state: str or ~postgre_sql_management_client.models.ServerState :ivar fully_qualified_domain_name: The fully qualified domain name of a server. :vartype fully_qualified_domain_name: str - :param display_name: The display name of a server. - :type display_name: str - :param storage_profile: Storage profile of a server. - :type storage_profile: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.StorageProfile - :ivar public_network_access: public network access is enabled or not. Possible values include: - "Enabled", "Disabled". - :vartype public_network_access: str or - ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerPublicNetworkAccessState - :param maintenance_window: Maintenance window of a server. - :type maintenance_window: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.MaintenanceWindow - :param ha_enabled: stand by count value can be either enabled or disabled. Possible values - include: "Enabled", "Disabled". - :type ha_enabled: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.HAEnabledEnum - :param source_server_name: The source PostgreSQL server name to restore from. - :type source_server_name: str - :param source_subscription_id: The subscription id of source serve PostgreSQL server name to - restore from. - :type source_subscription_id: str - :param source_resource_group_name: The resource group name of source serve PostgreSQL server - name to restore from. - :type source_resource_group_name: str + :param storage: Storage properties of a server. + :type storage: ~postgre_sql_management_client.models.Storage + :param backup: Backup properties of a server. + :type backup: ~postgre_sql_management_client.models.Backup + :param network: Network properties of a server. + :type network: ~postgre_sql_management_client.models.Network + :param high_availability: High availability properties of a server. + :type high_availability: ~postgre_sql_management_client.models.HighAvailability + :param maintenance_window: Maintenance window properties of a server. + :type maintenance_window: ~postgre_sql_management_client.models.MaintenanceWindow + :param source_server_resource_id: The source server resource ID to restore from. It's required + when 'createMode' is 'PointInTimeRestore'. + :type source_server_resource_id: str :param point_in_time_utc: Restore point creation time (ISO8601 format), specifying the time to - restore from. + restore from. It's required when 'createMode' is 'PointInTimeRestore'. :type point_in_time_utc: ~datetime.datetime - :param availability_zone: availability Zone information of the server. + :param availability_zone: availability zone information of the server. :type availability_zone: str - :ivar standby_availability_zone: availability Zone information of the server. - :vartype standby_availability_zone: str - :ivar byok_enforcement: Status showing whether the data encryption is enabled with - customer-managed keys. - :vartype byok_enforcement: str - :param delegated_subnet_arguments: - :type delegated_subnet_arguments: - ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerPropertiesDelegatedSubnetArguments - :param private_dns_zone_arguments: - :type private_dns_zone_arguments: - ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerPropertiesPrivateDnsZoneArguments :param create_mode: The mode to create a new PostgreSQL server. Possible values include: - "Default", "PointInTimeRestore". - :type create_mode: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.CreateMode + "Default", "Create", "Update", "PointInTimeRestore". + :type create_mode: str or ~postgre_sql_management_client.models.CreateMode :param tags_properties_tags: Application-specific metadata in the form of key-value pairs. :type tags_properties_tags: dict[str, str] """ @@ -884,12 +1171,10 @@ class Server(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'minor_version': {'readonly': True}, 'state': {'readonly': True}, - 'ha_state': {'readonly': True}, 'fully_qualified_domain_name': {'readonly': True}, - 'public_network_access': {'readonly': True}, - 'standby_availability_zone': {'readonly': True}, - 'byok_enforcement': {'readonly': True}, } _attribute_map = { @@ -900,26 +1185,21 @@ class Server(TrackedResource): 'location': {'key': 'location', 'type': 'str'}, 'identity': {'key': 'identity', 'type': 'Identity'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, 'version': {'key': 'properties.version', 'type': 'str'}, + 'minor_version': {'key': 'properties.minorVersion', 'type': 'str'}, 'state': {'key': 'properties.state', 'type': 'str'}, - 'ha_state': {'key': 'properties.haState', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'storage': {'key': 'properties.storage', 'type': 'Storage'}, + 'backup': {'key': 'properties.backup', 'type': 'Backup'}, + 'network': {'key': 'properties.network', 'type': 'Network'}, + 'high_availability': {'key': 'properties.highAvailability', 'type': 'HighAvailability'}, 'maintenance_window': {'key': 'properties.maintenanceWindow', 'type': 'MaintenanceWindow'}, - 'ha_enabled': {'key': 'properties.haEnabled', 'type': 'str'}, - 'source_server_name': {'key': 'properties.sourceServerName', 'type': 'str'}, - 'source_subscription_id': {'key': 'properties.sourceSubscriptionId', 'type': 'str'}, - 'source_resource_group_name': {'key': 'properties.sourceResourceGroupName', 'type': 'str'}, + 'source_server_resource_id': {'key': 'properties.sourceServerResourceId', 'type': 'str'}, 'point_in_time_utc': {'key': 'properties.pointInTimeUTC', 'type': 'iso-8601'}, 'availability_zone': {'key': 'properties.availabilityZone', 'type': 'str'}, - 'standby_availability_zone': {'key': 'properties.standbyAvailabilityZone', 'type': 'str'}, - 'byok_enforcement': {'key': 'properties.byokEnforcement', 'type': 'str'}, - 'delegated_subnet_arguments': {'key': 'properties.delegatedSubnetArguments', 'type': 'ServerPropertiesDelegatedSubnetArguments'}, - 'private_dns_zone_arguments': {'key': 'properties.privateDnsZoneArguments', 'type': 'ServerPropertiesPrivateDnsZoneArguments'}, 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, 'tags_properties_tags': {'key': 'properties.tags', 'type': '{str}'}, } @@ -934,17 +1214,14 @@ def __init__( administrator_login: Optional[str] = None, administrator_login_password: Optional[str] = None, version: Optional[Union[str, "ServerVersion"]] = None, - display_name: Optional[str] = None, - storage_profile: Optional["StorageProfile"] = None, + storage: Optional["Storage"] = None, + backup: Optional["Backup"] = None, + network: Optional["Network"] = None, + high_availability: Optional["HighAvailability"] = None, maintenance_window: Optional["MaintenanceWindow"] = None, - ha_enabled: Optional[Union[str, "HAEnabledEnum"]] = None, - source_server_name: Optional[str] = None, - source_subscription_id: Optional[str] = None, - source_resource_group_name: Optional[str] = None, + source_server_resource_id: Optional[str] = None, point_in_time_utc: Optional[datetime.datetime] = None, availability_zone: Optional[str] = None, - delegated_subnet_arguments: Optional["ServerPropertiesDelegatedSubnetArguments"] = None, - private_dns_zone_arguments: Optional["ServerPropertiesPrivateDnsZoneArguments"] = None, create_mode: Optional[Union[str, "CreateMode"]] = None, tags_properties_tags: Optional[Dict[str, str]] = None, **kwargs @@ -952,85 +1229,47 @@ def __init__( super(Server, self).__init__(tags=tags, location=location, **kwargs) self.identity = identity self.sku = sku + self.system_data = None self.administrator_login = administrator_login self.administrator_login_password = administrator_login_password self.version = version + self.minor_version = None self.state = None - self.ha_state = None self.fully_qualified_domain_name = None - self.display_name = display_name - self.storage_profile = storage_profile - self.public_network_access = None + self.storage = storage + self.backup = backup + self.network = network + self.high_availability = high_availability self.maintenance_window = maintenance_window - self.ha_enabled = ha_enabled - self.source_server_name = source_server_name - self.source_subscription_id = source_subscription_id - self.source_resource_group_name = source_resource_group_name + self.source_server_resource_id = source_server_resource_id self.point_in_time_utc = point_in_time_utc self.availability_zone = availability_zone - self.standby_availability_zone = None - self.byok_enforcement = None - self.delegated_subnet_arguments = delegated_subnet_arguments - self.private_dns_zone_arguments = private_dns_zone_arguments self.create_mode = create_mode self.tags_properties_tags = tags_properties_tags -class ServerEditionCapability(msrest.serialization.Model): - """Server edition capabilities. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Server edition name. - :vartype name: str - :ivar supported_storage_editions: - :vartype supported_storage_editions: - list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.StorageEditionCapability] - :ivar supported_server_versions: - :vartype supported_server_versions: - list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerVersionCapability] - """ - - _validation = { - 'name': {'readonly': True}, - 'supported_storage_editions': {'readonly': True}, - 'supported_server_versions': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'supported_storage_editions': {'key': 'supportedStorageEditions', 'type': '[StorageEditionCapability]'}, - 'supported_server_versions': {'key': 'supportedServerVersions', 'type': '[ServerVersionCapability]'}, - } - - def __init__( - self, - **kwargs - ): - super(ServerEditionCapability, self).__init__(**kwargs) - self.name = None - self.supported_storage_editions = None - self.supported_server_versions = None - - class ServerForUpdate(msrest.serialization.Model): """Represents a server to be updated. :param location: The location the resource resides in. :type location: str :param sku: The SKU (pricing tier) of the server. - :type sku: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Sku + :type sku: ~postgre_sql_management_client.models.Sku :param tags: A set of tags. Application-specific metadata in the form of key-value pairs. :type tags: dict[str, str] :param administrator_login_password: The password of the administrator login. :type administrator_login_password: str - :param storage_profile: Storage profile of a server. - :type storage_profile: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.StorageProfile - :param ha_enabled: stand by count value can be either enabled or disabled. Possible values - include: "Enabled", "Disabled". - :type ha_enabled: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.HAEnabledEnum - :param maintenance_window: Maintenance window of a server. - :type maintenance_window: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.MaintenanceWindow + :param storage: Storage properties of a server. + :type storage: ~postgre_sql_management_client.models.Storage + :param backup: Backup properties of a server. + :type backup: ~postgre_sql_management_client.models.Backup + :param high_availability: High availability properties of a server. + :type high_availability: ~postgre_sql_management_client.models.HighAvailability + :param maintenance_window: Maintenance window properties of a server. + :type maintenance_window: ~postgre_sql_management_client.models.MaintenanceWindow + :param create_mode: The mode to update a new PostgreSQL server. Possible values include: + "Default", "Update". + :type create_mode: str or ~postgre_sql_management_client.models.CreateModeForUpdate """ _attribute_map = { @@ -1038,9 +1277,11 @@ class ServerForUpdate(msrest.serialization.Model): 'sku': {'key': 'sku', 'type': 'Sku'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, - 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, - 'ha_enabled': {'key': 'properties.haEnabled', 'type': 'str'}, + 'storage': {'key': 'properties.storage', 'type': 'Storage'}, + 'backup': {'key': 'properties.backup', 'type': 'Backup'}, + 'high_availability': {'key': 'properties.highAvailability', 'type': 'HighAvailability'}, 'maintenance_window': {'key': 'properties.maintenanceWindow', 'type': 'MaintenanceWindow'}, + 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, } def __init__( @@ -1050,9 +1291,11 @@ def __init__( sku: Optional["Sku"] = None, tags: Optional[Dict[str, str]] = None, administrator_login_password: Optional[str] = None, - storage_profile: Optional["StorageProfile"] = None, - ha_enabled: Optional[Union[str, "HAEnabledEnum"]] = None, + storage: Optional["Storage"] = None, + backup: Optional["Backup"] = None, + high_availability: Optional["HighAvailability"] = None, maintenance_window: Optional["MaintenanceWindow"] = None, + create_mode: Optional[Union[str, "CreateModeForUpdate"]] = None, **kwargs ): super(ServerForUpdate, self).__init__(**kwargs) @@ -1060,16 +1303,18 @@ def __init__( self.sku = sku self.tags = tags self.administrator_login_password = administrator_login_password - self.storage_profile = storage_profile - self.ha_enabled = ha_enabled + self.storage = storage + self.backup = backup + self.high_availability = high_availability self.maintenance_window = maintenance_window + self.create_mode = create_mode class ServerListResult(msrest.serialization.Model): """A list of servers. :param value: The list of flexible servers. - :type value: list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.Server] + :type value: list[~postgre_sql_management_client.models.Server] :param next_link: The link used to get the next page of operations. :type next_link: str """ @@ -1091,48 +1336,6 @@ def __init__( self.next_link = next_link -class ServerPropertiesDelegatedSubnetArguments(msrest.serialization.Model): - """ServerPropertiesDelegatedSubnetArguments. - - :param subnet_arm_resource_id: delegated subnet arm resource id. - :type subnet_arm_resource_id: str - """ - - _attribute_map = { - 'subnet_arm_resource_id': {'key': 'subnetArmResourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - subnet_arm_resource_id: Optional[str] = None, - **kwargs - ): - super(ServerPropertiesDelegatedSubnetArguments, self).__init__(**kwargs) - self.subnet_arm_resource_id = subnet_arm_resource_id - - -class ServerPropertiesPrivateDnsZoneArguments(msrest.serialization.Model): - """ServerPropertiesPrivateDnsZoneArguments. - - :param private_dns_zone_arm_resource_id: private dns zone arm resource id. - :type private_dns_zone_arm_resource_id: str - """ - - _attribute_map = { - 'private_dns_zone_arm_resource_id': {'key': 'privateDnsZoneArmResourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - private_dns_zone_arm_resource_id: Optional[str] = None, - **kwargs - ): - super(ServerPropertiesPrivateDnsZoneArguments, self).__init__(**kwargs) - self.private_dns_zone_arm_resource_id = private_dns_zone_arm_resource_id - - class ServerVersionCapability(msrest.serialization.Model): """Server version capabilities. @@ -1141,18 +1344,21 @@ class ServerVersionCapability(msrest.serialization.Model): :ivar name: server version. :vartype name: str :ivar supported_vcores: - :vartype supported_vcores: - list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.VcoreCapability] + :vartype supported_vcores: list[~postgre_sql_management_client.models.VcoreCapability] + :ivar status: The status. + :vartype status: str """ _validation = { 'name': {'readonly': True}, 'supported_vcores': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'supported_vcores': {'key': 'supportedVcores', 'type': '[VcoreCapability]'}, + 'status': {'key': 'status', 'type': 'str'}, } def __init__( @@ -1162,6 +1368,7 @@ def __init__( super(ServerVersionCapability, self).__init__(**kwargs) self.name = None self.supported_vcores = None + self.status = None class Sku(msrest.serialization.Model): @@ -1174,7 +1381,7 @@ class Sku(msrest.serialization.Model): :type name: str :param tier: Required. The tier of the particular SKU, e.g. Burstable. Possible values include: "Burstable", "GeneralPurpose", "MemoryOptimized". - :type tier: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.SkuTier + :type tier: str or ~postgre_sql_management_client.models.SkuTier """ _validation = { @@ -1199,6 +1406,27 @@ def __init__( self.tier = tier +class Storage(msrest.serialization.Model): + """Storage properties of a server. + + :param storage_size_gb: Max storage allowed for a server. + :type storage_size_gb: int + """ + + _attribute_map = { + 'storage_size_gb': {'key': 'storageSizeGB', 'type': 'int'}, + } + + def __init__( + self, + *, + storage_size_gb: Optional[int] = None, + **kwargs + ): + super(Storage, self).__init__(**kwargs) + self.storage_size_gb = storage_size_gb + + class StorageEditionCapability(msrest.serialization.Model): """storage edition capability. @@ -1207,18 +1435,21 @@ class StorageEditionCapability(msrest.serialization.Model): :ivar name: storage edition name. :vartype name: str :ivar supported_storage_mb: - :vartype supported_storage_mb: - list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.StorageMBCapability] + :vartype supported_storage_mb: list[~postgre_sql_management_client.models.StorageMBCapability] + :ivar status: The status. + :vartype status: str """ _validation = { 'name': {'readonly': True}, 'supported_storage_mb': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'supported_storage_mb': {'key': 'supportedStorageMB', 'type': '[StorageMBCapability]'}, + 'status': {'key': 'status', 'type': 'str'}, } def __init__( @@ -1228,6 +1459,7 @@ def __init__( super(StorageEditionCapability, self).__init__(**kwargs) self.name = None self.supported_storage_mb = None + self.status = None class StorageMBCapability(msrest.serialization.Model): @@ -1241,18 +1473,22 @@ class StorageMBCapability(msrest.serialization.Model): :vartype supported_iops: long :ivar storage_size_mb: storage size in MB. :vartype storage_size_mb: long + :ivar status: The status. + :vartype status: str """ _validation = { 'name': {'readonly': True}, 'supported_iops': {'readonly': True}, 'storage_size_mb': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'supported_iops': {'key': 'supportedIops', 'type': 'long'}, 'storage_size_mb': {'key': 'storageSizeMB', 'type': 'long'}, + 'status': {'key': 'status', 'type': 'str'}, } def __init__( @@ -1263,32 +1499,55 @@ def __init__( self.name = None self.supported_iops = None self.storage_size_mb = None - - -class StorageProfile(msrest.serialization.Model): - """Storage Profile properties of a server. - - :param backup_retention_days: Backup retention days for the server. - :type backup_retention_days: int - :param storage_mb: Max storage allowed for a server. - :type storage_mb: int + self.status = None + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~postgre_sql_management_client.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~postgre_sql_management_client.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime """ _attribute_map = { - 'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'}, - 'storage_mb': {'key': 'storageMB', 'type': 'int'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, } def __init__( self, *, - backup_retention_days: Optional[int] = None, - storage_mb: Optional[int] = None, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, **kwargs ): - super(StorageProfile, self).__init__(**kwargs) - self.backup_retention_days = backup_retention_days - self.storage_mb = storage_mb + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at class VcoreCapability(msrest.serialization.Model): @@ -1304,6 +1563,8 @@ class VcoreCapability(msrest.serialization.Model): :vartype supported_iops: long :ivar supported_memory_per_vcore_mb: supported memory per vCore in MB. :vartype supported_memory_per_vcore_mb: long + :ivar status: The status. + :vartype status: str """ _validation = { @@ -1311,6 +1572,7 @@ class VcoreCapability(msrest.serialization.Model): 'v_cores': {'readonly': True}, 'supported_iops': {'readonly': True}, 'supported_memory_per_vcore_mb': {'readonly': True}, + 'status': {'readonly': True}, } _attribute_map = { @@ -1318,6 +1580,7 @@ class VcoreCapability(msrest.serialization.Model): 'v_cores': {'key': 'vCores', 'type': 'long'}, 'supported_iops': {'key': 'supportedIops', 'type': 'long'}, 'supported_memory_per_vcore_mb': {'key': 'supportedMemoryPerVcoreMB', 'type': 'long'}, + 'status': {'key': 'status', 'type': 'str'}, } def __init__( @@ -1329,6 +1592,7 @@ def __init__( self.v_cores = None self.supported_iops = None self.supported_memory_per_vcore_mb = None + self.status = None class VirtualNetworkSubnetUsageParameter(msrest.serialization.Model): @@ -1359,7 +1623,7 @@ class VirtualNetworkSubnetUsageResult(msrest.serialization.Model): :ivar delegated_subnets_usage: :vartype delegated_subnets_usage: - list[~azure.mgmt.rdbms.postgresql_flexibleservers.models.DelegatedSubnetUsage] + list[~postgre_sql_management_client.models.DelegatedSubnetUsage] """ _validation = { diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_postgre_sql_management_client_enums.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_postgre_sql_management_client_enums.py index 2230483881b9..90494cca3f20 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_postgre_sql_management_client_enums.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/models/_postgre_sql_management_client_enums.py @@ -35,28 +35,45 @@ class ConfigurationDataType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) INTEGER = "Integer" ENUMERATION = "Enumeration" +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + class CreateMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The mode to create a new PostgreSQL server. """ DEFAULT = "Default" + CREATE = "Create" + UPDATE = "Update" POINT_IN_TIME_RESTORE = "PointInTimeRestore" -class Enum8(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class CreateModeForUpdate(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The mode to update a new PostgreSQL server. + """ - POSTGRE_SQL = "PostgreSQL" - POSTGRE_SQL_CITUS = "PostgreSQLCitus" - MY_SQL = "MySQL" - MARIA_DB = "MariaDb" - ORACLE = "Oracle" + DEFAULT = "Default" + UPDATE = "Update" -class HAEnabledEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """stand by count value can be either enabled or disabled +class GeoRedundantBackupEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """A value indicating whether Geo-Redundant backup is enabled on the server. """ ENABLED = "Enabled" DISABLED = "Disabled" +class HighAvailabilityMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The HA mode for the server. + """ + + DISABLED = "Disabled" + ZONE_REDUNDANT = "ZoneRedundant" + class OperationOrigin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The intended executor of the operation. """ @@ -99,6 +116,7 @@ class ServerVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The version of a server. """ + THIRTEEN = "13" TWELVE = "12" ELEVEN = "11" diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_check_name_availability_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_check_name_availability_operations.py index 4893fa8d7f83..3760ae3ce9af 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_check_name_availability_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_check_name_availability_operations.py @@ -29,7 +29,7 @@ class CheckNameAvailabilityOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.rdbms.postgresql_flexibleservers.models + :type models: ~postgre_sql_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -54,10 +54,10 @@ def execute( :param name_availability_request: The required parameters for checking if resource name is available. - :type name_availability_request: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.NameAvailabilityRequest + :type name_availability_request: ~postgre_sql_management_client.models.NameAvailabilityRequest :keyword callable cls: A custom type or function that will be passed the direct response :return: NameAvailability, or the result of cls(response) - :rtype: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.NameAvailability + :rtype: ~postgre_sql_management_client.models.NameAvailability :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NameAvailability"] @@ -65,7 +65,7 @@ def execute( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_configurations_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_configurations_operations.py index 04ba38ad413b..4c035619a459 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_configurations_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_configurations_operations.py @@ -32,7 +32,7 @@ class ConfigurationsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.rdbms.postgresql_flexibleservers.models + :type models: ~postgre_sql_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -62,7 +62,7 @@ def list_by_server( :type server_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.rdbms.postgresql_flexibleservers.models.ConfigurationListResult] + :rtype: ~azure.core.paging.ItemPaged[~postgre_sql_management_client.models.ConfigurationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationListResult"] @@ -70,7 +70,7 @@ def list_by_server( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -83,7 +83,7 @@ def prepare_request(next_link=None): url = self.list_by_server.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -140,7 +140,7 @@ def get( :type configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Configuration, or the result of cls(response) - :rtype: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Configuration + :rtype: ~postgre_sql_management_client.models.Configuration :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Configuration"] @@ -148,14 +148,14 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), } @@ -199,7 +199,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -207,7 +207,7 @@ def _update_initial( url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), } @@ -261,15 +261,15 @@ def begin_update( :param configuration_name: The name of the server configuration. :type configuration_name: str :param parameters: The required parameters for updating a server configuration. - :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Configuration + :type parameters: ~postgre_sql_management_client.models.Configuration :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either Configuration or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.rdbms.postgresql_flexibleservers.models.Configuration] + :rtype: ~azure.core.polling.LROPoller[~postgre_sql_management_client.models.Configuration] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -301,7 +301,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), } @@ -319,3 +319,138 @@ def get_long_running_output(pipeline_response): else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/flexibleServers/{serverName}/configurations/{configurationName}'} # type: ignore + + def _put_initial( + self, + resource_group_name, # type: str + server_name, # type: str + configuration_name, # type: str + parameters, # type: "_models.Configuration" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.Configuration"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Configuration"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._put_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + '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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Configuration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Configuration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _put_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/flexibleServers/{serverName}/configurations/{configurationName}'} # type: ignore + + def begin_put( + self, + resource_group_name, # type: str + server_name, # type: str + configuration_name, # type: str + parameters, # type: "_models.Configuration" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Configuration"] + """Updates a configuration of a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :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 parameters: The required parameters for updating a server configuration. + :type parameters: ~postgre_sql_management_client.models.Configuration + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either Configuration or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~postgre_sql_management_client.models.Configuration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Configuration"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_initial( + resource_group_name=resource_group_name, + server_name=server_name, + configuration_name=configuration_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Configuration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForPostgreSql/flexibleServers/{serverName}/configurations/{configurationName}'} # type: ignore diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_databases_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_databases_operations.py index 8aa3e49737a8..d85989b879b6 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_databases_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_databases_operations.py @@ -32,7 +32,7 @@ class DatabasesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.rdbms.postgresql_flexibleservers.models + :type models: ~postgre_sql_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -61,7 +61,7 @@ def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-05-preview" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -69,7 +69,7 @@ def _create_initial( url = self._create_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), } @@ -126,15 +126,15 @@ def begin_create( :param database_name: The name of the database. :type database_name: str :param parameters: The required parameters for creating or updating a database. - :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Database + :type parameters: ~postgre_sql_management_client.models.Database :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either Database or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.rdbms.postgresql_flexibleservers.models.Database] + :rtype: ~azure.core.polling.LROPoller[~postgre_sql_management_client.models.Database] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -166,7 +166,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), } @@ -198,14 +198,14 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-05-preview" + api_version = "2021-06-01" accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), } @@ -250,8 +250,8 @@ def begin_delete( :type database_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -283,7 +283,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), } @@ -320,7 +320,7 @@ def get( :type database_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Database, or the result of cls(response) - :rtype: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Database + :rtype: ~postgre_sql_management_client.models.Database :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Database"] @@ -328,14 +328,14 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-05-preview" + api_version = "2021-06-01" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), } @@ -380,7 +380,7 @@ def list_by_server( :type server_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatabaseListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.rdbms.postgresql_flexibleservers.models.DatabaseListResult] + :rtype: ~azure.core.paging.ItemPaged[~postgre_sql_management_client.models.DatabaseListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DatabaseListResult"] @@ -388,7 +388,7 @@ def list_by_server( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-05-preview" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -401,7 +401,7 @@ def prepare_request(next_link=None): url = self.list_by_server.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_firewall_rules_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_firewall_rules_operations.py index a53ff86700d0..6650f2475fd4 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_firewall_rules_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_firewall_rules_operations.py @@ -32,7 +32,7 @@ class FirewallRulesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.rdbms.postgresql_flexibleservers.models + :type models: ~postgre_sql_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -61,7 +61,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -69,7 +69,7 @@ def _create_or_update_initial( url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str'), } @@ -126,15 +126,15 @@ def begin_create_or_update( :param firewall_rule_name: The name of the server firewall rule. :type firewall_rule_name: str :param parameters: The required parameters for creating or updating a firewall rule. - :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.FirewallRule + :type parameters: ~postgre_sql_management_client.models.FirewallRule :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either FirewallRule or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.rdbms.postgresql_flexibleservers.models.FirewallRule] + :rtype: ~azure.core.polling.LROPoller[~postgre_sql_management_client.models.FirewallRule] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -166,7 +166,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str'), } @@ -198,14 +198,14 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str'), } @@ -250,8 +250,8 @@ def begin_delete( :type firewall_rule_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -283,7 +283,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str'), } @@ -320,7 +320,7 @@ def get( :type firewall_rule_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: FirewallRule, or the result of cls(response) - :rtype: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.FirewallRule + :rtype: ~postgre_sql_management_client.models.FirewallRule :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallRule"] @@ -328,14 +328,14 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str'), } @@ -380,7 +380,7 @@ def list_by_server( :type server_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either FirewallRuleListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.rdbms.postgresql_flexibleservers.models.FirewallRuleListResult] + :rtype: ~azure.core.paging.ItemPaged[~postgre_sql_management_client.models.FirewallRuleListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.FirewallRuleListResult"] @@ -388,7 +388,7 @@ def list_by_server( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -401,7 +401,7 @@ def prepare_request(next_link=None): url = self.list_by_server.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_get_private_dns_zone_suffix_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_get_private_dns_zone_suffix_operations.py index f407e6dbae0b..b1d9e86b0460 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_get_private_dns_zone_suffix_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_get_private_dns_zone_suffix_operations.py @@ -17,7 +17,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -29,7 +29,7 @@ class GetPrivateDnsZoneSuffixOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.rdbms.postgresql_flexibleservers.models + :type models: ~postgre_sql_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -46,14 +46,11 @@ def __init__(self, client, config, serializer, deserializer): def execute( self, - body, # type: Union[str, "_models.Enum8"] **kwargs # type: Any ): # type: (...) -> str """Get private DNS zone suffix in the cloud. - :param body: The required parameters for getting private DNS zone suffix based on server type. - :type body: str or ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Enum8 :keyword callable cls: A custom type or function that will be passed the direct response :return: str, or the result of cls(response) :rtype: str @@ -64,16 +61,11 @@ def execute( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-31-privatepreview" - content_type = kwargs.pop("content_type", "application/json") + api_version = "2021-06-01" accept = "application/json" # Construct URL url = self.execute.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] @@ -81,13 +73,9 @@ def execute( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(body, 'str') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -101,4 +89,4 @@ def execute( return cls(pipeline_response, deserialized, {}) return deserialized - execute.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DBForPostgreSql/getPrivateDnsZoneSuffix'} # type: ignore + execute.metadata = {'url': '/providers/Microsoft.DBForPostgreSql/getPrivateDnsZoneSuffix'} # type: ignore diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_location_based_capabilities_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_location_based_capabilities_operations.py index 79264b3e42d0..bea3e3df01c0 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_location_based_capabilities_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_location_based_capabilities_operations.py @@ -30,7 +30,7 @@ class LocationBasedCapabilitiesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.rdbms.postgresql_flexibleservers.models + :type models: ~postgre_sql_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -57,7 +57,7 @@ def execute( :type location_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CapabilitiesListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.rdbms.postgresql_flexibleservers.models.CapabilitiesListResult] + :rtype: ~azure.core.paging.ItemPaged[~postgre_sql_management_client.models.CapabilitiesListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CapabilitiesListResult"] @@ -65,7 +65,7 @@ def execute( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_operations.py index 31e7a96a1723..203bc33a6eb7 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_operations.py @@ -29,7 +29,7 @@ class Operations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.rdbms.postgresql_flexibleservers.models + :type models: ~postgre_sql_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -53,7 +53,7 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: OperationListResult, or the result of cls(response) - :rtype: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.OperationListResult + :rtype: ~postgre_sql_management_client.models.OperationListResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] @@ -61,7 +61,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" # Construct URL diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_servers_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_servers_operations.py index 01bcf8c34e99..6d10f6d6a546 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_servers_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_servers_operations.py @@ -32,7 +32,7 @@ class ServersOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.rdbms.postgresql_flexibleservers.models + :type models: ~postgre_sql_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,7 +60,7 @@ def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -68,7 +68,7 @@ def _create_initial( url = self._create_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -121,15 +121,15 @@ def begin_create( :param server_name: The name of the server. :type server_name: str :param parameters: The required parameters for creating or updating a server. - :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Server + :type parameters: ~postgre_sql_management_client.models.Server :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either Server or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.rdbms.postgresql_flexibleservers.models.Server] + :rtype: ~azure.core.polling.LROPoller[~postgre_sql_management_client.models.Server] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -160,7 +160,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } @@ -191,7 +191,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -199,7 +199,7 @@ def _update_initial( url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -250,15 +250,15 @@ def begin_update( :param server_name: The name of the server. :type server_name: str :param parameters: The required parameters for updating a server. - :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerForUpdate + :type parameters: ~postgre_sql_management_client.models.ServerForUpdate :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either Server or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.rdbms.postgresql_flexibleservers.models.Server] + :rtype: ~azure.core.polling.LROPoller[~postgre_sql_management_client.models.Server] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -289,7 +289,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } @@ -319,14 +319,14 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -367,8 +367,8 @@ def begin_delete( :type server_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -399,7 +399,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } @@ -432,7 +432,7 @@ def get( :type server_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Server, or the result of cls(response) - :rtype: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.Server + :rtype: ~postgre_sql_management_client.models.Server :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.Server"] @@ -440,14 +440,14 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -488,7 +488,7 @@ def list_by_resource_group( :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServerListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerListResult] + :rtype: ~azure.core.paging.ItemPaged[~postgre_sql_management_client.models.ServerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerListResult"] @@ -496,7 +496,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -509,7 +509,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -556,7 +556,7 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ServerListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.rdbms.postgresql_flexibleservers.models.ServerListResult] + :rtype: ~azure.core.paging.ItemPaged[~postgre_sql_management_client.models.ServerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerListResult"] @@ -564,7 +564,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -618,6 +618,7 @@ def _restart_initial( self, resource_group_name, # type: str server_name, # type: str + parameters=None, # type: Optional["_models.RestartParameter"] **kwargs # type: Any ): # type: (...) -> None @@ -626,14 +627,15 @@ def _restart_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" + content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL url = self._restart_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -644,9 +646,16 @@ def _restart_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.post(url, query_parameters, header_parameters) + body_content_kwargs = {} # type: Dict[str, Any] + if parameters is not None: + body_content = self._serialize.body(parameters, 'RestartParameter') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -663,6 +672,7 @@ def begin_restart( self, resource_group_name, # type: str server_name, # type: str + parameters=None, # type: Optional["_models.RestartParameter"] **kwargs # type: Any ): # type: (...) -> LROPoller[None] @@ -672,10 +682,12 @@ def begin_restart( :type resource_group_name: str :param server_name: The name of the server. :type server_name: str + :param parameters: The parameters for restarting a server. + :type parameters: ~postgre_sql_management_client.models.RestartParameter :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -693,6 +705,7 @@ def begin_restart( raw_result = self._restart_initial( resource_group_name=resource_group_name, server_name=server_name, + parameters=parameters, cls=lambda x,y,z: x, **kwargs ) @@ -706,7 +719,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } @@ -736,14 +749,14 @@ def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" # Construct URL url = self._start_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -784,8 +797,8 @@ def begin_start( :type server_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -816,7 +829,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } @@ -846,14 +859,14 @@ def _stop_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" accept = "application/json" # Construct URL url = self._stop_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -894,8 +907,8 @@ def begin_stop( :type server_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -926,7 +939,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'serverName': self._serialize.url("server_name", server_name, 'str'), } diff --git a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_virtual_network_subnet_usage_operations.py b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_virtual_network_subnet_usage_operations.py index f32167995119..12b659c8c7b5 100644 --- a/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_virtual_network_subnet_usage_operations.py +++ b/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_virtual_network_subnet_usage_operations.py @@ -29,7 +29,7 @@ class VirtualNetworkSubnetUsageOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.rdbms.postgresql_flexibleservers.models + :type models: ~postgre_sql_management_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -56,10 +56,10 @@ def execute( :param location_name: The name of the location. :type location_name: str :param parameters: The required parameters for creating or updating a server. - :type parameters: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.VirtualNetworkSubnetUsageParameter + :type parameters: ~postgre_sql_management_client.models.VirtualNetworkSubnetUsageParameter :keyword callable cls: A custom type or function that will be passed the direct response :return: VirtualNetworkSubnetUsageResult, or the result of cls(response) - :rtype: ~azure.mgmt.rdbms.postgresql_flexibleservers.models.VirtualNetworkSubnetUsageResult + :rtype: ~postgre_sql_management_client.models.VirtualNetworkSubnetUsageResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkSubnetUsageResult"] @@ -67,7 +67,7 @@ def execute( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-14-preview" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json"