diff --git a/sdk/sql/azure-mgmt-sql/_meta.json b/sdk/sql/azure-mgmt-sql/_meta.json index d8898ab08b8e..7328dc5dbf22 100644 --- a/sdk/sql/azure-mgmt-sql/_meta.json +++ b/sdk/sql/azure-mgmt-sql/_meta.json @@ -1,7 +1,7 @@ { "autorest": "V2", "use": "@microsoft.azure/autorest.python@~4.0.71", - "commit": "1c801aa70be460b277f1d81f9cced889ca5008fe", + "commit": "e65054611156edb3bcf53cdc253909ed10cf746c", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest_command": "autorest specification/sql/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2", "readme": "specification/sql/resource-manager/readme.md" 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 80d1277facad..b23126c84991 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 @@ -110,7 +110,6 @@ from .operations import ServerDnsAliasesOperations from .operations import ServerKeysOperations from .operations import ServerOperations -from .operations import ServersOperations from .operations import ServerSecurityAlertPoliciesOperations from .operations import ServerTrustGroupsOperations from .operations import ServerVulnerabilityAssessmentsOperations @@ -132,6 +131,7 @@ from .operations import OutboundFirewallRulesOperations from .operations import RestorableDroppedDatabasesOperations from .operations import RestorableDroppedManagedDatabasesOperations +from .operations import ServersOperations from .operations import UsagesOperations from . import models @@ -336,8 +336,6 @@ class SqlManagementClient(SDKClient): :vartype server_keys: azure.mgmt.sql.operations.ServerKeysOperations :ivar server_operations: ServerOperations operations :vartype server_operations: azure.mgmt.sql.operations.ServerOperations - :ivar servers: Servers operations - :vartype servers: azure.mgmt.sql.operations.ServersOperations :ivar server_security_alert_policies: ServerSecurityAlertPolicies operations :vartype server_security_alert_policies: azure.mgmt.sql.operations.ServerSecurityAlertPoliciesOperations :ivar server_trust_groups: ServerTrustGroups operations @@ -380,6 +378,8 @@ class SqlManagementClient(SDKClient): :vartype restorable_dropped_databases: azure.mgmt.sql.operations.RestorableDroppedDatabasesOperations :ivar restorable_dropped_managed_databases: RestorableDroppedManagedDatabases operations :vartype restorable_dropped_managed_databases: azure.mgmt.sql.operations.RestorableDroppedManagedDatabasesOperations + :ivar servers: Servers operations + :vartype servers: azure.mgmt.sql.operations.ServersOperations :ivar usages: Usages operations :vartype usages: azure.mgmt.sql.operations.UsagesOperations @@ -596,8 +596,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.server_operations = ServerOperations( self._client, self.config, self._serialize, self._deserialize) - self.servers = ServersOperations( - self._client, self.config, self._serialize, self._deserialize) self.server_security_alert_policies = ServerSecurityAlertPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) self.server_trust_groups = ServerTrustGroupsOperations( @@ -640,5 +638,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.restorable_dropped_managed_databases = RestorableDroppedManagedDatabasesOperations( self._client, self.config, self._serialize, self._deserialize) + self.servers = ServersOperations( + self._client, self.config, self._serialize, self._deserialize) self.usages = UsagesOperations( self._client, self.config, self._serialize, self._deserialize) 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 1a3d33fc378d..a60a4ca75812 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 @@ -676,10 +676,6 @@ RestorePointType, AutomaticTuningServerMode, AutomaticTuningServerReason, - ServerPublicNetworkAccess, - ServerWorkspaceFeature, - StorageKeyType, - CheckNameAvailabilityReason, SyncAgentState, SyncMemberDbType, SyncGroupLogType, @@ -695,7 +691,14 @@ DatabaseReadScale, SecondaryType, CurrentBackupStorageRedundancy, + StorageKeyType, LedgerDigestUploadsState, + ReplicationRole, + ReplicationState, + ReplicationLinkType, + ServerNetworkAccessFlag, + ServerWorkspaceFeature, + CheckNameAvailabilityReason, VulnerabilityAssessmentPolicyBaselineName, CapabilityGroup, DatabaseState, @@ -1022,7 +1025,6 @@ 'ServerDnsAliasPaged', 'ServerKeyPaged', 'ServerOperationPaged', - 'ServerPaged', 'ServerSecurityAlertPolicyPaged', 'ServerTrustGroupPaged', 'ServerVulnerabilityAssessmentPaged', @@ -1046,6 +1048,7 @@ 'OutboundFirewallRulePaged', 'RestorableDroppedDatabasePaged', 'RestorableDroppedManagedDatabasePaged', + 'ServerPaged', 'UsagePaged', 'ServerConnectionType', 'DataMaskingState', @@ -1128,10 +1131,6 @@ 'RestorePointType', 'AutomaticTuningServerMode', 'AutomaticTuningServerReason', - 'ServerPublicNetworkAccess', - 'ServerWorkspaceFeature', - 'StorageKeyType', - 'CheckNameAvailabilityReason', 'SyncAgentState', 'SyncMemberDbType', 'SyncGroupLogType', @@ -1147,7 +1146,14 @@ 'DatabaseReadScale', 'SecondaryType', 'CurrentBackupStorageRedundancy', + 'StorageKeyType', 'LedgerDigestUploadsState', + 'ReplicationRole', + 'ReplicationState', + 'ReplicationLinkType', + 'ServerNetworkAccessFlag', + 'ServerWorkspaceFeature', + 'CheckNameAvailabilityReason', 'VulnerabilityAssessmentPolicyBaselineName', 'CapabilityGroup', 'DatabaseState', 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 990c66f58dd7..74d25b423864 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 @@ -9357,10 +9357,12 @@ class ReplicationLink(ProxyResource): :vartype partner_database: str :ivar partner_location: Resource partner location. :vartype partner_location: str - :ivar role: Local replication role. - :vartype role: str - :ivar partner_role: Partner replication role. - :vartype partner_role: str + :ivar role: Local replication role. Possible values include: 'Primary', + 'Secondary', 'NonReadableSecondary', 'Source', 'Copy' + :vartype role: str or ~azure.mgmt.sql.models.ReplicationRole + :ivar partner_role: Partner replication role. Possible values include: + 'Primary', 'Secondary', 'NonReadableSecondary', 'Source', 'Copy' + :vartype partner_role: str or ~azure.mgmt.sql.models.ReplicationRole :ivar replication_mode: Replication mode. :vartype replication_mode: str :ivar start_time: Time at which the link was created. @@ -9368,13 +9370,15 @@ class ReplicationLink(ProxyResource): :ivar percent_complete: Seeding completion percentage for the link. :vartype percent_complete: int :ivar replication_state: Replication state (PENDING, SEEDING, CATCHUP, - SUSPENDED). - :vartype replication_state: str + SUSPENDED). Possible values include: 'PENDING', 'SEEDING', 'CATCH_UP', + 'SUSPENDED' + :vartype replication_state: str or ~azure.mgmt.sql.models.ReplicationState :ivar is_termination_allowed: Whether the user is currently allowed to terminate the link. :vartype is_termination_allowed: bool - :ivar link_type: Link type (GEO, NAMED). - :vartype link_type: str + :ivar link_type: Link type (GEO, NAMED). Possible values include: 'GEO', + 'NAMED' + :vartype link_type: str or ~azure.mgmt.sql.models.ReplicationLinkType """ _validation = { @@ -9401,8 +9405,8 @@ class ReplicationLink(ProxyResource): 'partner_server': {'key': 'properties.partnerServer', 'type': 'str'}, 'partner_database': {'key': 'properties.partnerDatabase', 'type': 'str'}, 'partner_location': {'key': 'properties.partnerLocation', 'type': 'str'}, - 'role': {'key': 'properties.role', 'type': 'str'}, - 'partner_role': {'key': 'properties.partnerRole', 'type': 'str'}, + 'role': {'key': 'properties.role', 'type': 'ReplicationRole'}, + 'partner_role': {'key': 'properties.partnerRole', 'type': 'ReplicationRole'}, 'replication_mode': {'key': 'properties.replicationMode', 'type': 'str'}, 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, 'percent_complete': {'key': 'properties.percentComplete', 'type': 'int'}, @@ -10081,7 +10085,7 @@ class Server(TrackedResource): allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' :type public_network_access: str or - ~azure.mgmt.sql.models.ServerPublicNetworkAccess + ~azure.mgmt.sql.models.ServerNetworkAccessFlag :ivar workspace_feature: Whether or not existing server has a workspace created and if it allows connection from workspace. Possible values include: 'Connected', 'Disconnected' @@ -10090,10 +10094,19 @@ class Server(TrackedResource): :param primary_user_assigned_identity_id: The resource id of a user assigned identity to be used by default. :type primary_user_assigned_identity_id: str + :param federated_client_id: The Client id used for cross tenant CMK + scenario + :type federated_client_id: str :param key_id: A CMK URI of the key to use for encryption. :type key_id: str :param administrators: The Azure Active Directory identity of the server. :type administrators: ~azure.mgmt.sql.models.ServerExternalAdministrator + :param restrict_outbound_network_access: Whether or not to restrict + outbound network access for this server. Value is optional but if passed + in, must be 'Enabled' or 'Disabled'. Possible values include: 'Enabled', + 'Disabled' + :type restrict_outbound_network_access: str or + ~azure.mgmt.sql.models.ServerNetworkAccessFlag """ _validation = { @@ -10126,8 +10139,10 @@ class Server(TrackedResource): 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, 'workspace_feature': {'key': 'properties.workspaceFeature', 'type': 'str'}, 'primary_user_assigned_identity_id': {'key': 'properties.primaryUserAssignedIdentityId', 'type': 'str'}, + 'federated_client_id': {'key': 'properties.federatedClientId', 'type': 'str'}, 'key_id': {'key': 'properties.keyId', 'type': 'str'}, 'administrators': {'key': 'properties.administrators', 'type': 'ServerExternalAdministrator'}, + 'restrict_outbound_network_access': {'key': 'properties.restrictOutboundNetworkAccess', 'type': 'str'}, } def __init__(self, **kwargs): @@ -10144,8 +10159,10 @@ def __init__(self, **kwargs): self.public_network_access = kwargs.get('public_network_access', None) self.workspace_feature = None self.primary_user_assigned_identity_id = kwargs.get('primary_user_assigned_identity_id', None) + self.federated_client_id = kwargs.get('federated_client_id', None) self.key_id = kwargs.get('key_id', None) self.administrators = kwargs.get('administrators', None) + self.restrict_outbound_network_access = kwargs.get('restrict_outbound_network_access', None) class ServerAutomaticTuning(ProxyResource): @@ -11140,7 +11157,7 @@ class ServerUpdate(Model): allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' :type public_network_access: str or - ~azure.mgmt.sql.models.ServerPublicNetworkAccess + ~azure.mgmt.sql.models.ServerNetworkAccessFlag :ivar workspace_feature: Whether or not existing server has a workspace created and if it allows connection from workspace. Possible values include: 'Connected', 'Disconnected' @@ -11149,10 +11166,19 @@ class ServerUpdate(Model): :param primary_user_assigned_identity_id: The resource id of a user assigned identity to be used by default. :type primary_user_assigned_identity_id: str + :param federated_client_id: The Client id used for cross tenant CMK + scenario + :type federated_client_id: str :param key_id: A CMK URI of the key to use for encryption. :type key_id: str :param administrators: The Azure Active Directory identity of the server. :type administrators: ~azure.mgmt.sql.models.ServerExternalAdministrator + :param restrict_outbound_network_access: Whether or not to restrict + outbound network access for this server. Value is optional but if passed + in, must be 'Enabled' or 'Disabled'. Possible values include: 'Enabled', + 'Disabled' + :type restrict_outbound_network_access: str or + ~azure.mgmt.sql.models.ServerNetworkAccessFlag :param tags: Resource tags. :type tags: dict[str, str] """ @@ -11176,8 +11202,10 @@ class ServerUpdate(Model): 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, 'workspace_feature': {'key': 'properties.workspaceFeature', 'type': 'str'}, 'primary_user_assigned_identity_id': {'key': 'properties.primaryUserAssignedIdentityId', 'type': 'str'}, + 'federated_client_id': {'key': 'properties.federatedClientId', 'type': 'str'}, 'key_id': {'key': 'properties.keyId', 'type': 'str'}, 'administrators': {'key': 'properties.administrators', 'type': 'ServerExternalAdministrator'}, + 'restrict_outbound_network_access': {'key': 'properties.restrictOutboundNetworkAccess', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } @@ -11194,8 +11222,10 @@ def __init__(self, **kwargs): self.public_network_access = kwargs.get('public_network_access', None) self.workspace_feature = None self.primary_user_assigned_identity_id = kwargs.get('primary_user_assigned_identity_id', None) + self.federated_client_id = kwargs.get('federated_client_id', None) self.key_id = kwargs.get('key_id', None) self.administrators = kwargs.get('administrators', None) + self.restrict_outbound_network_access = kwargs.get('restrict_outbound_network_access', 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 e6d6126f4594..06498754185e 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 @@ -9357,10 +9357,12 @@ class ReplicationLink(ProxyResource): :vartype partner_database: str :ivar partner_location: Resource partner location. :vartype partner_location: str - :ivar role: Local replication role. - :vartype role: str - :ivar partner_role: Partner replication role. - :vartype partner_role: str + :ivar role: Local replication role. Possible values include: 'Primary', + 'Secondary', 'NonReadableSecondary', 'Source', 'Copy' + :vartype role: str or ~azure.mgmt.sql.models.ReplicationRole + :ivar partner_role: Partner replication role. Possible values include: + 'Primary', 'Secondary', 'NonReadableSecondary', 'Source', 'Copy' + :vartype partner_role: str or ~azure.mgmt.sql.models.ReplicationRole :ivar replication_mode: Replication mode. :vartype replication_mode: str :ivar start_time: Time at which the link was created. @@ -9368,13 +9370,15 @@ class ReplicationLink(ProxyResource): :ivar percent_complete: Seeding completion percentage for the link. :vartype percent_complete: int :ivar replication_state: Replication state (PENDING, SEEDING, CATCHUP, - SUSPENDED). - :vartype replication_state: str + SUSPENDED). Possible values include: 'PENDING', 'SEEDING', 'CATCH_UP', + 'SUSPENDED' + :vartype replication_state: str or ~azure.mgmt.sql.models.ReplicationState :ivar is_termination_allowed: Whether the user is currently allowed to terminate the link. :vartype is_termination_allowed: bool - :ivar link_type: Link type (GEO, NAMED). - :vartype link_type: str + :ivar link_type: Link type (GEO, NAMED). Possible values include: 'GEO', + 'NAMED' + :vartype link_type: str or ~azure.mgmt.sql.models.ReplicationLinkType """ _validation = { @@ -9401,8 +9405,8 @@ class ReplicationLink(ProxyResource): 'partner_server': {'key': 'properties.partnerServer', 'type': 'str'}, 'partner_database': {'key': 'properties.partnerDatabase', 'type': 'str'}, 'partner_location': {'key': 'properties.partnerLocation', 'type': 'str'}, - 'role': {'key': 'properties.role', 'type': 'str'}, - 'partner_role': {'key': 'properties.partnerRole', 'type': 'str'}, + 'role': {'key': 'properties.role', 'type': 'ReplicationRole'}, + 'partner_role': {'key': 'properties.partnerRole', 'type': 'ReplicationRole'}, 'replication_mode': {'key': 'properties.replicationMode', 'type': 'str'}, 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, 'percent_complete': {'key': 'properties.percentComplete', 'type': 'int'}, @@ -10081,7 +10085,7 @@ class Server(TrackedResource): allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' :type public_network_access: str or - ~azure.mgmt.sql.models.ServerPublicNetworkAccess + ~azure.mgmt.sql.models.ServerNetworkAccessFlag :ivar workspace_feature: Whether or not existing server has a workspace created and if it allows connection from workspace. Possible values include: 'Connected', 'Disconnected' @@ -10090,10 +10094,19 @@ class Server(TrackedResource): :param primary_user_assigned_identity_id: The resource id of a user assigned identity to be used by default. :type primary_user_assigned_identity_id: str + :param federated_client_id: The Client id used for cross tenant CMK + scenario + :type federated_client_id: str :param key_id: A CMK URI of the key to use for encryption. :type key_id: str :param administrators: The Azure Active Directory identity of the server. :type administrators: ~azure.mgmt.sql.models.ServerExternalAdministrator + :param restrict_outbound_network_access: Whether or not to restrict + outbound network access for this server. Value is optional but if passed + in, must be 'Enabled' or 'Disabled'. Possible values include: 'Enabled', + 'Disabled' + :type restrict_outbound_network_access: str or + ~azure.mgmt.sql.models.ServerNetworkAccessFlag """ _validation = { @@ -10126,11 +10139,13 @@ class Server(TrackedResource): 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, 'workspace_feature': {'key': 'properties.workspaceFeature', 'type': 'str'}, 'primary_user_assigned_identity_id': {'key': 'properties.primaryUserAssignedIdentityId', 'type': 'str'}, + 'federated_client_id': {'key': 'properties.federatedClientId', 'type': 'str'}, 'key_id': {'key': 'properties.keyId', 'type': 'str'}, 'administrators': {'key': 'properties.administrators', 'type': 'ServerExternalAdministrator'}, + 'restrict_outbound_network_access': {'key': 'properties.restrictOutboundNetworkAccess', 'type': 'str'}, } - def __init__(self, *, location: str, tags=None, identity=None, administrator_login: str=None, administrator_login_password: str=None, version: str=None, minimal_tls_version: str=None, public_network_access=None, primary_user_assigned_identity_id: str=None, key_id: str=None, administrators=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, identity=None, administrator_login: str=None, administrator_login_password: str=None, version: str=None, minimal_tls_version: str=None, public_network_access=None, primary_user_assigned_identity_id: str=None, federated_client_id: str=None, key_id: str=None, administrators=None, restrict_outbound_network_access=None, **kwargs) -> None: super(Server, self).__init__(location=location, tags=tags, **kwargs) self.identity = identity self.kind = None @@ -10144,8 +10159,10 @@ def __init__(self, *, location: str, tags=None, identity=None, administrator_log self.public_network_access = public_network_access self.workspace_feature = None self.primary_user_assigned_identity_id = primary_user_assigned_identity_id + self.federated_client_id = federated_client_id self.key_id = key_id self.administrators = administrators + self.restrict_outbound_network_access = restrict_outbound_network_access class ServerAutomaticTuning(ProxyResource): @@ -11140,7 +11157,7 @@ class ServerUpdate(Model): allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' :type public_network_access: str or - ~azure.mgmt.sql.models.ServerPublicNetworkAccess + ~azure.mgmt.sql.models.ServerNetworkAccessFlag :ivar workspace_feature: Whether or not existing server has a workspace created and if it allows connection from workspace. Possible values include: 'Connected', 'Disconnected' @@ -11149,10 +11166,19 @@ class ServerUpdate(Model): :param primary_user_assigned_identity_id: The resource id of a user assigned identity to be used by default. :type primary_user_assigned_identity_id: str + :param federated_client_id: The Client id used for cross tenant CMK + scenario + :type federated_client_id: str :param key_id: A CMK URI of the key to use for encryption. :type key_id: str :param administrators: The Azure Active Directory identity of the server. :type administrators: ~azure.mgmt.sql.models.ServerExternalAdministrator + :param restrict_outbound_network_access: Whether or not to restrict + outbound network access for this server. Value is optional but if passed + in, must be 'Enabled' or 'Disabled'. Possible values include: 'Enabled', + 'Disabled' + :type restrict_outbound_network_access: str or + ~azure.mgmt.sql.models.ServerNetworkAccessFlag :param tags: Resource tags. :type tags: dict[str, str] """ @@ -11176,12 +11202,14 @@ class ServerUpdate(Model): 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, 'workspace_feature': {'key': 'properties.workspaceFeature', 'type': 'str'}, 'primary_user_assigned_identity_id': {'key': 'properties.primaryUserAssignedIdentityId', 'type': 'str'}, + 'federated_client_id': {'key': 'properties.federatedClientId', 'type': 'str'}, 'key_id': {'key': 'properties.keyId', 'type': 'str'}, 'administrators': {'key': 'properties.administrators', 'type': 'ServerExternalAdministrator'}, + 'restrict_outbound_network_access': {'key': 'properties.restrictOutboundNetworkAccess', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, identity=None, administrator_login: str=None, administrator_login_password: str=None, version: str=None, minimal_tls_version: str=None, public_network_access=None, primary_user_assigned_identity_id: str=None, key_id: str=None, administrators=None, tags=None, **kwargs) -> None: + def __init__(self, *, identity=None, administrator_login: str=None, administrator_login_password: str=None, version: str=None, minimal_tls_version: str=None, public_network_access=None, primary_user_assigned_identity_id: str=None, federated_client_id: str=None, key_id: str=None, administrators=None, restrict_outbound_network_access=None, tags=None, **kwargs) -> None: super(ServerUpdate, self).__init__(**kwargs) self.identity = identity self.administrator_login = administrator_login @@ -11194,8 +11222,10 @@ def __init__(self, *, identity=None, administrator_login: str=None, administrato self.public_network_access = public_network_access self.workspace_feature = None self.primary_user_assigned_identity_id = primary_user_assigned_identity_id + self.federated_client_id = federated_client_id self.key_id = key_id self.administrators = administrators + self.restrict_outbound_network_access = restrict_outbound_network_access 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 39496c8c45b9..208f55efb72a 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 @@ -974,19 +974,6 @@ class ServerOperationPaged(Paged): def __init__(self, *args, **kwargs): super(ServerOperationPaged, 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 ServerSecurityAlertPolicyPaged(Paged): """ A paging container for iterating over a list of :class:`ServerSecurityAlertPolicy ` object @@ -1286,6 +1273,19 @@ class RestorableDroppedManagedDatabasePaged(Paged): def __init__(self, *args, **kwargs): super(RestorableDroppedManagedDatabasePaged, 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 UsagePaged(Paged): """ A paging container for iterating over a list of :class:`Usage ` 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 48120042235f..fd0a32374104 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 @@ -698,30 +698,6 @@ class AutomaticTuningServerReason(str, Enum): auto_configured = "AutoConfigured" -class ServerPublicNetworkAccess(str, Enum): - - enabled = "Enabled" - disabled = "Disabled" - - -class ServerWorkspaceFeature(str, Enum): - - connected = "Connected" - disconnected = "Disconnected" - - -class StorageKeyType(str, Enum): - - shared_access_key = "SharedAccessKey" - storage_access_key = "StorageAccessKey" - - -class CheckNameAvailabilityReason(str, Enum): - - invalid = "Invalid" - already_exists = "AlreadyExists" - - class SyncAgentState(str, Enum): online = "Online" @@ -868,12 +844,59 @@ class CurrentBackupStorageRedundancy(str, Enum): zone = "Zone" +class StorageKeyType(str, Enum): + + shared_access_key = "SharedAccessKey" + storage_access_key = "StorageAccessKey" + + class LedgerDigestUploadsState(str, Enum): enabled = "Enabled" disabled = "Disabled" +class ReplicationRole(str, Enum): + + primary = "Primary" + secondary = "Secondary" + non_readable_secondary = "NonReadableSecondary" + source = "Source" + copy = "Copy" + + +class ReplicationState(str, Enum): + + pending = "PENDING" + seeding = "SEEDING" + catch_up = "CATCH_UP" + suspended = "SUSPENDED" + + +class ReplicationLinkType(str, Enum): + + geo = "GEO" + named = "NAMED" + + +class ServerNetworkAccessFlag(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class ServerWorkspaceFeature(str, Enum): + + connected = "Connected" + disconnected = "Disconnected" + + +class CheckNameAvailabilityReason(str, Enum): + + invalid = "Invalid" + already_exists = "AlreadyExists" + + class VulnerabilityAssessmentPolicyBaselineName(str, Enum): master = "master" 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 c403cfa700e7..b56678e98293 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 @@ -106,7 +106,6 @@ from ._server_dns_aliases_operations import ServerDnsAliasesOperations from ._server_keys_operations import ServerKeysOperations from ._server_operations import ServerOperations -from ._servers_operations import ServersOperations from ._server_security_alert_policies_operations import ServerSecurityAlertPoliciesOperations from ._server_trust_groups_operations import ServerTrustGroupsOperations from ._server_vulnerability_assessments_operations import ServerVulnerabilityAssessmentsOperations @@ -128,6 +127,7 @@ from ._outbound_firewall_rules_operations import OutboundFirewallRulesOperations from ._restorable_dropped_databases_operations import RestorableDroppedDatabasesOperations from ._restorable_dropped_managed_databases_operations import RestorableDroppedManagedDatabasesOperations +from ._servers_operations import ServersOperations from ._usages_operations import UsagesOperations __all__ = [ @@ -228,7 +228,6 @@ 'ServerDnsAliasesOperations', 'ServerKeysOperations', 'ServerOperations', - 'ServersOperations', 'ServerSecurityAlertPoliciesOperations', 'ServerTrustGroupsOperations', 'ServerVulnerabilityAssessmentsOperations', @@ -250,5 +249,6 @@ 'OutboundFirewallRulesOperations', 'RestorableDroppedDatabasesOperations', 'RestorableDroppedManagedDatabasesOperations', + 'ServersOperations', 'UsagesOperations', ] diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_replication_links_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_replication_links_operations.py index b833f146eab2..0faf066067ce 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_replication_links_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_replication_links_operations.py @@ -103,6 +103,77 @@ def delete( return client_raw_response delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}'} + def get( + self, resource_group_name, server_name, database_name, link_id, custom_headers=None, raw=False, **operation_config): + """Gets a replication link. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param link_id: The name of the replication link. + :type link_id: 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: ReplicationLink or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.ReplicationLink or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2021-02-01-preview" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'linkId': self._serialize.url("link_id", link_id, '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("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ReplicationLink', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}'} + def _failover_initial( self, resource_group_name, server_name, database_name, link_id, custom_headers=None, raw=False, **operation_config): @@ -399,11 +470,9 @@ def list_by_database( contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param server_name: The name of the server containing the replication - link. + :param server_name: The name of the server. :type server_name: str - :param database_name: The name of the database containing the - replication link. + :param database_name: The name of the database. :type database_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -415,7 +484,7 @@ def list_by_database( ~azure.mgmt.sql.models.ReplicationLinkPaged[~azure.mgmt.sql.models.ReplicationLink] :raises: :class:`CloudError` """ - api_version = "2020-11-01-preview" + api_version = "2021-02-01-preview" def prepare_request(next_link=None): if not next_link: @@ -472,79 +541,6 @@ def internal_paging(next_link=None): return deserialized list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks'} - def get( - self, resource_group_name, server_name, database_name, replication_link_name, custom_headers=None, raw=False, **operation_config): - """Gets a replication link. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server containing the replication - link. - :type server_name: str - :param database_name: The name of the database containing the - replication link. - :type database_name: str - :param replication_link_name: The name of the replication link. - :type replication_link_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: ReplicationLink or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.ReplicationLink or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2020-11-01-preview" - - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'replicationLinkName': self._serialize.url("replication_link_name", replication_link_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("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ReplicationLink', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{replicationLinkName}'} - def list_by_server( self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): """Gets a list of replication links. @@ -553,8 +549,7 @@ def list_by_server( contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param server_name: The name of the server containing the replication - link. + :param server_name: The name of the server. :type server_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -566,7 +561,7 @@ def list_by_server( ~azure.mgmt.sql.models.ReplicationLinkPaged[~azure.mgmt.sql.models.ReplicationLink] :raises: :class:`CloudError` """ - api_version = "2020-11-01-preview" + api_version = "2021-02-01-preview" def prepare_request(next_link=None): if not next_link: 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 ec9379b63f81..13ff4548c1ec 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,7 +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: "2020-11-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-11-01-preview" + self.api_version = "2021-02-01-preview" self.config = config