From 14157689d9dbaec283121b616f20fcf349a1f50e Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 23 Apr 2019 13:45:40 -0700 Subject: [PATCH] [AutoPR sql/resource-manager] [DO NOT MERGE] Managed instance updates plus examples (#4930) * Generated from 55ed369558052bec088510af32b4edcf2c58a43e Remove unused def * Generated from b7b23d950a94b03265f4552e40951c176c8652af Fix managed instance create max public endpoint value --- .../azure/mgmt/sql/models/__init__.py | 6 +- .../azure/mgmt/sql/models/managed_instance.py | 47 +++- .../mgmt/sql/models/managed_instance_py3.py | 49 ++++- .../sql/models/managed_instance_update.py | 44 +++- .../sql/models/managed_instance_update_py3.py | 46 +++- .../sql/models/sql_management_client_enums.py | 11 +- .../managed_instances_operations.py | 200 ++++++++++++------ 7 files changed, 298 insertions(+), 105 deletions(-) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py b/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py index 0a543180d7e4..3f32d3e0dc2d 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py @@ -412,7 +412,8 @@ ReadOnlyEndpointFailoverPolicy, FailoverGroupReplicationRole, IdentityType, - ManagedInstanceProxyOverride, + ManagedServerCreateMode, + ManagedInstanceLicenseType, OperationOrigin, SyncAgentState, SyncMemberDbType, @@ -709,7 +710,8 @@ 'ReadOnlyEndpointFailoverPolicy', 'FailoverGroupReplicationRole', 'IdentityType', - 'ManagedInstanceProxyOverride', + 'ManagedServerCreateMode', + 'ManagedInstanceLicenseType', 'OperationOrigin', 'SyncAgentState', 'SyncMemberDbType', diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance.py index cf680e0ddac0..a3f070a69d6e 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance.py @@ -33,8 +33,17 @@ class ManagedInstance(TrackedResource): :param identity: The Azure Active Directory identity of the managed instance. :type identity: ~azure.mgmt.sql.models.ResourceIdentity - :param sku: Managed instance sku + :param sku: Managed instance SKU. Allowed values for sku.name: GP_Gen4, + GP_Gen5, BC_Gen4, BC_Gen5 :type sku: ~azure.mgmt.sql.models.Sku + :param managed_instance_create_mode: Specifies the mode of database + creation. + Default: Regular instance creation. + Restore: Creates an instance by restoring a set of backups to specific + point in time. RestorePointInTime and SourceManagedInstanceId must be + specified. Possible values include: 'Default', 'PointInTimeRestore' + :type managed_instance_create_mode: str or + ~azure.mgmt.sql.models.ManagedServerCreateMode :ivar fully_qualified_domain_name: The fully qualified domain name of the managed instance. :vartype fully_qualified_domain_name: str @@ -50,11 +59,16 @@ class ManagedInstance(TrackedResource): :ivar state: The state of the managed instance. :vartype state: str :param license_type: The license type. Possible values are - 'LicenseIncluded' and 'BasePrice'. - :type license_type: str - :param v_cores: The number of VCores. + 'LicenseIncluded' (regular price inclusive of a new SQL license) and + 'BasePrice' (discounted AHB price for bringing your own SQL licenses). + Possible values include: 'LicenseIncluded', 'BasePrice' + :type license_type: str or + ~azure.mgmt.sql.models.ManagedInstanceLicenseType + :param v_cores: The number of vCores. Allowed values: 8, 16, 24, 32, 40, + 64, 80. :type v_cores: int - :param storage_size_in_gb: The maximum storage size in GB. + :param storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum + value: 8192. Increments of 32 GB allowed only. :type storage_size_in_gb: int :param collation: Collation of the managed instance. :type collation: str @@ -66,10 +80,14 @@ class ManagedInstance(TrackedResource): :param public_data_endpoint_enabled: Whether or not the public data endpoint is enabled. :type public_data_endpoint_enabled: bool - :param proxy_override: Connection type used for connecting to the - instance. Possible values include: 'Proxy', 'Redirect', 'Default' - :type proxy_override: str or - ~azure.mgmt.sql.models.ManagedInstanceProxyOverride + :param source_managed_instance_id: The resource identifier of the source + managed instance associated with create operation of this instance. + :type source_managed_instance_id: str + :param restore_point_in_time: Specifies the point in time (ISO8601 format) + of the source database that will be restored to create the new database. + :type restore_point_in_time: datetime + :param proxy_override: Proxy override of the managed instance. + :type proxy_override: str :param timezone_id: Id of the timezone. Allowed values are timezones supported by Windows. Windows keeps details on supported timezones, including the id, in @@ -83,6 +101,9 @@ class ManagedInstance(TrackedResource): An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". :type timezone_id: str + :param instance_pool_id: The Id of the instance pool this managed server + belongs to. + :type instance_pool_id: str """ _validation = { @@ -103,6 +124,7 @@ class ManagedInstance(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'managed_instance_create_mode': {'key': 'properties.managedInstanceCreateMode', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, @@ -115,14 +137,18 @@ class ManagedInstance(TrackedResource): 'dns_zone': {'key': 'properties.dnsZone', 'type': 'str'}, 'dns_zone_partner': {'key': 'properties.dnsZonePartner', 'type': 'str'}, 'public_data_endpoint_enabled': {'key': 'properties.publicDataEndpointEnabled', 'type': 'bool'}, + 'source_managed_instance_id': {'key': 'properties.sourceManagedInstanceId', 'type': 'str'}, + 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, 'proxy_override': {'key': 'properties.proxyOverride', 'type': 'str'}, 'timezone_id': {'key': 'properties.timezoneId', 'type': 'str'}, + 'instance_pool_id': {'key': 'properties.instancePoolId', 'type': 'str'}, } def __init__(self, **kwargs): super(ManagedInstance, self).__init__(**kwargs) self.identity = kwargs.get('identity', None) self.sku = kwargs.get('sku', None) + self.managed_instance_create_mode = kwargs.get('managed_instance_create_mode', None) self.fully_qualified_domain_name = None self.administrator_login = kwargs.get('administrator_login', None) self.administrator_login_password = kwargs.get('administrator_login_password', None) @@ -135,5 +161,8 @@ def __init__(self, **kwargs): self.dns_zone = None self.dns_zone_partner = kwargs.get('dns_zone_partner', None) self.public_data_endpoint_enabled = kwargs.get('public_data_endpoint_enabled', None) + self.source_managed_instance_id = kwargs.get('source_managed_instance_id', None) + self.restore_point_in_time = kwargs.get('restore_point_in_time', None) self.proxy_override = kwargs.get('proxy_override', None) self.timezone_id = kwargs.get('timezone_id', None) + self.instance_pool_id = kwargs.get('instance_pool_id', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_py3.py index 9233da80dae4..38dc3f8d34e8 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_py3.py @@ -33,8 +33,17 @@ class ManagedInstance(TrackedResource): :param identity: The Azure Active Directory identity of the managed instance. :type identity: ~azure.mgmt.sql.models.ResourceIdentity - :param sku: Managed instance sku + :param sku: Managed instance SKU. Allowed values for sku.name: GP_Gen4, + GP_Gen5, BC_Gen4, BC_Gen5 :type sku: ~azure.mgmt.sql.models.Sku + :param managed_instance_create_mode: Specifies the mode of database + creation. + Default: Regular instance creation. + Restore: Creates an instance by restoring a set of backups to specific + point in time. RestorePointInTime and SourceManagedInstanceId must be + specified. Possible values include: 'Default', 'PointInTimeRestore' + :type managed_instance_create_mode: str or + ~azure.mgmt.sql.models.ManagedServerCreateMode :ivar fully_qualified_domain_name: The fully qualified domain name of the managed instance. :vartype fully_qualified_domain_name: str @@ -50,11 +59,16 @@ class ManagedInstance(TrackedResource): :ivar state: The state of the managed instance. :vartype state: str :param license_type: The license type. Possible values are - 'LicenseIncluded' and 'BasePrice'. - :type license_type: str - :param v_cores: The number of VCores. + 'LicenseIncluded' (regular price inclusive of a new SQL license) and + 'BasePrice' (discounted AHB price for bringing your own SQL licenses). + Possible values include: 'LicenseIncluded', 'BasePrice' + :type license_type: str or + ~azure.mgmt.sql.models.ManagedInstanceLicenseType + :param v_cores: The number of vCores. Allowed values: 8, 16, 24, 32, 40, + 64, 80. :type v_cores: int - :param storage_size_in_gb: The maximum storage size in GB. + :param storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum + value: 8192. Increments of 32 GB allowed only. :type storage_size_in_gb: int :param collation: Collation of the managed instance. :type collation: str @@ -66,10 +80,14 @@ class ManagedInstance(TrackedResource): :param public_data_endpoint_enabled: Whether or not the public data endpoint is enabled. :type public_data_endpoint_enabled: bool - :param proxy_override: Connection type used for connecting to the - instance. Possible values include: 'Proxy', 'Redirect', 'Default' - :type proxy_override: str or - ~azure.mgmt.sql.models.ManagedInstanceProxyOverride + :param source_managed_instance_id: The resource identifier of the source + managed instance associated with create operation of this instance. + :type source_managed_instance_id: str + :param restore_point_in_time: Specifies the point in time (ISO8601 format) + of the source database that will be restored to create the new database. + :type restore_point_in_time: datetime + :param proxy_override: Proxy override of the managed instance. + :type proxy_override: str :param timezone_id: Id of the timezone. Allowed values are timezones supported by Windows. Windows keeps details on supported timezones, including the id, in @@ -83,6 +101,9 @@ class ManagedInstance(TrackedResource): An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". :type timezone_id: str + :param instance_pool_id: The Id of the instance pool this managed server + belongs to. + :type instance_pool_id: str """ _validation = { @@ -103,6 +124,7 @@ class ManagedInstance(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'managed_instance_create_mode': {'key': 'properties.managedInstanceCreateMode', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, @@ -115,14 +137,18 @@ class ManagedInstance(TrackedResource): 'dns_zone': {'key': 'properties.dnsZone', 'type': 'str'}, 'dns_zone_partner': {'key': 'properties.dnsZonePartner', 'type': 'str'}, 'public_data_endpoint_enabled': {'key': 'properties.publicDataEndpointEnabled', 'type': 'bool'}, + 'source_managed_instance_id': {'key': 'properties.sourceManagedInstanceId', 'type': 'str'}, + 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, 'proxy_override': {'key': 'properties.proxyOverride', 'type': 'str'}, 'timezone_id': {'key': 'properties.timezoneId', 'type': 'str'}, + 'instance_pool_id': {'key': 'properties.instancePoolId', 'type': 'str'}, } - def __init__(self, *, location: str, tags=None, identity=None, sku=None, administrator_login: str=None, administrator_login_password: str=None, subnet_id: str=None, license_type: str=None, v_cores: int=None, storage_size_in_gb: int=None, collation: str=None, dns_zone_partner: str=None, public_data_endpoint_enabled: bool=None, proxy_override=None, timezone_id: str=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, identity=None, sku=None, managed_instance_create_mode=None, administrator_login: str=None, administrator_login_password: str=None, subnet_id: str=None, license_type=None, v_cores: int=None, storage_size_in_gb: int=None, collation: str=None, dns_zone_partner: str=None, public_data_endpoint_enabled: bool=None, source_managed_instance_id: str=None, restore_point_in_time=None, proxy_override: str=None, timezone_id: str=None, instance_pool_id: str=None, **kwargs) -> None: super(ManagedInstance, self).__init__(location=location, tags=tags, **kwargs) self.identity = identity self.sku = sku + self.managed_instance_create_mode = managed_instance_create_mode self.fully_qualified_domain_name = None self.administrator_login = administrator_login self.administrator_login_password = administrator_login_password @@ -135,5 +161,8 @@ def __init__(self, *, location: str, tags=None, identity=None, sku=None, adminis self.dns_zone = None self.dns_zone_partner = dns_zone_partner self.public_data_endpoint_enabled = public_data_endpoint_enabled + self.source_managed_instance_id = source_managed_instance_id + self.restore_point_in_time = restore_point_in_time self.proxy_override = proxy_override self.timezone_id = timezone_id + self.instance_pool_id = instance_pool_id diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update.py index e3c543f0a6b1..86e250bc3393 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update.py @@ -20,6 +20,14 @@ class ManagedInstanceUpdate(Model): :param sku: Managed instance sku :type sku: ~azure.mgmt.sql.models.Sku + :param managed_instance_create_mode: Specifies the mode of database + creation. + Default: Regular instance creation. + Restore: Creates an instance by restoring a set of backups to specific + point in time. RestorePointInTime and SourceManagedInstanceId must be + specified. Possible values include: 'Default', 'PointInTimeRestore' + :type managed_instance_create_mode: str or + ~azure.mgmt.sql.models.ManagedServerCreateMode :ivar fully_qualified_domain_name: The fully qualified domain name of the managed instance. :vartype fully_qualified_domain_name: str @@ -35,11 +43,16 @@ class ManagedInstanceUpdate(Model): :ivar state: The state of the managed instance. :vartype state: str :param license_type: The license type. Possible values are - 'LicenseIncluded' and 'BasePrice'. - :type license_type: str - :param v_cores: The number of VCores. + 'LicenseIncluded' (regular price inclusive of a new SQL license) and + 'BasePrice' (discounted AHB price for bringing your own SQL licenses). + Possible values include: 'LicenseIncluded', 'BasePrice' + :type license_type: str or + ~azure.mgmt.sql.models.ManagedInstanceLicenseType + :param v_cores: The number of vCores. Allowed values: 8, 16, 24, 32, 40, + 64, 80. :type v_cores: int - :param storage_size_in_gb: The maximum storage size in GB. + :param storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum + value: 8192. Increments of 32 GB allowed only. :type storage_size_in_gb: int :param collation: Collation of the managed instance. :type collation: str @@ -51,10 +64,14 @@ class ManagedInstanceUpdate(Model): :param public_data_endpoint_enabled: Whether or not the public data endpoint is enabled. :type public_data_endpoint_enabled: bool - :param proxy_override: Connection type used for connecting to the - instance. Possible values include: 'Proxy', 'Redirect', 'Default' - :type proxy_override: str or - ~azure.mgmt.sql.models.ManagedInstanceProxyOverride + :param source_managed_instance_id: The resource identifier of the source + managed instance associated with create operation of this instance. + :type source_managed_instance_id: str + :param restore_point_in_time: Specifies the point in time (ISO8601 format) + of the source database that will be restored to create the new database. + :type restore_point_in_time: datetime + :param proxy_override: Proxy override of the managed instance. + :type proxy_override: str :param timezone_id: Id of the timezone. Allowed values are timezones supported by Windows. Windows keeps details on supported timezones, including the id, in @@ -68,6 +85,9 @@ class ManagedInstanceUpdate(Model): An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". :type timezone_id: str + :param instance_pool_id: The Id of the instance pool this managed server + belongs to. + :type instance_pool_id: str :param tags: Resource tags. :type tags: dict[str, str] """ @@ -80,6 +100,7 @@ class ManagedInstanceUpdate(Model): _attribute_map = { 'sku': {'key': 'sku', 'type': 'Sku'}, + 'managed_instance_create_mode': {'key': 'properties.managedInstanceCreateMode', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, @@ -92,14 +113,18 @@ class ManagedInstanceUpdate(Model): 'dns_zone': {'key': 'properties.dnsZone', 'type': 'str'}, 'dns_zone_partner': {'key': 'properties.dnsZonePartner', 'type': 'str'}, 'public_data_endpoint_enabled': {'key': 'properties.publicDataEndpointEnabled', 'type': 'bool'}, + 'source_managed_instance_id': {'key': 'properties.sourceManagedInstanceId', 'type': 'str'}, + 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, 'proxy_override': {'key': 'properties.proxyOverride', 'type': 'str'}, 'timezone_id': {'key': 'properties.timezoneId', 'type': 'str'}, + 'instance_pool_id': {'key': 'properties.instancePoolId', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } def __init__(self, **kwargs): super(ManagedInstanceUpdate, self).__init__(**kwargs) self.sku = kwargs.get('sku', None) + self.managed_instance_create_mode = kwargs.get('managed_instance_create_mode', None) self.fully_qualified_domain_name = None self.administrator_login = kwargs.get('administrator_login', None) self.administrator_login_password = kwargs.get('administrator_login_password', None) @@ -112,6 +137,9 @@ def __init__(self, **kwargs): self.dns_zone = None self.dns_zone_partner = kwargs.get('dns_zone_partner', None) self.public_data_endpoint_enabled = kwargs.get('public_data_endpoint_enabled', None) + self.source_managed_instance_id = kwargs.get('source_managed_instance_id', None) + self.restore_point_in_time = kwargs.get('restore_point_in_time', None) self.proxy_override = kwargs.get('proxy_override', None) self.timezone_id = kwargs.get('timezone_id', None) + self.instance_pool_id = kwargs.get('instance_pool_id', None) self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update_py3.py index 4a2e6aa0bd78..68f2ee53cc18 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update_py3.py @@ -20,6 +20,14 @@ class ManagedInstanceUpdate(Model): :param sku: Managed instance sku :type sku: ~azure.mgmt.sql.models.Sku + :param managed_instance_create_mode: Specifies the mode of database + creation. + Default: Regular instance creation. + Restore: Creates an instance by restoring a set of backups to specific + point in time. RestorePointInTime and SourceManagedInstanceId must be + specified. Possible values include: 'Default', 'PointInTimeRestore' + :type managed_instance_create_mode: str or + ~azure.mgmt.sql.models.ManagedServerCreateMode :ivar fully_qualified_domain_name: The fully qualified domain name of the managed instance. :vartype fully_qualified_domain_name: str @@ -35,11 +43,16 @@ class ManagedInstanceUpdate(Model): :ivar state: The state of the managed instance. :vartype state: str :param license_type: The license type. Possible values are - 'LicenseIncluded' and 'BasePrice'. - :type license_type: str - :param v_cores: The number of VCores. + 'LicenseIncluded' (regular price inclusive of a new SQL license) and + 'BasePrice' (discounted AHB price for bringing your own SQL licenses). + Possible values include: 'LicenseIncluded', 'BasePrice' + :type license_type: str or + ~azure.mgmt.sql.models.ManagedInstanceLicenseType + :param v_cores: The number of vCores. Allowed values: 8, 16, 24, 32, 40, + 64, 80. :type v_cores: int - :param storage_size_in_gb: The maximum storage size in GB. + :param storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum + value: 8192. Increments of 32 GB allowed only. :type storage_size_in_gb: int :param collation: Collation of the managed instance. :type collation: str @@ -51,10 +64,14 @@ class ManagedInstanceUpdate(Model): :param public_data_endpoint_enabled: Whether or not the public data endpoint is enabled. :type public_data_endpoint_enabled: bool - :param proxy_override: Connection type used for connecting to the - instance. Possible values include: 'Proxy', 'Redirect', 'Default' - :type proxy_override: str or - ~azure.mgmt.sql.models.ManagedInstanceProxyOverride + :param source_managed_instance_id: The resource identifier of the source + managed instance associated with create operation of this instance. + :type source_managed_instance_id: str + :param restore_point_in_time: Specifies the point in time (ISO8601 format) + of the source database that will be restored to create the new database. + :type restore_point_in_time: datetime + :param proxy_override: Proxy override of the managed instance. + :type proxy_override: str :param timezone_id: Id of the timezone. Allowed values are timezones supported by Windows. Windows keeps details on supported timezones, including the id, in @@ -68,6 +85,9 @@ class ManagedInstanceUpdate(Model): An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". :type timezone_id: str + :param instance_pool_id: The Id of the instance pool this managed server + belongs to. + :type instance_pool_id: str :param tags: Resource tags. :type tags: dict[str, str] """ @@ -80,6 +100,7 @@ class ManagedInstanceUpdate(Model): _attribute_map = { 'sku': {'key': 'sku', 'type': 'Sku'}, + 'managed_instance_create_mode': {'key': 'properties.managedInstanceCreateMode', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, @@ -92,14 +113,18 @@ class ManagedInstanceUpdate(Model): 'dns_zone': {'key': 'properties.dnsZone', 'type': 'str'}, 'dns_zone_partner': {'key': 'properties.dnsZonePartner', 'type': 'str'}, 'public_data_endpoint_enabled': {'key': 'properties.publicDataEndpointEnabled', 'type': 'bool'}, + 'source_managed_instance_id': {'key': 'properties.sourceManagedInstanceId', 'type': 'str'}, + 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, 'proxy_override': {'key': 'properties.proxyOverride', 'type': 'str'}, 'timezone_id': {'key': 'properties.timezoneId', 'type': 'str'}, + 'instance_pool_id': {'key': 'properties.instancePoolId', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, sku=None, administrator_login: str=None, administrator_login_password: str=None, subnet_id: str=None, license_type: str=None, v_cores: int=None, storage_size_in_gb: int=None, collation: str=None, dns_zone_partner: str=None, public_data_endpoint_enabled: bool=None, proxy_override=None, timezone_id: str=None, tags=None, **kwargs) -> None: + def __init__(self, *, sku=None, managed_instance_create_mode=None, administrator_login: str=None, administrator_login_password: str=None, subnet_id: str=None, license_type=None, v_cores: int=None, storage_size_in_gb: int=None, collation: str=None, dns_zone_partner: str=None, public_data_endpoint_enabled: bool=None, source_managed_instance_id: str=None, restore_point_in_time=None, proxy_override: str=None, timezone_id: str=None, instance_pool_id: str=None, tags=None, **kwargs) -> None: super(ManagedInstanceUpdate, self).__init__(**kwargs) self.sku = sku + self.managed_instance_create_mode = managed_instance_create_mode self.fully_qualified_domain_name = None self.administrator_login = administrator_login self.administrator_login_password = administrator_login_password @@ -112,6 +137,9 @@ def __init__(self, *, sku=None, administrator_login: str=None, administrator_log self.dns_zone = None self.dns_zone_partner = dns_zone_partner self.public_data_endpoint_enabled = public_data_endpoint_enabled + self.source_managed_instance_id = source_managed_instance_id + self.restore_point_in_time = restore_point_in_time self.proxy_override = proxy_override self.timezone_id = timezone_id + self.instance_pool_id = instance_pool_id self.tags = tags diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py b/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py index de1d73caf27c..50fe30422cb7 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py @@ -325,11 +325,16 @@ class IdentityType(str, Enum): system_assigned = "SystemAssigned" -class ManagedInstanceProxyOverride(str, Enum): +class ManagedServerCreateMode(str, Enum): - proxy = "Proxy" - redirect = "Redirect" default = "Default" + point_in_time_restore = "PointInTimeRestore" + + +class ManagedInstanceLicenseType(str, Enum): + + license_included = "LicenseIncluded" + base_price = "BasePrice" class OperationOrigin(str, Enum): diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instances_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instances_operations.py index 1fee247c7c96..a81663266c9a 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instances_operations.py +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instances_operations.py @@ -39,70 +39,6 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def list( - self, custom_headers=None, raw=False, **operation_config): - """Gets a list of all managed instances in the subscription. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedInstance - :rtype: - ~azure.mgmt.sql.models.ManagedInstancePaged[~azure.mgmt.sql.models.ManagedInstance] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances'} - def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): """Gets a list of managed instances in a resource group. @@ -522,3 +458,139 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}'} + + def list_by_instance_pool( + self, resource_group_name, instance_pool_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of all managed instances in an instance pool. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param instance_pool_name: The instance pool name. + :type instance_pool_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ManagedInstance + :rtype: + ~azure.mgmt.sql.models.ManagedInstancePaged[~azure.mgmt.sql.models.ManagedInstance] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_instance_pool.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'instancePoolName': self._serialize.url("instance_pool_name", instance_pool_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_instance_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of all managed instances in the subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ManagedInstance + :rtype: + ~azure.mgmt.sql.models.ManagedInstancePaged[~azure.mgmt.sql.models.ManagedInstance] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances'}