From 592e032e2cd6ed456d386a99923b1357c3ba0e41 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Wed, 12 Feb 2020 14:51:56 +0000 Subject: [PATCH] Generated from 8bf307d33d18c4925e548ef5303ea34799d79f50 Update swagger specs for maintenance policy id --- .../azure/mgmt/sql/_sql_management_client.py | 10 +- .../azure/mgmt/sql/models/__init__.py | 24 +- .../azure/mgmt/sql/models/_models.py | 150 +++++++-- .../azure/mgmt/sql/models/_models_py3.py | 162 ++++++++-- .../azure/mgmt/sql/models/_paged_models.py | 26 +- .../models/_sql_management_client_enums.py | 53 +++- .../azure/mgmt/sql/operations/__init__.py | 4 +- .../sql/operations/_servers_operations.py | 286 +++++++++--------- .../_virtual_clusters_operations.py | 16 +- 9 files changed, 487 insertions(+), 244 deletions(-) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py index 2fdfb98f421d..c79618f8bf97 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py @@ -15,7 +15,6 @@ from ._configuration import SqlManagementClientConfiguration from .operations import RecoverableDatabasesOperations from .operations import RestorableDroppedDatabasesOperations -from .operations import ServersOperations from .operations import ServerConnectionPoliciesOperations from .operations import DatabaseThreatDetectionPoliciesOperations from .operations import DataMaskingPoliciesOperations @@ -97,6 +96,7 @@ from .operations import ManagedDatabasesOperations from .operations import PrivateEndpointConnectionsOperations from .operations import PrivateLinkResourcesOperations +from .operations import ServersOperations from .operations import ServerAzureADAdministratorsOperations from .operations import CapabilitiesOperations from .operations import WorkloadGroupsOperations @@ -114,8 +114,6 @@ class SqlManagementClient(SDKClient): :vartype recoverable_databases: azure.mgmt.sql.operations.RecoverableDatabasesOperations :ivar restorable_dropped_databases: RestorableDroppedDatabases operations :vartype restorable_dropped_databases: azure.mgmt.sql.operations.RestorableDroppedDatabasesOperations - :ivar servers: Servers operations - :vartype servers: azure.mgmt.sql.operations.ServersOperations :ivar server_connection_policies: ServerConnectionPolicies operations :vartype server_connection_policies: azure.mgmt.sql.operations.ServerConnectionPoliciesOperations :ivar database_threat_detection_policies: DatabaseThreatDetectionPolicies operations @@ -278,6 +276,8 @@ class SqlManagementClient(SDKClient): :vartype private_endpoint_connections: azure.mgmt.sql.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResources operations :vartype private_link_resources: azure.mgmt.sql.operations.PrivateLinkResourcesOperations + :ivar servers: Servers operations + :vartype servers: azure.mgmt.sql.operations.ServersOperations :ivar server_azure_ad_administrators: ServerAzureADAdministrators operations :vartype server_azure_ad_administrators: azure.mgmt.sql.operations.ServerAzureADAdministratorsOperations :ivar capabilities: Capabilities operations @@ -310,8 +310,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.restorable_dropped_databases = RestorableDroppedDatabasesOperations( self._client, self.config, self._serialize, self._deserialize) - self.servers = ServersOperations( - self._client, self.config, self._serialize, self._deserialize) self.server_connection_policies = ServerConnectionPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) self.database_threat_detection_policies = DatabaseThreatDetectionPoliciesOperations( @@ -474,6 +472,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.private_link_resources = PrivateLinkResourcesOperations( self._client, self.config, self._serialize, self._deserialize) + self.servers = ServersOperations( + self._client, self.config, self._serialize, self._deserialize) self.server_azure_ad_administrators = ServerAzureADAdministratorsOperations( self._client, self.config, self._serialize, self._deserialize) self.capabilities = CapabilitiesOperations( diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py index fe146e9e9505..d8a610764284 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py @@ -115,6 +115,7 @@ from ._models_py3 import PartnerRegionInfo from ._models_py3 import PerformanceLevelCapability from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionProperties from ._models_py3 import PrivateEndpointProperty from ._models_py3 import PrivateLinkResource from ._models_py3 import PrivateLinkResourceProperties @@ -143,6 +144,7 @@ from ._models_py3 import ServerDnsAlias from ._models_py3 import ServerDnsAliasAcquisition from ._models_py3 import ServerKey + from ._models_py3 import ServerPrivateEndpointConnection from ._models_py3 import ServerSecurityAlertPolicy from ._models_py3 import ServerUpdate from ._models_py3 import ServerUsage @@ -287,6 +289,7 @@ from ._models import PartnerRegionInfo from ._models import PerformanceLevelCapability from ._models import PrivateEndpointConnection + from ._models import PrivateEndpointConnectionProperties from ._models import PrivateEndpointProperty from ._models import PrivateLinkResource from ._models import PrivateLinkResourceProperties @@ -315,6 +318,7 @@ from ._models import ServerDnsAlias from ._models import ServerDnsAliasAcquisition from ._models import ServerKey + from ._models import ServerPrivateEndpointConnection from ._models import ServerSecurityAlertPolicy from ._models import ServerUpdate from ._models import ServerUsage @@ -428,7 +432,6 @@ from ._paged_models import WorkloadClassifierPaged from ._paged_models import WorkloadGroupPaged from ._sql_management_client_enums import ( - CheckNameAvailabilityReason, ServerConnectionType, SecurityAlertPolicyState, SecurityAlertPolicyEmailAccountAdmins, @@ -461,7 +464,6 @@ ReadOnlyEndpointFailoverPolicy, FailoverGroupReplicationRole, OperationOrigin, - IdentityType, SyncAgentState, SyncMemberDbType, SyncGroupLogType, @@ -483,6 +485,7 @@ AutomaticTuningServerMode, AutomaticTuningServerReason, RestorePointType, + SensitivityLabelRank, ManagementOperationState, CreateMode, SampleName, @@ -496,11 +499,16 @@ VulnerabilityAssessmentScanState, InstanceFailoverGroupReplicationRole, InstancePoolLicenseType, + IdentityType, ManagedServerCreateMode, ManagedInstanceLicenseType, ManagedInstanceProxyOverride, ManagedDatabaseStatus, ManagedDatabaseCreateMode, + PrivateLinkServiceConnectionStateStatus, + PrivateLinkServiceConnectionStateActionsRequire, + PrivateEndpointProvisioningState, + CheckNameAvailabilityReason, MaxSizeUnit, LogSizeUnit, CapabilityStatus, @@ -619,6 +627,7 @@ 'PartnerRegionInfo', 'PerformanceLevelCapability', 'PrivateEndpointConnection', + 'PrivateEndpointConnectionProperties', 'PrivateEndpointProperty', 'PrivateLinkResource', 'PrivateLinkResourceProperties', @@ -647,6 +656,7 @@ 'ServerDnsAlias', 'ServerDnsAliasAcquisition', 'ServerKey', + 'ServerPrivateEndpointConnection', 'ServerSecurityAlertPolicy', 'ServerUpdate', 'ServerUsage', @@ -687,7 +697,6 @@ 'WorkloadGroup', 'RecoverableDatabasePaged', 'RestorableDroppedDatabasePaged', - 'ServerPaged', 'DataMaskingRulePaged', 'FirewallRulePaged', 'GeoBackupPolicyPaged', @@ -756,10 +765,10 @@ 'ManagedDatabasePaged', 'PrivateEndpointConnectionPaged', 'PrivateLinkResourcePaged', + 'ServerPaged', 'ServerAzureADAdministratorPaged', 'WorkloadGroupPaged', 'WorkloadClassifierPaged', - 'CheckNameAvailabilityReason', 'ServerConnectionType', 'SecurityAlertPolicyState', 'SecurityAlertPolicyEmailAccountAdmins', @@ -792,7 +801,6 @@ 'ReadOnlyEndpointFailoverPolicy', 'FailoverGroupReplicationRole', 'OperationOrigin', - 'IdentityType', 'SyncAgentState', 'SyncMemberDbType', 'SyncGroupLogType', @@ -814,6 +822,7 @@ 'AutomaticTuningServerMode', 'AutomaticTuningServerReason', 'RestorePointType', + 'SensitivityLabelRank', 'ManagementOperationState', 'CreateMode', 'SampleName', @@ -827,11 +836,16 @@ 'VulnerabilityAssessmentScanState', 'InstanceFailoverGroupReplicationRole', 'InstancePoolLicenseType', + 'IdentityType', 'ManagedServerCreateMode', 'ManagedInstanceLicenseType', 'ManagedInstanceProxyOverride', 'ManagedDatabaseStatus', 'ManagedDatabaseCreateMode', + 'PrivateLinkServiceConnectionStateStatus', + 'PrivateLinkServiceConnectionStateActionsRequire', + 'PrivateEndpointProvisioningState', + 'CheckNameAvailabilityReason', 'MaxSizeUnit', 'LogSizeUnit', 'CapabilityStatus', diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py index 1d4c30a625e4..d15a7b71de66 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py @@ -308,10 +308,9 @@ class CheckNameAvailabilityRequest(Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name whose availability is to be checked. + :param name: Required. :type name: str - :ivar type: Required. The type of resource that is used as the scope of - the availability check. Default value: "Microsoft.Sql/servers" . + :ivar type: Required. Default value: "Microsoft.Sql/servers" . :vartype type: str """ @@ -333,45 +332,44 @@ def __init__(self, **kwargs): class CheckNameAvailabilityResponse(Model): - """A response indicating whether the specified name for a resource is - available. + """The result of a name availability check. Variables are only populated by the server, and will be ignored when sending a request. - :ivar available: True if the name is available, otherwise false. - :vartype available: bool - :ivar message: A message explaining why the name is unavailable. Will be - null if the name is available. - :vartype message: str :ivar name: The name whose availability was checked. :vartype name: str + :ivar available: True if the name is available, otherwise false. + :vartype available: bool :ivar reason: The reason code explaining why the name is unavailable. Will - be null if the name is available. Possible values include: 'Invalid', + be undefined if the name is available. Possible values include: 'Invalid', 'AlreadyExists' :vartype reason: str or ~azure.mgmt.sql.models.CheckNameAvailabilityReason + :ivar message: A message explaining why the name is unavailable. Will be + undefined if the name is available. + :vartype message: str """ _validation = { - 'available': {'readonly': True}, - 'message': {'readonly': True}, 'name': {'readonly': True}, + 'available': {'readonly': True}, 'reason': {'readonly': True}, + 'message': {'readonly': True}, } _attribute_map = { - 'available': {'key': 'available', 'type': 'bool'}, - 'message': {'key': 'message', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'available': {'key': 'available', 'type': 'bool'}, 'reason': {'key': 'reason', 'type': 'CheckNameAvailabilityReason'}, + 'message': {'key': 'message', 'type': 'str'}, } def __init__(self, **kwargs): super(CheckNameAvailabilityResponse, self).__init__(**kwargs) - self.available = None - self.message = None self.name = None + self.available = None self.reason = None + self.message = None class CloudError(Model): @@ -5117,6 +5115,9 @@ class ManagedInstance(TrackedResource): :param instance_pool_id: The Id of the instance pool this managed server belongs to. :type instance_pool_id: str + :param maintenance_policy_id: Specifies maintenance policy id to apply to + this managed instance. + :type maintenance_policy_id: str """ _validation = { @@ -5155,6 +5156,7 @@ class ManagedInstance(TrackedResource): 'proxy_override': {'key': 'properties.proxyOverride', 'type': 'str'}, 'timezone_id': {'key': 'properties.timezoneId', 'type': 'str'}, 'instance_pool_id': {'key': 'properties.instancePoolId', 'type': 'str'}, + 'maintenance_policy_id': {'key': 'properties.maintenancePolicyId', 'type': 'str'}, } def __init__(self, **kwargs): @@ -5179,6 +5181,7 @@ def __init__(self, **kwargs): 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.maintenance_policy_id = kwargs.get('maintenance_policy_id', None) class ManagedInstanceAdministrator(ProxyResource): @@ -5543,6 +5546,9 @@ class ManagedInstanceUpdate(Model): :param instance_pool_id: The Id of the instance pool this managed server belongs to. :type instance_pool_id: str + :param maintenance_policy_id: Specifies maintenance policy id to apply to + this managed instance. + :type maintenance_policy_id: str :param tags: Resource tags. :type tags: dict[str, str] """ @@ -5573,6 +5579,7 @@ class ManagedInstanceUpdate(Model): 'proxy_override': {'key': 'properties.proxyOverride', 'type': 'str'}, 'timezone_id': {'key': 'properties.timezoneId', 'type': 'str'}, 'instance_pool_id': {'key': 'properties.instancePoolId', 'type': 'str'}, + 'maintenance_policy_id': {'key': 'properties.maintenancePolicyId', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } @@ -5597,6 +5604,7 @@ def __init__(self, **kwargs): 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.maintenance_policy_id = kwargs.get('maintenance_policy_id', None) self.tags = kwargs.get('tags', None) @@ -6408,7 +6416,10 @@ class PrivateEndpointConnection(ProxyResource): :type private_link_service_connection_state: ~azure.mgmt.sql.models.PrivateLinkServiceConnectionStateProperty :ivar provisioning_state: State of the private endpoint connection. - :vartype provisioning_state: str + Possible values include: 'Approving', 'Ready', 'Dropping', 'Failed', + 'Rejecting' + :vartype provisioning_state: str or + ~azure.mgmt.sql.models.PrivateEndpointProvisioningState """ _validation = { @@ -6434,6 +6445,42 @@ def __init__(self, **kwargs): self.provisioning_state = None +class PrivateEndpointConnectionProperties(Model): + """Properties of a private endpoint connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param private_endpoint: Private endpoint which the connection belongs to. + :type private_endpoint: ~azure.mgmt.sql.models.PrivateEndpointProperty + :param private_link_service_connection_state: Connection state of the + private endpoint connection. + :type private_link_service_connection_state: + ~azure.mgmt.sql.models.PrivateLinkServiceConnectionStateProperty + :ivar provisioning_state: State of the private endpoint connection. + Possible values include: 'Approving', 'Ready', 'Dropping', 'Failed', + 'Rejecting' + :vartype provisioning_state: str or + ~azure.mgmt.sql.models.PrivateEndpointProvisioningState + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'private_endpoint': {'key': 'privateEndpoint', 'type': 'PrivateEndpointProperty'}, + 'private_link_service_connection_state': {'key': 'privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionStateProperty'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpointConnectionProperties, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = None + + class PrivateEndpointProperty(Model): """PrivateEndpointProperty. @@ -6522,13 +6569,16 @@ class PrivateLinkServiceConnectionStateProperty(Model): All required parameters must be populated in order to send to Azure. :param status: Required. The private link service connection status. - :type status: str + Possible values include: 'Approved', 'Pending', 'Rejected', 'Disconnected' + :type status: str or + ~azure.mgmt.sql.models.PrivateLinkServiceConnectionStateStatus :param description: Required. The private link service connection description. :type description: str :ivar actions_required: The actions required for private link service - connection. - :vartype actions_required: str + connection. Possible values include: 'None' + :vartype actions_required: str or + ~azure.mgmt.sql.models.PrivateLinkServiceConnectionStateActionsRequire """ _validation = { @@ -7252,6 +7302,9 @@ class SensitivityLabel(ProxyResource): recommended sensitivity label only. Specifies whether the sensitivity recommendation on this column is disabled (dismissed) or not. :vartype is_disabled: bool + :param rank: Possible values include: 'None', 'Low', 'Medium', 'High', + 'Critical' + :type rank: str or ~azure.mgmt.sql.models.SensitivityLabelRank """ _validation = { @@ -7270,6 +7323,7 @@ class SensitivityLabel(ProxyResource): 'information_type': {'key': 'properties.informationType', 'type': 'str'}, 'information_type_id': {'key': 'properties.informationTypeId', 'type': 'str'}, 'is_disabled': {'key': 'properties.isDisabled', 'type': 'bool'}, + 'rank': {'key': 'properties.rank', 'type': 'SensitivityLabelRank'}, } def __init__(self, **kwargs): @@ -7279,6 +7333,7 @@ def __init__(self, **kwargs): self.information_type = kwargs.get('information_type', None) self.information_type_id = kwargs.get('information_type_id', None) self.is_disabled = None + self.rank = kwargs.get('rank', None) class Server(TrackedResource): @@ -7317,6 +7372,10 @@ class Server(TrackedResource): :ivar fully_qualified_domain_name: The fully qualified domain name of the server. :vartype fully_qualified_domain_name: str + :ivar private_endpoint_connections: List of private endpoint connections + on a server + :vartype private_endpoint_connections: + list[~azure.mgmt.sql.models.ServerPrivateEndpointConnection] """ _validation = { @@ -7327,6 +7386,7 @@ class Server(TrackedResource): 'kind': {'readonly': True}, 'state': {'readonly': True}, 'fully_qualified_domain_name': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -7342,6 +7402,7 @@ class Server(TrackedResource): 'version': {'key': 'properties.version', 'type': 'str'}, 'state': {'key': 'properties.state', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[ServerPrivateEndpointConnection]'}, } def __init__(self, **kwargs): @@ -7353,6 +7414,7 @@ def __init__(self, **kwargs): self.version = kwargs.get('version', None) self.state = None self.fully_qualified_domain_name = None + self.private_endpoint_connections = None class ServerAutomaticTuning(ProxyResource): @@ -7830,6 +7892,35 @@ def __init__(self, **kwargs): self.creation_date = kwargs.get('creation_date', None) +class ServerPrivateEndpointConnection(Model): + """A private endpoint connection under a server. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar properties: Private endpoint connection properties + :vartype properties: + ~azure.mgmt.sql.models.PrivateEndpointConnectionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnectionProperties'}, + } + + def __init__(self, **kwargs): + super(ServerPrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + self.properties = None + + class ServerSecurityAlertPolicy(ProxyResource): """A server security alert policy. @@ -7925,6 +8016,10 @@ class ServerUpdate(Model): :ivar fully_qualified_domain_name: The fully qualified domain name of the server. :vartype fully_qualified_domain_name: str + :ivar private_endpoint_connections: List of private endpoint connections + on a server + :vartype private_endpoint_connections: + list[~azure.mgmt.sql.models.ServerPrivateEndpointConnection] :param tags: Resource tags. :type tags: dict[str, str] """ @@ -7932,6 +8027,7 @@ class ServerUpdate(Model): _validation = { 'state': {'readonly': True}, 'fully_qualified_domain_name': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -7940,6 +8036,7 @@ class ServerUpdate(Model): 'version': {'key': 'properties.version', 'type': 'str'}, 'state': {'key': 'properties.state', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[ServerPrivateEndpointConnection]'}, 'tags': {'key': 'tags', 'type': '{str}'}, } @@ -7950,6 +8047,7 @@ def __init__(self, **kwargs): self.version = kwargs.get('version', None) self.state = None self.fully_qualified_domain_name = None + self.private_endpoint_connections = None self.tags = kwargs.get('tags', None) @@ -9340,6 +9438,9 @@ class VirtualCluster(TrackedResource): :type family: str :ivar child_resources: List of resources in this virtual cluster. :vartype child_resources: list[str] + :param maintenance_policy_id: Specifies maintenance policy id to apply to + this virtual cluster. + :type maintenance_policy_id: str """ _validation = { @@ -9360,6 +9461,7 @@ class VirtualCluster(TrackedResource): 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, 'family': {'key': 'properties.family', 'type': 'str'}, 'child_resources': {'key': 'properties.childResources', 'type': '[str]'}, + 'maintenance_policy_id': {'key': 'properties.maintenancePolicyId', 'type': 'str'}, } def __init__(self, **kwargs): @@ -9367,6 +9469,7 @@ def __init__(self, **kwargs): self.subnet_id = None self.family = kwargs.get('family', None) self.child_resources = None + self.maintenance_policy_id = kwargs.get('maintenance_policy_id', None) class VirtualClusterUpdate(Model): @@ -9382,6 +9485,9 @@ class VirtualClusterUpdate(Model): :type family: str :ivar child_resources: List of resources in this virtual cluster. :vartype child_resources: list[str] + :param maintenance_policy_id: Specifies maintenance policy id to apply to + this virtual cluster. + :type maintenance_policy_id: str :param tags: Resource tags. :type tags: dict[str, str] """ @@ -9395,6 +9501,7 @@ class VirtualClusterUpdate(Model): 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, 'family': {'key': 'properties.family', 'type': 'str'}, 'child_resources': {'key': 'properties.childResources', 'type': '[str]'}, + 'maintenance_policy_id': {'key': 'properties.maintenancePolicyId', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } @@ -9403,6 +9510,7 @@ def __init__(self, **kwargs): self.subnet_id = None self.family = kwargs.get('family', None) self.child_resources = None + self.maintenance_policy_id = kwargs.get('maintenance_policy_id', None) self.tags = kwargs.get('tags', None) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py index dd09869db010..553279416be4 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py @@ -308,10 +308,9 @@ class CheckNameAvailabilityRequest(Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name whose availability is to be checked. + :param name: Required. :type name: str - :ivar type: Required. The type of resource that is used as the scope of - the availability check. Default value: "Microsoft.Sql/servers" . + :ivar type: Required. Default value: "Microsoft.Sql/servers" . :vartype type: str """ @@ -333,45 +332,44 @@ def __init__(self, *, name: str, **kwargs) -> None: class CheckNameAvailabilityResponse(Model): - """A response indicating whether the specified name for a resource is - available. + """The result of a name availability check. Variables are only populated by the server, and will be ignored when sending a request. - :ivar available: True if the name is available, otherwise false. - :vartype available: bool - :ivar message: A message explaining why the name is unavailable. Will be - null if the name is available. - :vartype message: str :ivar name: The name whose availability was checked. :vartype name: str + :ivar available: True if the name is available, otherwise false. + :vartype available: bool :ivar reason: The reason code explaining why the name is unavailable. Will - be null if the name is available. Possible values include: 'Invalid', + be undefined if the name is available. Possible values include: 'Invalid', 'AlreadyExists' :vartype reason: str or ~azure.mgmt.sql.models.CheckNameAvailabilityReason + :ivar message: A message explaining why the name is unavailable. Will be + undefined if the name is available. + :vartype message: str """ _validation = { - 'available': {'readonly': True}, - 'message': {'readonly': True}, 'name': {'readonly': True}, + 'available': {'readonly': True}, 'reason': {'readonly': True}, + 'message': {'readonly': True}, } _attribute_map = { - 'available': {'key': 'available', 'type': 'bool'}, - 'message': {'key': 'message', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, + 'available': {'key': 'available', 'type': 'bool'}, 'reason': {'key': 'reason', 'type': 'CheckNameAvailabilityReason'}, + 'message': {'key': 'message', 'type': 'str'}, } def __init__(self, **kwargs) -> None: super(CheckNameAvailabilityResponse, self).__init__(**kwargs) - self.available = None - self.message = None self.name = None + self.available = None self.reason = None + self.message = None class CloudError(Model): @@ -5117,6 +5115,9 @@ class ManagedInstance(TrackedResource): :param instance_pool_id: The Id of the instance pool this managed server belongs to. :type instance_pool_id: str + :param maintenance_policy_id: Specifies maintenance policy id to apply to + this managed instance. + :type maintenance_policy_id: str """ _validation = { @@ -5155,9 +5156,10 @@ class ManagedInstance(TrackedResource): 'proxy_override': {'key': 'properties.proxyOverride', 'type': 'str'}, 'timezone_id': {'key': 'properties.timezoneId', 'type': 'str'}, 'instance_pool_id': {'key': 'properties.instancePoolId', 'type': 'str'}, + 'maintenance_policy_id': {'key': 'properties.maintenancePolicyId', 'type': 'str'}, } - 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=None, timezone_id: str=None, instance_pool_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=None, timezone_id: str=None, instance_pool_id: str=None, maintenance_policy_id: str=None, **kwargs) -> None: super(ManagedInstance, self).__init__(location=location, tags=tags, **kwargs) self.identity = identity self.sku = sku @@ -5179,6 +5181,7 @@ def __init__(self, *, location: str, tags=None, identity=None, sku=None, managed self.proxy_override = proxy_override self.timezone_id = timezone_id self.instance_pool_id = instance_pool_id + self.maintenance_policy_id = maintenance_policy_id class ManagedInstanceAdministrator(ProxyResource): @@ -5543,6 +5546,9 @@ class ManagedInstanceUpdate(Model): :param instance_pool_id: The Id of the instance pool this managed server belongs to. :type instance_pool_id: str + :param maintenance_policy_id: Specifies maintenance policy id to apply to + this managed instance. + :type maintenance_policy_id: str :param tags: Resource tags. :type tags: dict[str, str] """ @@ -5573,10 +5579,11 @@ class ManagedInstanceUpdate(Model): 'proxy_override': {'key': 'properties.proxyOverride', 'type': 'str'}, 'timezone_id': {'key': 'properties.timezoneId', 'type': 'str'}, 'instance_pool_id': {'key': 'properties.instancePoolId', 'type': 'str'}, + 'maintenance_policy_id': {'key': 'properties.maintenancePolicyId', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } - 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=None, timezone_id: str=None, instance_pool_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=None, timezone_id: str=None, instance_pool_id: str=None, maintenance_policy_id: str=None, tags=None, **kwargs) -> None: super(ManagedInstanceUpdate, self).__init__(**kwargs) self.sku = sku self.managed_instance_create_mode = managed_instance_create_mode @@ -5597,6 +5604,7 @@ def __init__(self, *, sku=None, managed_instance_create_mode=None, administrator self.proxy_override = proxy_override self.timezone_id = timezone_id self.instance_pool_id = instance_pool_id + self.maintenance_policy_id = maintenance_policy_id self.tags = tags @@ -6408,7 +6416,10 @@ class PrivateEndpointConnection(ProxyResource): :type private_link_service_connection_state: ~azure.mgmt.sql.models.PrivateLinkServiceConnectionStateProperty :ivar provisioning_state: State of the private endpoint connection. - :vartype provisioning_state: str + Possible values include: 'Approving', 'Ready', 'Dropping', 'Failed', + 'Rejecting' + :vartype provisioning_state: str or + ~azure.mgmt.sql.models.PrivateEndpointProvisioningState """ _validation = { @@ -6434,6 +6445,42 @@ def __init__(self, *, private_endpoint=None, private_link_service_connection_sta self.provisioning_state = None +class PrivateEndpointConnectionProperties(Model): + """Properties of a private endpoint connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param private_endpoint: Private endpoint which the connection belongs to. + :type private_endpoint: ~azure.mgmt.sql.models.PrivateEndpointProperty + :param private_link_service_connection_state: Connection state of the + private endpoint connection. + :type private_link_service_connection_state: + ~azure.mgmt.sql.models.PrivateLinkServiceConnectionStateProperty + :ivar provisioning_state: State of the private endpoint connection. + Possible values include: 'Approving', 'Ready', 'Dropping', 'Failed', + 'Rejecting' + :vartype provisioning_state: str or + ~azure.mgmt.sql.models.PrivateEndpointProvisioningState + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'private_endpoint': {'key': 'privateEndpoint', 'type': 'PrivateEndpointProperty'}, + 'private_link_service_connection_state': {'key': 'privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionStateProperty'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, private_endpoint=None, private_link_service_connection_state=None, **kwargs) -> None: + super(PrivateEndpointConnectionProperties, self).__init__(**kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = None + + class PrivateEndpointProperty(Model): """PrivateEndpointProperty. @@ -6522,13 +6569,16 @@ class PrivateLinkServiceConnectionStateProperty(Model): All required parameters must be populated in order to send to Azure. :param status: Required. The private link service connection status. - :type status: str + Possible values include: 'Approved', 'Pending', 'Rejected', 'Disconnected' + :type status: str or + ~azure.mgmt.sql.models.PrivateLinkServiceConnectionStateStatus :param description: Required. The private link service connection description. :type description: str :ivar actions_required: The actions required for private link service - connection. - :vartype actions_required: str + connection. Possible values include: 'None' + :vartype actions_required: str or + ~azure.mgmt.sql.models.PrivateLinkServiceConnectionStateActionsRequire """ _validation = { @@ -6543,7 +6593,7 @@ class PrivateLinkServiceConnectionStateProperty(Model): 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, } - def __init__(self, *, status: str, description: str, **kwargs) -> None: + def __init__(self, *, status, description: str, **kwargs) -> None: super(PrivateLinkServiceConnectionStateProperty, self).__init__(**kwargs) self.status = status self.description = description @@ -7252,6 +7302,9 @@ class SensitivityLabel(ProxyResource): recommended sensitivity label only. Specifies whether the sensitivity recommendation on this column is disabled (dismissed) or not. :vartype is_disabled: bool + :param rank: Possible values include: 'None', 'Low', 'Medium', 'High', + 'Critical' + :type rank: str or ~azure.mgmt.sql.models.SensitivityLabelRank """ _validation = { @@ -7270,15 +7323,17 @@ class SensitivityLabel(ProxyResource): 'information_type': {'key': 'properties.informationType', 'type': 'str'}, 'information_type_id': {'key': 'properties.informationTypeId', 'type': 'str'}, 'is_disabled': {'key': 'properties.isDisabled', 'type': 'bool'}, + 'rank': {'key': 'properties.rank', 'type': 'SensitivityLabelRank'}, } - def __init__(self, *, label_name: str=None, label_id: str=None, information_type: str=None, information_type_id: str=None, **kwargs) -> None: + def __init__(self, *, label_name: str=None, label_id: str=None, information_type: str=None, information_type_id: str=None, rank=None, **kwargs) -> None: super(SensitivityLabel, self).__init__(**kwargs) self.label_name = label_name self.label_id = label_id self.information_type = information_type self.information_type_id = information_type_id self.is_disabled = None + self.rank = rank class Server(TrackedResource): @@ -7317,6 +7372,10 @@ class Server(TrackedResource): :ivar fully_qualified_domain_name: The fully qualified domain name of the server. :vartype fully_qualified_domain_name: str + :ivar private_endpoint_connections: List of private endpoint connections + on a server + :vartype private_endpoint_connections: + list[~azure.mgmt.sql.models.ServerPrivateEndpointConnection] """ _validation = { @@ -7327,6 +7386,7 @@ class Server(TrackedResource): 'kind': {'readonly': True}, 'state': {'readonly': True}, 'fully_qualified_domain_name': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -7342,6 +7402,7 @@ class Server(TrackedResource): 'version': {'key': 'properties.version', 'type': 'str'}, 'state': {'key': 'properties.state', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[ServerPrivateEndpointConnection]'}, } def __init__(self, *, location: str, tags=None, identity=None, administrator_login: str=None, administrator_login_password: str=None, version: str=None, **kwargs) -> None: @@ -7353,6 +7414,7 @@ def __init__(self, *, location: str, tags=None, identity=None, administrator_log self.version = version self.state = None self.fully_qualified_domain_name = None + self.private_endpoint_connections = None class ServerAutomaticTuning(ProxyResource): @@ -7830,6 +7892,35 @@ def __init__(self, *, server_key_type, kind: str=None, uri: str=None, thumbprint self.creation_date = creation_date +class ServerPrivateEndpointConnection(Model): + """A private endpoint connection under a server. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar properties: Private endpoint connection properties + :vartype properties: + ~azure.mgmt.sql.models.PrivateEndpointConnectionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'PrivateEndpointConnectionProperties'}, + } + + def __init__(self, **kwargs) -> None: + super(ServerPrivateEndpointConnection, self).__init__(**kwargs) + self.id = None + self.properties = None + + class ServerSecurityAlertPolicy(ProxyResource): """A server security alert policy. @@ -7925,6 +8016,10 @@ class ServerUpdate(Model): :ivar fully_qualified_domain_name: The fully qualified domain name of the server. :vartype fully_qualified_domain_name: str + :ivar private_endpoint_connections: List of private endpoint connections + on a server + :vartype private_endpoint_connections: + list[~azure.mgmt.sql.models.ServerPrivateEndpointConnection] :param tags: Resource tags. :type tags: dict[str, str] """ @@ -7932,6 +8027,7 @@ class ServerUpdate(Model): _validation = { 'state': {'readonly': True}, 'fully_qualified_domain_name': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -7940,6 +8036,7 @@ class ServerUpdate(Model): 'version': {'key': 'properties.version', 'type': 'str'}, 'state': {'key': 'properties.state', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[ServerPrivateEndpointConnection]'}, 'tags': {'key': 'tags', 'type': '{str}'}, } @@ -7950,6 +8047,7 @@ def __init__(self, *, administrator_login: str=None, administrator_login_passwor self.version = version self.state = None self.fully_qualified_domain_name = None + self.private_endpoint_connections = None self.tags = tags @@ -9340,6 +9438,9 @@ class VirtualCluster(TrackedResource): :type family: str :ivar child_resources: List of resources in this virtual cluster. :vartype child_resources: list[str] + :param maintenance_policy_id: Specifies maintenance policy id to apply to + this virtual cluster. + :type maintenance_policy_id: str """ _validation = { @@ -9360,13 +9461,15 @@ class VirtualCluster(TrackedResource): 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, 'family': {'key': 'properties.family', 'type': 'str'}, 'child_resources': {'key': 'properties.childResources', 'type': '[str]'}, + 'maintenance_policy_id': {'key': 'properties.maintenancePolicyId', 'type': 'str'}, } - def __init__(self, *, location: str, tags=None, family: str=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, family: str=None, maintenance_policy_id: str=None, **kwargs) -> None: super(VirtualCluster, self).__init__(location=location, tags=tags, **kwargs) self.subnet_id = None self.family = family self.child_resources = None + self.maintenance_policy_id = maintenance_policy_id class VirtualClusterUpdate(Model): @@ -9382,6 +9485,9 @@ class VirtualClusterUpdate(Model): :type family: str :ivar child_resources: List of resources in this virtual cluster. :vartype child_resources: list[str] + :param maintenance_policy_id: Specifies maintenance policy id to apply to + this virtual cluster. + :type maintenance_policy_id: str :param tags: Resource tags. :type tags: dict[str, str] """ @@ -9395,14 +9501,16 @@ class VirtualClusterUpdate(Model): 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, 'family': {'key': 'properties.family', 'type': 'str'}, 'child_resources': {'key': 'properties.childResources', 'type': '[str]'}, + 'maintenance_policy_id': {'key': 'properties.maintenancePolicyId', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, family: str=None, tags=None, **kwargs) -> None: + def __init__(self, *, family: str=None, maintenance_policy_id: str=None, tags=None, **kwargs) -> None: super(VirtualClusterUpdate, self).__init__(**kwargs) self.subnet_id = None self.family = family self.child_resources = None + self.maintenance_policy_id = maintenance_policy_id self.tags = tags diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_paged_models.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_paged_models.py index 8b5d9a2a8e24..8b43b8ba9a9b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_paged_models.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_paged_models.py @@ -38,19 +38,6 @@ class RestorableDroppedDatabasePaged(Paged): def __init__(self, *args, **kwargs): super(RestorableDroppedDatabasePaged, self).__init__(*args, **kwargs) -class ServerPaged(Paged): - """ - A paging container for iterating over a list of :class:`Server ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Server]'} - } - - def __init__(self, *args, **kwargs): - - super(ServerPaged, self).__init__(*args, **kwargs) class DataMaskingRulePaged(Paged): """ A paging container for iterating over a list of :class:`DataMaskingRule ` object @@ -935,6 +922,19 @@ class PrivateLinkResourcePaged(Paged): def __init__(self, *args, **kwargs): super(PrivateLinkResourcePaged, self).__init__(*args, **kwargs) +class ServerPaged(Paged): + """ + A paging container for iterating over a list of :class:`Server ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Server]'} + } + + def __init__(self, *args, **kwargs): + + super(ServerPaged, self).__init__(*args, **kwargs) class ServerAzureADAdministratorPaged(Paged): """ A paging container for iterating over a list of :class:`ServerAzureADAdministrator ` object diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py index 8aa0b3ba1096..5eafa3241b1e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py @@ -12,12 +12,6 @@ from enum import Enum -class CheckNameAvailabilityReason(str, Enum): - - invalid = "Invalid" - already_exists = "AlreadyExists" - - class ServerConnectionType(str, Enum): default = "Default" @@ -331,11 +325,6 @@ class OperationOrigin(str, Enum): system = "system" -class IdentityType(str, Enum): - - system_assigned = "SystemAssigned" - - class SyncAgentState(str, Enum): online = "Online" @@ -504,6 +493,15 @@ class RestorePointType(str, Enum): discrete = "DISCRETE" +class SensitivityLabelRank(str, Enum): + + none = "None" + low = "Low" + medium = "Medium" + high = "High" + critical = "Critical" + + class ManagementOperationState(str, Enum): pending = "Pending" @@ -617,6 +615,11 @@ class InstancePoolLicenseType(str, Enum): base_price = "BasePrice" +class IdentityType(str, Enum): + + system_assigned = "SystemAssigned" + + class ManagedServerCreateMode(str, Enum): default = "Default" @@ -655,6 +658,34 @@ class ManagedDatabaseCreateMode(str, Enum): recovery = "Recovery" +class PrivateLinkServiceConnectionStateStatus(str, Enum): + + approved = "Approved" + pending = "Pending" + rejected = "Rejected" + disconnected = "Disconnected" + + +class PrivateLinkServiceConnectionStateActionsRequire(str, Enum): + + none = "None" + + +class PrivateEndpointProvisioningState(str, Enum): + + approving = "Approving" + ready = "Ready" + dropping = "Dropping" + failed = "Failed" + rejecting = "Rejecting" + + +class CheckNameAvailabilityReason(str, Enum): + + invalid = "Invalid" + already_exists = "AlreadyExists" + + class MaxSizeUnit(str, Enum): megabytes = "Megabytes" diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py index 1149a3cd94f9..8c94fa321df2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py @@ -11,7 +11,6 @@ from ._recoverable_databases_operations import RecoverableDatabasesOperations from ._restorable_dropped_databases_operations import RestorableDroppedDatabasesOperations -from ._servers_operations import ServersOperations from ._server_connection_policies_operations import ServerConnectionPoliciesOperations from ._database_threat_detection_policies_operations import DatabaseThreatDetectionPoliciesOperations from ._data_masking_policies_operations import DataMaskingPoliciesOperations @@ -93,6 +92,7 @@ from ._managed_databases_operations import ManagedDatabasesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._servers_operations import ServersOperations from ._server_azure_ad_administrators_operations import ServerAzureADAdministratorsOperations from ._capabilities_operations import CapabilitiesOperations from ._workload_groups_operations import WorkloadGroupsOperations @@ -101,7 +101,6 @@ __all__ = [ 'RecoverableDatabasesOperations', 'RestorableDroppedDatabasesOperations', - 'ServersOperations', 'ServerConnectionPoliciesOperations', 'DatabaseThreatDetectionPoliciesOperations', 'DataMaskingPoliciesOperations', @@ -183,6 +182,7 @@ 'ManagedDatabasesOperations', 'PrivateEndpointConnectionsOperations', 'PrivateLinkResourcesOperations', + 'ServersOperations', 'ServerAzureADAdministratorsOperations', 'CapabilitiesOperations', 'WorkloadGroupsOperations', diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py index 16fd05d12be8..7abf430deda2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py @@ -27,6 +27,7 @@ class ServersOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2019-06-01-preview". """ models = models @@ -36,143 +37,10 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.api_version = "2019-06-01-preview" self.config = config - def check_name_availability( - self, name, custom_headers=None, raw=False, **operation_config): - """Determines whether a resource can be created with the specified name. - - :param name: The name whose availability is to be checked. - :type 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: CheckNameAvailabilityResponse or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.sql.models.CheckNameAvailabilityResponse or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - parameters = models.CheckNameAvailabilityRequest(name=name) - - api_version = "2014-04-01" - - # Construct URL - url = self.check_name_availability.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("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'CheckNameAvailabilityRequest') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('CheckNameAvailabilityResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability'} - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Gets a list of all servers 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 Server - :rtype: - ~azure.mgmt.sql.models.ServerPaged[~azure.mgmt.sql.models.Server] - :raises: :class:`CloudError` - """ - api_version = "2015-05-01-preview" - - def prepare_request(next_link=None): - 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("api_version", 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) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - 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 - header_dict = None - if raw: - header_dict = {} - deserialized = models.ServerPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers'} - def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): """Gets a list of servers in a resource groups. @@ -191,8 +59,6 @@ def list_by_resource_group( ~azure.mgmt.sql.models.ServerPaged[~azure.mgmt.sql.models.Server] :raises: :class:`CloudError` """ - api_version = "2015-05-01-preview" - def prepare_request(next_link=None): if not next_link: # Construct URL @@ -205,7 +71,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: url = next_link @@ -266,8 +132,6 @@ def get( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2015-05-01-preview" - # Construct URL url = self.get.metadata['url'] path_format_arguments = { @@ -279,7 +143,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -314,8 +178,6 @@ def get( def _create_or_update_initial( self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2015-05-01-preview" - # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -327,7 +189,7 @@ def _create_or_update_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -420,8 +282,6 @@ def get_long_running_output(response): def _delete_initial( self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - api_version = "2015-05-01-preview" - # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -433,7 +293,7 @@ def _delete_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -503,8 +363,6 @@ def get_long_running_output(response): def _update_initial( self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2015-05-01-preview" - # Construct URL url = self.update.metadata['url'] path_format_arguments = { @@ -516,7 +374,7 @@ def _update_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -603,3 +461,133 @@ 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/servers/{serverName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of all servers 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 Server + :rtype: + ~azure.mgmt.sql.models.ServerPaged[~azure.mgmt.sql.models.Server] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.ServerPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers'} + + def check_name_availability( + self, name, custom_headers=None, raw=False, **operation_config): + """Determines whether a resource can be created with the specified name. + + :param name: + :type 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: CheckNameAvailabilityResponse or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.sql.models.CheckNameAvailabilityResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.CheckNameAvailabilityRequest(name=name) + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'CheckNameAvailabilityRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CheckNameAvailabilityResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_clusters_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_clusters_operations.py index b91ece534ef3..9178bc9720f6 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_clusters_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_clusters_operations.py @@ -324,9 +324,7 @@ def get_long_running_output(response): def _update_initial( - self, resource_group_name, virtual_cluster_name, family=None, tags=None, custom_headers=None, raw=False, **operation_config): - parameters = models.VirtualClusterUpdate(family=family, tags=tags) - + self, resource_group_name, virtual_cluster_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.update.metadata['url'] path_format_arguments = { @@ -375,7 +373,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, virtual_cluster_name, family=None, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, virtual_cluster_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a virtual cluster. :param resource_group_name: The name of the resource group that @@ -384,11 +382,8 @@ def update( :type resource_group_name: str :param virtual_cluster_name: The name of the virtual cluster. :type virtual_cluster_name: str - :param family: If the service has different generations of hardware, - for the same SKU, then that can be captured here. - :type family: str - :param tags: Resource tags. - :type tags: dict[str, str] + :param parameters: The requested managed instance resource state. + :type parameters: ~azure.mgmt.sql.models.VirtualClusterUpdate :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -405,8 +400,7 @@ def update( raw_result = self._update_initial( resource_group_name=resource_group_name, virtual_cluster_name=virtual_cluster_name, - family=family, - tags=tags, + parameters=parameters, custom_headers=custom_headers, raw=True, **operation_config