diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py b/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py index 42c6198cb65c..f8bc77f6e2f4 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py @@ -9,165 +9,163 @@ # regenerated. # -------------------------------------------------------------------------- -from .server_firewall_rule import ServerFirewallRule -from .sql_sub_resource import SqlSubResource -from .import_extension_request_parameters import ImportExtensionRequestParameters -from .import_export_operation_response import ImportExportOperationResponse -from .import_export_operation_response_properties_model import ImportExportOperationResponsePropertiesModel -from .import_request_parameters import ImportRequestParameters -from .export_request_parameters import ExportRequestParameters -from .replication_link import ReplicationLink -from .recommended_elastic_pool_metric import RecommendedElasticPoolMetric +from .max_size_capability import MaxSizeCapability +from .service_objective_capability import ServiceObjectiveCapability +from .edition_capability import EditionCapability +from .server_version_capability import ServerVersionCapability +from .location_capabilities import LocationCapabilities +from .firewall_rule import FirewallRule +from .transparent_data_encryption import TransparentDataEncryption from .slo_usage_metric import SloUsageMetric from .service_tier_advisor import ServiceTierAdvisor -from .column import Column +from .database_metric import DatabaseMetric +from .service_objective import ServiceObjective +from .transparent_data_encryption_activity import TransparentDataEncryptionActivity +from .sub_resource import SubResource +from .import_extension_request import ImportExtensionRequest +from .import_export_response import ImportExportResponse +from .import_request import ImportRequest +from .export_request import ExportRequest +from .elastic_pool import ElasticPool +from .server import Server from .operation_impact import OperationImpact from .recommended_index import RecommendedIndex -from .table import Table -from .schema import Schema -from .transparent_data_encryption import TransparentDataEncryption from .database import Database +from .tracked_resource import TrackedResource +from .resource import Resource +from .recommended_elastic_pool_metric import RecommendedElasticPoolMetric from .recommended_elastic_pool import RecommendedElasticPool -from .elastic_pool import ElasticPool from .elastic_pool_activity import ElasticPoolActivity from .elastic_pool_database_activity import ElasticPoolDatabaseActivity -from .server import Server -from .upgrade_recommended_elastic_pool_properties import UpgradeRecommendedElasticPoolProperties -from .upgrade_hint import UpgradeHint from .restore_point import RestorePoint -from .database_metric import DatabaseMetric +from .proxy_resource import ProxyResource +from .replication_link import ReplicationLink from .server_metric import ServerMetric -from .service_objective import ServiceObjective -from .transparent_data_encryption_activity import TransparentDataEncryptionActivity -from .resource import Resource -from .sql_typed_sub_resource import SqlTypedSubResource from .operation_display import OperationDisplay from .operation import Operation from .operation_list_result import OperationListResult from .database_security_alert_policy import DatabaseSecurityAlertPolicy from .database_blob_auditing_policy import DatabaseBlobAuditingPolicy -from .server_firewall_rule_paged import ServerFirewallRulePaged -from .server_paged import ServerPaged -from .server_metric_paged import ServerMetricPaged -from .service_objective_paged import ServiceObjectivePaged +from .firewall_rule_paged import FirewallRulePaged from .replication_link_paged import ReplicationLinkPaged from .restore_point_paged import RestorePointPaged from .database_paged import DatabasePaged from .database_metric_paged import DatabaseMetricPaged from .service_tier_advisor_paged import ServiceTierAdvisorPaged from .transparent_data_encryption_activity_paged import TransparentDataEncryptionActivityPaged -from .import_export_operation_response_paged import ImportExportOperationResponsePaged +from .server_paged import ServerPaged +from .server_metric_paged import ServerMetricPaged +from .service_objective_paged import ServiceObjectivePaged from .elastic_pool_paged import ElasticPoolPaged from .elastic_pool_activity_paged import ElasticPoolActivityPaged from .elastic_pool_database_activity_paged import ElasticPoolDatabaseActivityPaged from .recommended_elastic_pool_paged import RecommendedElasticPoolPaged from .recommended_elastic_pool_metric_paged import RecommendedElasticPoolMetricPaged from .sql_management_client_enums import ( + CapabilityStatus, + MaxSizeUnits, + PerformanceLevelUnit, + TransparentDataEncryptionStatus, + ServiceObjectiveName, + TransparentDataEncryptionActivityStatus, + DatabaseEdition, StorageKeyType, AuthenticationType, - ReplicationRole, - ReplicationState, - ElasticPoolEditions, - CreateMode, - DatabaseEditions, - ServiceObjectiveName, - TableType, - RecommendedIndexActions, - RecommendedIndexStates, - RecommendedIndexTypes, - TransparentDataEncryptionStates, - ReadScale, - SampleName, ElasticPoolState, + ElasticPoolEdition, ServerVersion, ServerState, - TargetElasticPoolEditions, + RecommendedIndexAction, + RecommendedIndexState, + RecommendedIndexType, + CreateMode, + ReadScale, + SampleName, RestorePointTypes, - TransparentDataEncryptionActivityStates, + ReplicationRole, + ReplicationState, SecurityAlertPolicyState, - SecurityAlert, SecurityAlertPolicyEmailAccountAdmins, SecurityAlertPolicyUseServerDefault, BlobAuditingPolicyState, ) __all__ = [ - 'ServerFirewallRule', - 'SqlSubResource', - 'ImportExtensionRequestParameters', - 'ImportExportOperationResponse', - 'ImportExportOperationResponsePropertiesModel', - 'ImportRequestParameters', - 'ExportRequestParameters', - 'ReplicationLink', - 'RecommendedElasticPoolMetric', + 'MaxSizeCapability', + 'ServiceObjectiveCapability', + 'EditionCapability', + 'ServerVersionCapability', + 'LocationCapabilities', + 'FirewallRule', + 'TransparentDataEncryption', 'SloUsageMetric', 'ServiceTierAdvisor', - 'Column', + 'DatabaseMetric', + 'ServiceObjective', + 'TransparentDataEncryptionActivity', + 'SubResource', + 'ImportExtensionRequest', + 'ImportExportResponse', + 'ImportRequest', + 'ExportRequest', + 'ElasticPool', + 'Server', 'OperationImpact', 'RecommendedIndex', - 'Table', - 'Schema', - 'TransparentDataEncryption', 'Database', + 'TrackedResource', + 'Resource', + 'RecommendedElasticPoolMetric', 'RecommendedElasticPool', - 'ElasticPool', 'ElasticPoolActivity', 'ElasticPoolDatabaseActivity', - 'Server', - 'UpgradeRecommendedElasticPoolProperties', - 'UpgradeHint', 'RestorePoint', - 'DatabaseMetric', + 'ProxyResource', + 'ReplicationLink', 'ServerMetric', - 'ServiceObjective', - 'TransparentDataEncryptionActivity', - 'Resource', - 'SqlTypedSubResource', 'OperationDisplay', 'Operation', 'OperationListResult', 'DatabaseSecurityAlertPolicy', 'DatabaseBlobAuditingPolicy', - 'ServerFirewallRulePaged', - 'ServerPaged', - 'ServerMetricPaged', - 'ServiceObjectivePaged', + 'FirewallRulePaged', 'ReplicationLinkPaged', 'RestorePointPaged', 'DatabasePaged', 'DatabaseMetricPaged', 'ServiceTierAdvisorPaged', 'TransparentDataEncryptionActivityPaged', - 'ImportExportOperationResponsePaged', + 'ServerPaged', + 'ServerMetricPaged', + 'ServiceObjectivePaged', 'ElasticPoolPaged', 'ElasticPoolActivityPaged', 'ElasticPoolDatabaseActivityPaged', 'RecommendedElasticPoolPaged', 'RecommendedElasticPoolMetricPaged', + 'CapabilityStatus', + 'MaxSizeUnits', + 'PerformanceLevelUnit', + 'TransparentDataEncryptionStatus', + 'ServiceObjectiveName', + 'TransparentDataEncryptionActivityStatus', + 'DatabaseEdition', 'StorageKeyType', 'AuthenticationType', - 'ReplicationRole', - 'ReplicationState', - 'ElasticPoolEditions', - 'CreateMode', - 'DatabaseEditions', - 'ServiceObjectiveName', - 'TableType', - 'RecommendedIndexActions', - 'RecommendedIndexStates', - 'RecommendedIndexTypes', - 'TransparentDataEncryptionStates', - 'ReadScale', - 'SampleName', 'ElasticPoolState', + 'ElasticPoolEdition', 'ServerVersion', 'ServerState', - 'TargetElasticPoolEditions', + 'RecommendedIndexAction', + 'RecommendedIndexState', + 'RecommendedIndexType', + 'CreateMode', + 'ReadScale', + 'SampleName', 'RestorePointTypes', - 'TransparentDataEncryptionActivityStates', + 'ReplicationRole', + 'ReplicationState', 'SecurityAlertPolicyState', - 'SecurityAlert', 'SecurityAlertPolicyEmailAccountAdmins', 'SecurityAlertPolicyUseServerDefault', 'BlobAuditingPolicyState', diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database.py b/azure-mgmt-sql/azure/mgmt/sql/models/database.py index 943c07f8494e..32c408d1c297 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/database.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database.py @@ -9,25 +9,25 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .tracked_resource import TrackedResource -class Database(Resource): +class Database(TrackedResource): """Represents a database. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Resource name - :vartype name: str - :ivar id: Resource ID + :ivar id: Resource ID. :vartype id: str - :ivar type: Resource type + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. :vartype type: str - :param location: Resource location - :type location: str - :param tags: Resource tags + :param tags: Resource tags. :type tags: dict + :param location: Resource location. + :type location: str :ivar kind: Kind of database. This is metadata used for the Azure portal experience. :vartype kind: str @@ -103,16 +103,19 @@ class Database(Resource): :type recovery_services_recovery_point_resource_id: datetime :param edition: The edition of the database. The DatabaseEditions enumeration contains all the valid editions. If createMode is - NonReadableSecondary or OnlineSecondary, this value is ignored. Possible + NonReadableSecondary or OnlineSecondary, this value is ignored. To see + possible values, query the capabilities API + (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + referred to by operationId: "Capabilities_ListByLocation.". Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - 'Stretch', 'DataWarehouse', 'System' - :type edition: str or :class:`DatabaseEditions - ` + 'Stretch', 'DataWarehouse', 'System', 'System2' + :type edition: str or :class:`DatabaseEdition + ` :param max_size_bytes: The max size of the database expressed in bytes. If - createMode is not Default, this value is ignored. Note: Only the following - sizes are supported (in addition to limitations being placed on each - edition): { 100 MB | 500 MB |1 GB | 5 GB | 10 GB | 20 GB | 30 GB … 150 GB - | 200 GB … 500 GB } + createMode is not Default, this value is ignored. To see possible values, + query the capabilities API + (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + referred to by operationId: "Capabilities_ListByLocation." :type max_size_bytes: str :param requested_service_objective_id: The configured service level objective ID of the database. This is the service level objective that is @@ -120,19 +123,25 @@ class Database(Resource): updated, it will match the value of currentServiceObjectiveId property. If requestedServiceObjectiveId and requestedServiceObjectiveName are both updated, the value of requestedServiceObjectiveId overrides the value of - requestedServiceObjectiveName. + requestedServiceObjectiveName. To see possible values, query the + capabilities API + (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + referred to by operationId: "Capabilities_ListByLocation." :type requested_service_objective_id: str :param requested_service_objective_name: The name of the configured service level objective of the database. This is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of serviceLevelObjective - property. Possible values include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', - 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', 'ElasticPool' + property. To see possible values, query the capabilities API + (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) + referred to by operationId: "Capabilities_ListByLocation.". Possible + values include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', + 'P6', 'P11', 'P15', 'System', 'System2', 'ElasticPool' :type requested_service_objective_name: str or :class:`ServiceObjectiveName ` :ivar service_level_objective: The current service level objective of the database. Possible values include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', - 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', 'ElasticPool' + 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', 'System2', 'ElasticPool' :vartype service_level_objective: str or :class:`ServiceObjectiveName ` :ivar status: The status of the database. @@ -149,8 +158,6 @@ class Database(Resource): database. Expanded property :vartype service_tier_advisors: list of :class:`ServiceTierAdvisor ` - :ivar schemas: The schemas from this database. - :vartype schemas: list of :class:`Schema ` :ivar transparent_data_encryption: The transparent data encryption info for this database. :vartype transparent_data_encryption: list of @@ -177,8 +184,8 @@ class Database(Resource): """ _validation = { - 'name': {'readonly': True}, 'id': {'readonly': True}, + 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, 'kind': {'readonly': True}, @@ -191,18 +198,17 @@ class Database(Resource): 'status': {'readonly': True}, 'default_secondary_location': {'readonly': True}, 'service_tier_advisors': {'readonly': True}, - 'schemas': {'readonly': True}, 'transparent_data_encryption': {'readonly': True}, 'recommended_index': {'readonly': True}, 'failover_group_id': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, 'collation': {'key': 'properties.collation', 'type': 'str'}, 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, @@ -224,7 +230,6 @@ class Database(Resource): 'elastic_pool_name': {'key': 'properties.elasticPoolName', 'type': 'str'}, 'default_secondary_location': {'key': 'properties.defaultSecondaryLocation', 'type': 'str'}, 'service_tier_advisors': {'key': 'properties.serviceTierAdvisors', 'type': '[ServiceTierAdvisor]'}, - 'schemas': {'key': 'properties.schemas', 'type': '[Schema]'}, 'transparent_data_encryption': {'key': 'properties.transparentDataEncryption', 'type': '[TransparentDataEncryption]'}, 'recommended_index': {'key': 'properties.recommendedIndex', 'type': '[RecommendedIndex]'}, 'failover_group_id': {'key': 'properties.failoverGroupId', 'type': 'str'}, @@ -233,7 +238,7 @@ class Database(Resource): } def __init__(self, location, tags=None, collation=None, create_mode=None, source_database_id=None, source_database_deletion_date=None, restore_point_in_time=None, recovery_services_recovery_point_resource_id=None, edition=None, max_size_bytes=None, requested_service_objective_id=None, requested_service_objective_name=None, elastic_pool_name=None, read_scale=None, sample_name=None): - super(Database, self).__init__(location=location, tags=tags) + super(Database, self).__init__(tags=tags, location=location) self.kind = None self.collation = collation self.creation_date = None @@ -255,7 +260,6 @@ def __init__(self, location, tags=None, collation=None, create_mode=None, source self.elastic_pool_name = elastic_pool_name self.default_secondary_location = None self.service_tier_advisors = None - self.schemas = None self.transparent_data_encryption = None self.recommended_index = None self.failover_group_id = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy.py index 9516d283fbb6..dbcf27ae44be 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy.py @@ -9,21 +9,25 @@ # regenerated. # -------------------------------------------------------------------------- -from .sql_typed_sub_resource import SqlTypedSubResource +from .proxy_resource import ProxyResource -class DatabaseBlobAuditingPolicy(SqlTypedSubResource): +class DatabaseBlobAuditingPolicy(ProxyResource): """Contains information about a database Blob Auditing policy. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Resource name - :vartype name: str - :ivar id: The resource ID. + :ivar id: Resource ID. :vartype id: str - :ivar type: Resource type + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. :vartype type: str + :param location: The geo-location where the resource lives + :type location: str + :ivar kind: Resource kind. + :vartype kind: str :param state: Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required. Possible values include: 'Enabled', 'Disabled' @@ -52,16 +56,19 @@ class DatabaseBlobAuditingPolicy(SqlTypedSubResource): """ _validation = { - 'name': {'readonly': True}, 'id': {'readonly': True}, + 'name': {'readonly': True}, 'type': {'readonly': True}, + 'kind': {'readonly': True}, 'state': {'required': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, 'state': {'key': 'properties.state', 'type': 'BlobAuditingPolicyState'}, 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, @@ -71,8 +78,10 @@ class DatabaseBlobAuditingPolicy(SqlTypedSubResource): 'is_storage_secondary_key_in_use': {'key': 'properties.isStorageSecondaryKeyInUse', 'type': 'bool'}, } - def __init__(self, state, storage_endpoint=None, storage_account_access_key=None, retention_days=None, audit_actions_and_groups=None, storage_account_subscription_id=None, is_storage_secondary_key_in_use=None): + def __init__(self, state, location=None, storage_endpoint=None, storage_account_access_key=None, retention_days=None, audit_actions_and_groups=None, storage_account_subscription_id=None, is_storage_secondary_key_in_use=None): super(DatabaseBlobAuditingPolicy, self).__init__() + self.location = location + self.kind = None self.state = state self.storage_endpoint = storage_endpoint self.storage_account_access_key = storage_account_access_key diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_metric.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_metric.py index 4cb4aa55074c..a9ac600c866b 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/database_metric.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_metric.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .sql_sub_resource import SqlSubResource +from .sub_resource import SubResource -class DatabaseMetric(SqlSubResource): +class DatabaseMetric(SubResource): """Represents database metrics. Variables are only populated by the server, and will be ignored when diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_security_alert_policy.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_security_alert_policy.py index 7ce527b04b46..9675f37dc1f9 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/database_security_alert_policy.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_security_alert_policy.py @@ -9,32 +9,34 @@ # regenerated. # -------------------------------------------------------------------------- -from .sql_typed_sub_resource import SqlTypedSubResource +from .proxy_resource import ProxyResource -class DatabaseSecurityAlertPolicy(SqlTypedSubResource): +class DatabaseSecurityAlertPolicy(ProxyResource): """Contains information about a database Threat Detection policy. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Resource name - :vartype name: str - :ivar id: The resource ID. + :ivar id: Resource ID. :vartype id: str - :ivar type: Resource type + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. :vartype type: str + :param location: The geo-location where the resource lives + :type location: str + :ivar kind: Resource kind. + :vartype kind: str :param state: Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required. Possible values include: 'New', 'Enabled', 'Disabled' :type state: str or :class:`SecurityAlertPolicyState ` - :param disabled_alerts: Specifies the comma-separated list of alerts that - are disabled, or empty string to disable no alerts. Possible values - include: 'Sql_Injection', 'Sql_Injection_Vulnerability', 'Access_Anomaly', - 'Usage_Anomaly', 'Preview' - :type disabled_alerts: str or :class:`SecurityAlert - ` + :param disabled_alerts: Specifies the semicolon-separated list of alerts + that are disabled, or empty string to disable no alerts. Possible values: + Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; Usage_Anomaly. + :type disabled_alerts: str :param email_addresses: Specifies the semicolon-separated list of e-mail addresses to which the alert is sent. :type email_addresses: str @@ -63,16 +65,19 @@ class DatabaseSecurityAlertPolicy(SqlTypedSubResource): """ _validation = { - 'name': {'readonly': True}, 'id': {'readonly': True}, + 'name': {'readonly': True}, 'type': {'readonly': True}, + 'kind': {'readonly': True}, 'state': {'required': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, 'state': {'key': 'properties.state', 'type': 'SecurityAlertPolicyState'}, 'disabled_alerts': {'key': 'properties.disabledAlerts', 'type': 'str'}, 'email_addresses': {'key': 'properties.emailAddresses', 'type': 'str'}, @@ -83,8 +88,10 @@ class DatabaseSecurityAlertPolicy(SqlTypedSubResource): 'use_server_default': {'key': 'properties.useServerDefault', 'type': 'SecurityAlertPolicyUseServerDefault'}, } - def __init__(self, state, disabled_alerts=None, email_addresses=None, email_account_admins=None, storage_endpoint=None, storage_account_access_key=None, retention_days=None, use_server_default=None): + def __init__(self, state, location=None, disabled_alerts=None, email_addresses=None, email_account_admins=None, storage_endpoint=None, storage_account_access_key=None, retention_days=None, use_server_default=None): super(DatabaseSecurityAlertPolicy, self).__init__() + self.location = location + self.kind = None self.state = state self.disabled_alerts = disabled_alerts self.email_addresses = email_addresses diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/edition_capability.py b/azure-mgmt-sql/azure/mgmt/sql/models/edition_capability.py new file mode 100755 index 000000000000..6c729a32b82b --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/edition_capability.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class EditionCapability(Model): + """The server edition capabilities. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The edition name. + :vartype name: str + :ivar status: The status of the server edition. Possible values include: + 'Visible', 'Available', 'Default', 'Disabled' + :vartype status: str or :class:`CapabilityStatus + ` + :ivar supported_service_level_objectives: The list of supported service + objectives for the edition. + :vartype supported_service_level_objectives: list of + :class:`ServiceObjectiveCapability + ` + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'supported_service_level_objectives': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'CapabilityStatus'}, + 'supported_service_level_objectives': {'key': 'supportedServiceLevelObjectives', 'type': '[ServiceObjectiveCapability]'}, + } + + def __init__(self): + self.name = None + self.status = None + self.supported_service_level_objectives = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool.py b/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool.py index 9ef80b8d4f3c..4855f550b362 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool.py @@ -9,25 +9,25 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .tracked_resource import TrackedResource -class ElasticPool(Resource): +class ElasticPool(TrackedResource): """Represents a database elastic pool. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Resource name - :vartype name: str - :ivar id: Resource ID + :ivar id: Resource ID. :vartype id: str - :ivar type: Resource type + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. :vartype type: str - :param location: Resource location - :type location: str - :param tags: Resource tags + :param tags: Resource tags. :type tags: dict + :param location: Resource location. + :type location: str :ivar creation_date: The creation date of the elastic pool (ISO8601 format). :vartype creation_date: datetime @@ -37,8 +37,8 @@ class ElasticPool(Resource): ` :param edition: The edition of the elastic pool. Possible values include: 'Basic', 'Standard', 'Premium' - :type edition: str or :class:`ElasticPoolEditions - ` + :type edition: str or :class:`ElasticPoolEdition + ` :param dtu: The total shared DTU for the database elastic pool. :type dtu: int :param database_dtu_max: The maximum DTU any one database can consume. @@ -53,8 +53,8 @@ class ElasticPool(Resource): """ _validation = { - 'name': {'readonly': True}, 'id': {'readonly': True}, + 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, 'creation_date': {'readonly': True}, @@ -63,11 +63,11 @@ class ElasticPool(Resource): } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, 'state': {'key': 'properties.state', 'type': 'str'}, 'edition': {'key': 'properties.edition', 'type': 'str'}, @@ -79,7 +79,7 @@ class ElasticPool(Resource): } def __init__(self, location, tags=None, edition=None, dtu=None, database_dtu_max=None, database_dtu_min=None, storage_mb=None): - super(ElasticPool, self).__init__(location=location, tags=tags) + super(ElasticPool, self).__init__(tags=tags, location=location) self.creation_date = None self.state = None self.edition = edition diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_activity.py b/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_activity.py index 75a055ee677f..2d27147425db 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_activity.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_activity.py @@ -9,25 +9,23 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .proxy_resource import ProxyResource -class ElasticPoolActivity(Resource): +class ElasticPoolActivity(ProxyResource): """Represents the activity on an elastic pool. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Resource name - :vartype name: str - :ivar id: Resource ID + :ivar id: Resource ID. :vartype id: str - :ivar type: Resource type + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. :vartype type: str - :param location: Resource location + :param location: The geo-location where the resource lives :type location: str - :param tags: Resource tags - :type tags: dict :ivar end_time: The time the operation finished (ISO8601 format). :vartype end_time: datetime :ivar error_code: The error code if available. @@ -76,10 +74,9 @@ class ElasticPoolActivity(Resource): """ _validation = { - 'name': {'readonly': True}, 'id': {'readonly': True}, + 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, 'end_time': {'readonly': True}, 'error_code': {'readonly': True}, 'error_message': {'readonly': True}, @@ -103,11 +100,10 @@ class ElasticPoolActivity(Resource): } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, 'error_code': {'key': 'properties.errorCode', 'type': 'int'}, 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, @@ -130,8 +126,9 @@ class ElasticPoolActivity(Resource): 'requested_dtu_guarantee': {'key': 'properties.requestedDtuGuarantee', 'type': 'int'}, } - def __init__(self, location, tags=None): - super(ElasticPoolActivity, self).__init__(location=location, tags=tags) + def __init__(self, location=None): + super(ElasticPoolActivity, self).__init__() + self.location = location self.end_time = None self.error_code = None self.error_message = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_database_activity.py b/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_database_activity.py index 5344fe3aef08..ffadc3beb351 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_database_activity.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_database_activity.py @@ -9,25 +9,23 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .proxy_resource import ProxyResource -class ElasticPoolDatabaseActivity(Resource): +class ElasticPoolDatabaseActivity(ProxyResource): """Represents the activity on an elastic pool. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Resource name - :vartype name: str - :ivar id: Resource ID + :ivar id: Resource ID. :vartype id: str - :ivar type: Resource type + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. :vartype type: str - :param location: Resource location + :param location: The geo-location where the resource lives :type location: str - :param tags: Resource tags - :type tags: dict :ivar database_name: The database name. :vartype database_name: str :ivar end_time: The time the operation finished (ISO8601 format). @@ -65,10 +63,9 @@ class ElasticPoolDatabaseActivity(Resource): """ _validation = { - 'name': {'readonly': True}, 'id': {'readonly': True}, + 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, 'database_name': {'readonly': True}, 'end_time': {'readonly': True}, 'error_code': {'readonly': True}, @@ -87,11 +84,10 @@ class ElasticPoolDatabaseActivity(Resource): } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, 'error_code': {'key': 'properties.errorCode', 'type': 'int'}, @@ -109,8 +105,9 @@ class ElasticPoolDatabaseActivity(Resource): 'state': {'key': 'properties.state', 'type': 'str'}, } - def __init__(self, location, tags=None): - super(ElasticPoolDatabaseActivity, self).__init__(location=location, tags=tags) + def __init__(self, location=None): + super(ElasticPoolDatabaseActivity, self).__init__() + self.location = location self.database_name = None self.end_time = None self.error_code = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/export_request_parameters.py b/azure-mgmt-sql/azure/mgmt/sql/models/export_request.py similarity index 92% rename from azure-mgmt-sql/azure/mgmt/sql/models/export_request_parameters.py rename to azure-mgmt-sql/azure/mgmt/sql/models/export_request.py index 5590d931c3fa..a35fcf3554bc 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/export_request_parameters.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/export_request.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class ExportRequestParameters(Model): +class ExportRequest(Model): """Export database parameters. :param storage_key_type: The type of the storage key to use. Valid values @@ -29,8 +29,8 @@ class ExportRequestParameters(Model): :param administrator_login_password: The password of the SQL administrator. :type administrator_login_password: str - :param authentication_type: The authentication type - if not specified, - will default to SQL. Possible values include: 'SQL', 'ADPassword' + :param authentication_type: The authentication type. Possible values + include: 'SQL', 'ADPassword'. Default value: "SQL" . :type authentication_type: str or :class:`AuthenticationType ` """ @@ -52,7 +52,7 @@ class ExportRequestParameters(Model): 'authentication_type': {'key': 'authenticationType', 'type': 'AuthenticationType'}, } - def __init__(self, storage_key_type, storage_key, storage_uri, administrator_login, administrator_login_password, authentication_type=None): + def __init__(self, storage_key_type, storage_key, storage_uri, administrator_login, administrator_login_password, authentication_type="SQL"): self.storage_key_type = storage_key_type self.storage_key = storage_key self.storage_uri = storage_uri diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/server_firewall_rule.py b/azure-mgmt-sql/azure/mgmt/sql/models/firewall_rule.py similarity index 94% rename from azure-mgmt-sql/azure/mgmt/sql/models/server_firewall_rule.py rename to azure-mgmt-sql/azure/mgmt/sql/models/firewall_rule.py index 40d5945ebf8b..69ffdb45c3e0 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/server_firewall_rule.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/firewall_rule.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .sql_sub_resource import SqlSubResource +from .sub_resource import SubResource -class ServerFirewallRule(SqlSubResource): +class FirewallRule(SubResource): """Represents a server firewall rule. Variables are only populated by the server, and will be ignored when @@ -59,7 +59,7 @@ class ServerFirewallRule(SqlSubResource): } def __init__(self, start_ip_address, end_ip_address): - super(ServerFirewallRule, self).__init__() + super(FirewallRule, self).__init__() self.kind = None self.location = None self.type = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/server_firewall_rule_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/firewall_rule_paged.py similarity index 71% rename from azure-mgmt-sql/azure/mgmt/sql/models/server_firewall_rule_paged.py rename to azure-mgmt-sql/azure/mgmt/sql/models/firewall_rule_paged.py index 0a78a522af76..90cd653ec5f8 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/server_firewall_rule_paged.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/firewall_rule_paged.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class ServerFirewallRulePaged(Paged): +class FirewallRulePaged(Paged): """ - A paging container for iterating over a list of ServerFirewallRule object + A paging container for iterating over a list of FirewallRule object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ServerFirewallRule]'} + 'current_page': {'key': 'value', 'type': '[FirewallRule]'} } def __init__(self, *args, **kwargs): - super(ServerFirewallRulePaged, self).__init__(*args, **kwargs) + super(FirewallRulePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/import_export_operation_response_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/import_export_operation_response_paged.py deleted file mode 100755 index 55338efd6fc6..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/import_export_operation_response_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class ImportExportOperationResponsePaged(Paged): - """ - A paging container for iterating over a list of ImportExportOperationResponse object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ImportExportOperationResponse]'} - } - - def __init__(self, *args, **kwargs): - - super(ImportExportOperationResponsePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/import_export_operation_response_properties_model.py b/azure-mgmt-sql/azure/mgmt/sql/models/import_export_operation_response_properties_model.py deleted file mode 100755 index fda983b2d526..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/import_export_operation_response_properties_model.py +++ /dev/null @@ -1,74 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ImportExportOperationResponsePropertiesModel(Model): - """Response for Import/Export Status operation. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar request_type: The request type of the operation. - :vartype request_type: str - :ivar request_id: The request type of the operation. - :vartype request_id: str - :ivar server_name: The name of the server. - :vartype server_name: str - :ivar database_name: The name of the database. - :vartype database_name: str - :ivar status: The status message returned from the server. - :vartype status: str - :ivar last_modified_time: The operation status last modified time. - :vartype last_modified_time: str - :ivar queued_time: The operation queued time. - :vartype queued_time: str - :ivar blob_uri: The blob uri. - :vartype blob_uri: str - :ivar error_message: The error message returned from the server. - :vartype error_message: str - """ - - _validation = { - 'request_type': {'readonly': True}, - 'request_id': {'readonly': True}, - 'server_name': {'readonly': True}, - 'database_name': {'readonly': True}, - 'status': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'queued_time': {'readonly': True}, - 'blob_uri': {'readonly': True}, - 'error_message': {'readonly': True}, - } - - _attribute_map = { - 'request_type': {'key': 'requestType', 'type': 'str'}, - 'request_id': {'key': 'requestId', 'type': 'str'}, - 'server_name': {'key': 'serverName', 'type': 'str'}, - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'str'}, - 'queued_time': {'key': 'queuedTime', 'type': 'str'}, - 'blob_uri': {'key': 'blobUri', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - } - - def __init__(self): - self.request_type = None - self.request_id = None - self.server_name = None - self.database_name = None - self.status = None - self.last_modified_time = None - self.queued_time = None - self.blob_uri = None - self.error_message = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/import_export_operation_response.py b/azure-mgmt-sql/azure/mgmt/sql/models/import_export_response.py similarity index 91% rename from azure-mgmt-sql/azure/mgmt/sql/models/import_export_operation_response.py rename to azure-mgmt-sql/azure/mgmt/sql/models/import_export_response.py index 90b988a59bac..da306b604757 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/import_export_operation_response.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/import_export_response.py @@ -9,20 +9,20 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model +from .proxy_resource import ProxyResource -class ImportExportOperationResponse(Model): +class ImportExportResponse(ProxyResource): """Response for Import/Export Get operation. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The id returned from the server. + :ivar id: Resource ID. :vartype id: str - :ivar name: The name returned from the server. + :ivar name: Resource name. :vartype name: str - :ivar type: The type returned from the server. + :ivar type: Resource type. :vartype type: str :ivar request_type: The request type of the operation. :vartype request_type: str @@ -75,9 +75,7 @@ class ImportExportOperationResponse(Model): } def __init__(self): - self.id = None - self.name = None - self.type = None + super(ImportExportResponse, self).__init__() self.request_type = None self.request_id = None self.server_name = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/import_extension_request_parameters.py b/azure-mgmt-sql/azure/mgmt/sql/models/import_extension_request.py similarity index 89% rename from azure-mgmt-sql/azure/mgmt/sql/models/import_extension_request_parameters.py rename to azure-mgmt-sql/azure/mgmt/sql/models/import_extension_request.py index 6677900a9932..cf1a2d28b3be 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/import_extension_request_parameters.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/import_extension_request.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class ImportExtensionRequestParameters(Model): +class ImportExtensionRequest(Model): """Import database parameters. Variables are only populated by the server, and will be ignored when @@ -36,12 +36,12 @@ class ImportExtensionRequestParameters(Model): :param administrator_login_password: The password of the SQL administrator. :type administrator_login_password: str - :param authentication_type: The authentication type - if not specified, - will default to SQL. Possible values include: 'SQL', 'ADPassword' + :param authentication_type: The authentication type. Possible values + include: 'SQL', 'ADPassword'. Default value: "SQL" . :type authentication_type: str or :class:`AuthenticationType ` - :ivar operation_mode: The type of Import/Export operation being performed. - This is always Import. Default value: "Import" . + :ivar operation_mode: The type of import operation being performed. This + is always Import. Default value: "Import" . :vartype operation_mode: str """ @@ -68,7 +68,7 @@ class ImportExtensionRequestParameters(Model): operation_mode = "Import" - def __init__(self, storage_key_type, storage_key, storage_uri, administrator_login, administrator_login_password, name=None, type=None, authentication_type=None): + def __init__(self, storage_key_type, storage_key, storage_uri, administrator_login, administrator_login_password, name=None, type=None, authentication_type="SQL"): self.name = name self.type = type self.storage_key_type = storage_key_type diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/import_request_parameters.py b/azure-mgmt-sql/azure/mgmt/sql/models/import_request.py similarity index 74% rename from azure-mgmt-sql/azure/mgmt/sql/models/import_request_parameters.py rename to azure-mgmt-sql/azure/mgmt/sql/models/import_request.py index 199932970718..de83fb293e6f 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/import_request_parameters.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/import_request.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .export_request_parameters import ExportRequestParameters +from .export_request import ExportRequest -class ImportRequestParameters(ExportRequestParameters): +class ImportRequest(ExportRequest): """Import database parameters. :param storage_key_type: The type of the storage key to use. Valid values @@ -29,17 +29,23 @@ class ImportRequestParameters(ExportRequestParameters): :param administrator_login_password: The password of the SQL administrator. :type administrator_login_password: str - :param authentication_type: The authentication type - if not specified, - will default to SQL. Possible values include: 'SQL', 'ADPassword' + :param authentication_type: The authentication type. Possible values + include: 'SQL', 'ADPassword'. Default value: "SQL" . :type authentication_type: str or :class:`AuthenticationType ` :param database_name: The name of the database to import. :type database_name: str - :param edition: The edition for the database being created. - :type edition: str + :param edition: The edition for the database being created. Possible + values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', + 'Stretch', 'DataWarehouse', 'System', 'System2' + :type edition: str or :class:`DatabaseEdition + ` :param service_objective_name: The name of the service objective to assign - to the database. - :type service_objective_name: str + to the database. Possible values include: 'Basic', 'S0', 'S1', 'S2', 'S3', + 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', 'System2', + 'ElasticPool' + :type service_objective_name: str or :class:`ServiceObjectiveName + ` :param max_size_bytes: The maximum size for the newly imported database. :type max_size_bytes: str """ @@ -69,8 +75,8 @@ class ImportRequestParameters(ExportRequestParameters): 'max_size_bytes': {'key': 'maxSizeBytes', 'type': 'str'}, } - def __init__(self, storage_key_type, storage_key, storage_uri, administrator_login, administrator_login_password, database_name, edition, service_objective_name, max_size_bytes, authentication_type=None): - super(ImportRequestParameters, self).__init__(storage_key_type=storage_key_type, storage_key=storage_key, storage_uri=storage_uri, administrator_login=administrator_login, administrator_login_password=administrator_login_password, authentication_type=authentication_type) + def __init__(self, storage_key_type, storage_key, storage_uri, administrator_login, administrator_login_password, database_name, edition, service_objective_name, max_size_bytes, authentication_type="SQL"): + super(ImportRequest, self).__init__(storage_key_type=storage_key_type, storage_key=storage_key, storage_uri=storage_uri, administrator_login=administrator_login, administrator_login_password=administrator_login_password, authentication_type=authentication_type) self.database_name = database_name self.edition = edition self.service_objective_name = service_objective_name diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/location_capabilities.py b/azure-mgmt-sql/azure/mgmt/sql/models/location_capabilities.py new file mode 100755 index 000000000000..782fefc6a8ec --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/location_capabilities.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LocationCapabilities(Model): + """The capabilities for a location. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The location name. + :vartype name: str + :ivar status: Azure SQL Database's status for the location. Possible + values include: 'Visible', 'Available', 'Default', 'Disabled' + :vartype status: str or :class:`CapabilityStatus + ` + :ivar supported_server_versions: The list of supported server versions. + :vartype supported_server_versions: list of + :class:`ServerVersionCapability + ` + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'supported_server_versions': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'CapabilityStatus'}, + 'supported_server_versions': {'key': 'supportedServerVersions', 'type': '[ServerVersionCapability]'}, + } + + def __init__(self): + self.name = None + self.status = None + self.supported_server_versions = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/max_size_capability.py b/azure-mgmt-sql/azure/mgmt/sql/models/max_size_capability.py new file mode 100755 index 000000000000..54388da0235d --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/max_size_capability.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class MaxSizeCapability(Model): + """The maximum size limits for a database. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar limit: The maximum size of the database (see 'unit' for the units). + :vartype limit: long + :ivar unit: The units that the limit is expressed in. Possible values + include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes' + :vartype unit: str or :class:`MaxSizeUnits + ` + :ivar status: The status of the maximum size capability. Possible values + include: 'Visible', 'Available', 'Default', 'Disabled' + :vartype status: str or :class:`CapabilityStatus + ` + """ + + _validation = { + 'limit': {'readonly': True}, + 'unit': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'limit': {'key': 'limit', 'type': 'long'}, + 'unit': {'key': 'unit', 'type': 'MaxSizeUnits'}, + 'status': {'key': 'status', 'type': 'CapabilityStatus'}, + } + + def __init__(self): + self.limit = None + self.unit = None + self.status = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/sql_typed_sub_resource.py b/azure-mgmt-sql/azure/mgmt/sql/models/proxy_resource.py similarity index 63% rename from azure-mgmt-sql/azure/mgmt/sql/models/sql_typed_sub_resource.py rename to azure-mgmt-sql/azure/mgmt/sql/models/proxy_resource.py index 235799788063..5262f4b712f6 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/sql_typed_sub_resource.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/proxy_resource.py @@ -9,35 +9,28 @@ # regenerated. # -------------------------------------------------------------------------- -from .sql_sub_resource import SqlSubResource +from .resource import Resource -class SqlTypedSubResource(SqlSubResource): - """Subresource properties. +class ProxyResource(Resource): + """ARM proxy resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Resource name - :vartype name: str - :ivar id: The resource ID. + :ivar id: Resource ID. :vartype id: str - :ivar type: Resource type + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. :vartype type: str """ _validation = { - 'name': {'readonly': True}, 'id': {'readonly': True}, + 'name': {'readonly': True}, 'type': {'readonly': True}, } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - def __init__(self): - super(SqlTypedSubResource, self).__init__() - self.type = None + super(ProxyResource, self).__init__() diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/recommended_elastic_pool.py b/azure-mgmt-sql/azure/mgmt/sql/models/recommended_elastic_pool.py index eccc658b3bbf..43ad47f7d9c0 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/recommended_elastic_pool.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/recommended_elastic_pool.py @@ -9,30 +9,26 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .proxy_resource import ProxyResource -class RecommendedElasticPool(Resource): +class RecommendedElasticPool(ProxyResource): """Represents a recommented elastic pool. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Resource name - :vartype name: str - :ivar id: Resource ID + :ivar id: Resource ID. :vartype id: str - :ivar type: Resource type + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. :vartype type: str - :param location: Resource location - :type location: str - :param tags: Resource tags - :type tags: dict :ivar database_edition: The edition of the recommended elastic pool. The - ElasticPoolEditions enumeration contains all the valid editions. Possible + ElasticPoolEdition enumeration contains all the valid editions. Possible values include: 'Basic', 'Standard', 'Premium' - :vartype database_edition: str or :class:`ElasticPoolEditions - ` + :vartype database_edition: str or :class:`ElasticPoolEdition + ` :param dtu: The DTU for the recommended elastic pool. :type dtu: float :param database_dtu_min: The minimum DTU for the database. @@ -61,10 +57,9 @@ class RecommendedElasticPool(Resource): """ _validation = { - 'name': {'readonly': True}, 'id': {'readonly': True}, + 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, 'database_edition': {'readonly': True}, 'observation_period_start': {'readonly': True}, 'observation_period_end': {'readonly': True}, @@ -75,11 +70,9 @@ class RecommendedElasticPool(Resource): } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, 'database_edition': {'key': 'properties.databaseEdition', 'type': 'str'}, 'dtu': {'key': 'properties.dtu', 'type': 'float'}, 'database_dtu_min': {'key': 'properties.databaseDtuMin', 'type': 'float'}, @@ -93,8 +86,8 @@ class RecommendedElasticPool(Resource): 'metrics': {'key': 'properties.metrics', 'type': '[RecommendedElasticPoolMetric]'}, } - def __init__(self, location, tags=None, dtu=None, database_dtu_min=None, database_dtu_max=None, storage_mb=None): - super(RecommendedElasticPool, self).__init__(location=location, tags=tags) + def __init__(self, dtu=None, database_dtu_min=None, database_dtu_max=None, storage_mb=None): + super(RecommendedElasticPool, self).__init__() self.database_edition = None self.dtu = dtu self.database_dtu_min = database_dtu_min diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/recommended_index.py b/azure-mgmt-sql/azure/mgmt/sql/models/recommended_index.py index 932b815ce998..f4c86e3fa896 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/recommended_index.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/recommended_index.py @@ -9,35 +9,31 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .proxy_resource import ProxyResource -class RecommendedIndex(Resource): +class RecommendedIndex(ProxyResource): """Represents a database recommended index. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Resource name - :vartype name: str - :ivar id: Resource ID + :ivar id: Resource ID. :vartype id: str - :ivar type: Resource type + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. :vartype type: str - :param location: Resource location - :type location: str - :param tags: Resource tags - :type tags: dict :ivar action: The proposed index action. You can create a missing index, drop an unused index, or rebuild an existing index to improve its performance. Possible values include: 'Create', 'Drop', 'Rebuild' - :vartype action: str or :class:`RecommendedIndexActions - ` + :vartype action: str or :class:`RecommendedIndexAction + ` :ivar state: The current recommendation state. Possible values include: 'Active', 'Pending', 'Executing', 'Verifying', 'Pending Revert', 'Reverting', 'Reverted', 'Ignored', 'Expired', 'Blocked', 'Success' - :vartype state: str or :class:`RecommendedIndexStates - ` + :vartype state: str or :class:`RecommendedIndexState + ` :ivar created: The UTC datetime showing when this resource was created (ISO8601 format). :vartype created: datetime @@ -47,8 +43,8 @@ class RecommendedIndex(Resource): :ivar index_type: The type of index (CLUSTERED, NONCLUSTERED, COLUMNSTORE, CLUSTERED COLUMNSTORE). Possible values include: 'CLUSTERED', 'NONCLUSTERED', 'COLUMNSTORE', 'CLUSTERED COLUMNSTORE' - :vartype index_type: str or :class:`RecommendedIndexTypes - ` + :vartype index_type: str or :class:`RecommendedIndexType + ` :ivar schema: The schema where table to build index over resides :vartype schema: str :ivar table: The table on which to build index. @@ -70,10 +66,9 @@ class RecommendedIndex(Resource): """ _validation = { - 'name': {'readonly': True}, 'id': {'readonly': True}, + 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, 'action': {'readonly': True}, 'state': {'readonly': True}, 'created': {'readonly': True}, @@ -89,16 +84,14 @@ class RecommendedIndex(Resource): } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'action': {'key': 'properties.action', 'type': 'RecommendedIndexActions'}, - 'state': {'key': 'properties.state', 'type': 'RecommendedIndexStates'}, + 'action': {'key': 'properties.action', 'type': 'RecommendedIndexAction'}, + 'state': {'key': 'properties.state', 'type': 'RecommendedIndexState'}, 'created': {'key': 'properties.created', 'type': 'iso-8601'}, 'last_modified': {'key': 'properties.lastModified', 'type': 'iso-8601'}, - 'index_type': {'key': 'properties.indexType', 'type': 'RecommendedIndexTypes'}, + 'index_type': {'key': 'properties.indexType', 'type': 'RecommendedIndexType'}, 'schema': {'key': 'properties.schema', 'type': 'str'}, 'table': {'key': 'properties.table', 'type': 'str'}, 'columns': {'key': 'properties.columns', 'type': '[str]'}, @@ -108,8 +101,8 @@ class RecommendedIndex(Resource): 'reported_impact': {'key': 'properties.reportedImpact', 'type': '[OperationImpact]'}, } - def __init__(self, location, tags=None): - super(RecommendedIndex, self).__init__(location=location, tags=tags) + def __init__(self): + super(RecommendedIndex, self).__init__() self.action = None self.state = None self.created = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/replication_link.py b/azure-mgmt-sql/azure/mgmt/sql/models/replication_link.py index bdc165e822b5..aea6e046979b 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/replication_link.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/replication_link.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .sql_sub_resource import SqlSubResource +from .sub_resource import SubResource -class ReplicationLink(SqlSubResource): +class ReplicationLink(SubResource): """Represents a database replication link. Variables are only populated by the server, and will be ignored when diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/resource.py b/azure-mgmt-sql/azure/mgmt/sql/models/resource.py index 31f3c8bbcc8b..3883d2160984 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/resource.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/resource.py @@ -13,41 +13,32 @@ class Resource(Model): - """Resource properties. + """ARM resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Resource name - :vartype name: str - :ivar id: Resource ID + :ivar id: Resource ID. :vartype id: str - :ivar type: Resource type + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. :vartype type: str - :param location: Resource location - :type location: str - :param tags: Resource tags - :type tags: dict """ _validation = { - 'name': {'readonly': True}, 'id': {'readonly': True}, + 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, tags=None): - self.name = None + def __init__(self): self.id = None + self.name = None self.type = None - self.location = location - self.tags = tags diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/restore_point.py b/azure-mgmt-sql/azure/mgmt/sql/models/restore_point.py index 971f38f62998..827c34b7e92c 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/restore_point.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/restore_point.py @@ -9,25 +9,21 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .proxy_resource import ProxyResource -class RestorePoint(Resource): +class RestorePoint(ProxyResource): """Represents a database restore point. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Resource name - :vartype name: str - :ivar id: Resource ID + :ivar id: Resource ID. :vartype id: str - :ivar type: Resource type + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. :vartype type: str - :param location: Resource location - :type location: str - :param tags: Resource tags - :type tags: dict :ivar restore_point_type: The restore point type of the database restore point. Possible values include: 'DISCRETE', 'CONTINUOUS' :vartype restore_point_type: str or :class:`RestorePointTypes @@ -41,28 +37,25 @@ class RestorePoint(Resource): """ _validation = { - 'name': {'readonly': True}, 'id': {'readonly': True}, + 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, 'restore_point_type': {'readonly': True}, 'restore_point_creation_date': {'readonly': True}, 'earliest_restore_date': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, 'restore_point_type': {'key': 'properties.restorePointType', 'type': 'RestorePointTypes'}, 'restore_point_creation_date': {'key': 'properties.restorePointCreationDate', 'type': 'iso-8601'}, 'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'}, } - def __init__(self, location, tags=None): - super(RestorePoint, self).__init__(location=location, tags=tags) + def __init__(self): + super(RestorePoint, self).__init__() self.restore_point_type = None self.restore_point_creation_date = None self.earliest_restore_date = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/schema.py b/azure-mgmt-sql/azure/mgmt/sql/models/schema.py deleted file mode 100755 index 46f053085845..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/schema.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class Schema(Resource): - """Represents a database schema. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: Resource name - :vartype name: str - :ivar id: Resource ID - :vartype id: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Resource tags - :type tags: dict - :ivar tables: The tables from this database. - :vartype tables: list of :class:`Table ` - """ - - _validation = { - 'name': {'readonly': True}, - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'tables': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'tables': {'key': 'properties.tables', 'type': '[Table]'}, - } - - def __init__(self, location, tags=None): - super(Schema, self).__init__(location=location, tags=tags) - self.tables = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/server.py b/azure-mgmt-sql/azure/mgmt/sql/models/server.py index b788f1d5669e..b2916b37ef8c 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/server.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/server.py @@ -9,25 +9,25 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .tracked_resource import TrackedResource -class Server(Resource): +class Server(TrackedResource): """Represents a server. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Resource name - :vartype name: str - :ivar id: Resource ID + :ivar id: Resource ID. :vartype id: str - :ivar type: Resource type + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. :vartype type: str - :param location: Resource location - :type location: str - :param tags: Resource tags + :param tags: Resource tags. :type tags: dict + :param location: Resource location. + :type location: str :ivar kind: Kind of sql server. This is metadata used for the Azure portal experience. :vartype kind: str @@ -62,8 +62,8 @@ class Server(Resource): """ _validation = { - 'name': {'readonly': True}, 'id': {'readonly': True}, + 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, 'kind': {'readonly': True}, @@ -74,11 +74,11 @@ class Server(Resource): } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, 'version': {'key': 'properties.version', 'type': 'str'}, @@ -90,7 +90,7 @@ class Server(Resource): } def __init__(self, location, tags=None, version=None, administrator_login=None, administrator_login_password=None): - super(Server, self).__init__(location=location, tags=tags) + super(Server, self).__init__(tags=tags, location=location) self.kind = None self.fully_qualified_domain_name = None self.version = version diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/server_version_capability.py b/azure-mgmt-sql/azure/mgmt/sql/models/server_version_capability.py new file mode 100755 index 000000000000..e0f5e9029bc2 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/server_version_capability.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServerVersionCapability(Model): + """The server capabilities. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The server version name. + :vartype name: str + :ivar status: The status of the server version. Possible values include: + 'Visible', 'Available', 'Default', 'Disabled' + :vartype status: str or :class:`CapabilityStatus + ` + :ivar supported_editions: The list of supported server editions. + :vartype supported_editions: list of :class:`EditionCapability + ` + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'supported_editions': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'CapabilityStatus'}, + 'supported_editions': {'key': 'supportedEditions', 'type': '[EditionCapability]'}, + } + + def __init__(self): + self.name = None + self.status = None + self.supported_editions = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/service_objective.py b/azure-mgmt-sql/azure/mgmt/sql/models/service_objective.py index 042157bb27ba..61b40ef2e8d1 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/service_objective.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/service_objective.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .sql_sub_resource import SqlSubResource +from .sub_resource import SubResource -class ServiceObjective(SqlSubResource): +class ServiceObjective(SubResource): """Represents a database service objective. Variables are only populated by the server, and will be ignored when diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/service_objective_capability.py b/azure-mgmt-sql/azure/mgmt/sql/models/service_objective_capability.py new file mode 100755 index 000000000000..e8c6bfb8dd35 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/service_objective_capability.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServiceObjectiveCapability(Model): + """The service objectives capabilities. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The service objective name. + :vartype name: str + :ivar status: The status of the service objective. Possible values + include: 'Visible', 'Available', 'Default', 'Disabled' + :vartype status: str or :class:`CapabilityStatus + ` + :ivar unit: Unit type used to measure service objective performance level. + Possible values include: 'DTU' + :vartype unit: str or :class:`PerformanceLevelUnit + ` + :ivar value: Performance level value. + :vartype value: int + :ivar id: The unique ID of the service objective. + :vartype id: str + :ivar supported_max_sizes: The list of supported maximum database sizes + for this service objective. + :vartype supported_max_sizes: list of :class:`MaxSizeCapability + ` + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'unit': {'readonly': True}, + 'value': {'readonly': True}, + 'id': {'readonly': True}, + 'supported_max_sizes': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'CapabilityStatus'}, + 'unit': {'key': 'performanceLevel.unit', 'type': 'PerformanceLevelUnit'}, + 'value': {'key': 'performanceLevel.value', 'type': 'int'}, + 'id': {'key': 'id', 'type': 'str'}, + 'supported_max_sizes': {'key': 'supportedMaxSizes', 'type': '[MaxSizeCapability]'}, + } + + def __init__(self): + self.name = None + self.status = None + self.unit = None + self.value = None + self.id = None + self.supported_max_sizes = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/service_tier_advisor.py b/azure-mgmt-sql/azure/mgmt/sql/models/service_tier_advisor.py index 527802695964..1d5d417ef1a7 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/service_tier_advisor.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/service_tier_advisor.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .sql_sub_resource import SqlSubResource +from .sub_resource import SubResource -class ServiceTierAdvisor(SqlSubResource): +class ServiceTierAdvisor(SubResource): """Represents a Service Tier Advisor. Variables are only populated by the server, and will be ignored when diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/slo_usage_metric.py b/azure-mgmt-sql/azure/mgmt/sql/models/slo_usage_metric.py index a9276f42e2e3..e527f655a007 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/slo_usage_metric.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/slo_usage_metric.py @@ -17,7 +17,7 @@ class SloUsageMetric(Model): :param service_level_objective: The serviceLevelObjective for SLO usage metric. Possible values include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', - 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', 'ElasticPool' + 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', 'System2', 'ElasticPool' :type service_level_objective: str or :class:`ServiceObjectiveName ` :param service_level_objective_id: The serviceLevelObjectiveId for SLO diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py b/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py index 34b101d72b13..ce66aacba575 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py @@ -12,55 +12,59 @@ from enum import Enum -class StorageKeyType(Enum): +class CapabilityStatus(Enum): - storage_access_key = "StorageAccessKey" - shared_access_key = "SharedAccessKey" + visible = "Visible" + available = "Available" + default = "Default" + disabled = "Disabled" -class AuthenticationType(Enum): +class MaxSizeUnits(Enum): - sql = "SQL" - ad_password = "ADPassword" + megabytes = "Megabytes" + gigabytes = "Gigabytes" + terabytes = "Terabytes" + petabytes = "Petabytes" -class ReplicationRole(Enum): +class PerformanceLevelUnit(Enum): - primary = "Primary" - secondary = "Secondary" - non_readable_secondary = "NonReadableSecondary" - source = "Source" - copy = "Copy" + dtu = "DTU" -class ReplicationState(Enum): +class TransparentDataEncryptionStatus(Enum): - pending = "PENDING" - seeding = "SEEDING" - catch_up = "CATCH_UP" - suspended = "SUSPENDED" + enabled = "Enabled" + disabled = "Disabled" -class ElasticPoolEditions(Enum): +class ServiceObjectiveName(Enum): basic = "Basic" - standard = "Standard" - premium = "Premium" + s0 = "S0" + s1 = "S1" + s2 = "S2" + s3 = "S3" + p1 = "P1" + p2 = "P2" + p3 = "P3" + p4 = "P4" + p6 = "P6" + p11 = "P11" + p15 = "P15" + system = "System" + system2 = "System2" + elastic_pool = "ElasticPool" -class CreateMode(Enum): +class TransparentDataEncryptionActivityStatus(Enum): - copy = "Copy" - default = "Default" - non_readable_secondary = "NonReadableSecondary" - online_secondary = "OnlineSecondary" - point_in_time_restore = "PointInTimeRestore" - recovery = "Recovery" - restore = "Restore" - restore_long_term_retention_backup = "RestoreLongTermRetentionBackup" + encrypting = "Encrypting" + decrypting = "Decrypting" -class DatabaseEditions(Enum): +class DatabaseEdition(Enum): web = "Web" business = "Business" @@ -71,40 +75,55 @@ class DatabaseEditions(Enum): stretch = "Stretch" data_warehouse = "DataWarehouse" system = "System" + system2 = "System2" -class ServiceObjectiveName(Enum): +class StorageKeyType(Enum): + + storage_access_key = "StorageAccessKey" + shared_access_key = "SharedAccessKey" + + +class AuthenticationType(Enum): + + sql = "SQL" + ad_password = "ADPassword" + + +class ElasticPoolState(Enum): + + creating = "Creating" + ready = "Ready" + disabled = "Disabled" + + +class ElasticPoolEdition(Enum): basic = "Basic" - s0 = "S0" - s1 = "S1" - s2 = "S2" - s3 = "S3" - p1 = "P1" - p2 = "P2" - p3 = "P3" - p4 = "P4" - p6 = "P6" - p11 = "P11" - p15 = "P15" - system = "System" - elastic_pool = "ElasticPool" + standard = "Standard" + premium = "Premium" -class TableType(Enum): +class ServerVersion(Enum): - base_table = "BaseTable" - view = "View" + two_full_stop_zero = "2.0" + one_two_full_stop_zero = "12.0" -class RecommendedIndexActions(Enum): +class ServerState(Enum): + + ready = "Ready" + disabled = "Disabled" + + +class RecommendedIndexAction(Enum): create = "Create" drop = "Drop" rebuild = "Rebuild" -class RecommendedIndexStates(Enum): +class RecommendedIndexState(Enum): active = "Active" pending = "Pending" @@ -119,7 +138,7 @@ class RecommendedIndexStates(Enum): success = "Success" -class RecommendedIndexTypes(Enum): +class RecommendedIndexType(Enum): clustered = "CLUSTERED" nonclustered = "NONCLUSTERED" @@ -127,10 +146,16 @@ class RecommendedIndexTypes(Enum): clusteredcolumnstore = "CLUSTERED COLUMNSTORE" -class TransparentDataEncryptionStates(Enum): +class CreateMode(Enum): - enabled = "Enabled" - disabled = "Disabled" + copy = "Copy" + default = "Default" + non_readable_secondary = "NonReadableSecondary" + online_secondary = "OnlineSecondary" + point_in_time_restore = "PointInTimeRestore" + recovery = "Recovery" + restore = "Restore" + restore_long_term_retention_backup = "RestoreLongTermRetentionBackup" class ReadScale(Enum): @@ -144,42 +169,27 @@ class SampleName(Enum): adventure_works_lt = "AdventureWorksLT" -class ElasticPoolState(Enum): - - creating = "Creating" - ready = "Ready" - disabled = "Disabled" - - -class ServerVersion(Enum): - - two_full_stop_zero = "2.0" - one_two_full_stop_zero = "12.0" - - -class ServerState(Enum): - - ready = "Ready" - disabled = "Disabled" - - -class TargetElasticPoolEditions(Enum): - - basic = "Basic" - standard = "Standard" - premium = "Premium" - - class RestorePointTypes(Enum): discrete = "DISCRETE" continuous = "CONTINUOUS" -class TransparentDataEncryptionActivityStates(Enum): +class ReplicationRole(Enum): + + primary = "Primary" + secondary = "Secondary" + non_readable_secondary = "NonReadableSecondary" + source = "Source" + copy = "Copy" - encrypting = "Encrypting" - decrypting = "Decrypting" + +class ReplicationState(Enum): + + pending = "PENDING" + seeding = "SEEDING" + catch_up = "CATCH_UP" + suspended = "SUSPENDED" class SecurityAlertPolicyState(Enum): @@ -189,15 +199,6 @@ class SecurityAlertPolicyState(Enum): disabled = "Disabled" -class SecurityAlert(Enum): - - sql_injection = "Sql_Injection" - sql_injection_vulnerability = "Sql_Injection_Vulnerability" - access_anomaly = "Access_Anomaly" - usage_anomaly = "Usage_Anomaly" - preview = "Preview" - - class SecurityAlertPolicyEmailAccountAdmins(Enum): enabled = "Enabled" diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/sql_sub_resource.py b/azure-mgmt-sql/azure/mgmt/sql/models/sub_resource.py similarity index 97% rename from azure-mgmt-sql/azure/mgmt/sql/models/sql_sub_resource.py rename to azure-mgmt-sql/azure/mgmt/sql/models/sub_resource.py index fdd61f6494d2..fa3edc4e01f1 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/sql_sub_resource.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/sub_resource.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class SqlSubResource(Model): +class SubResource(Model): """Subresource properties. Variables are only populated by the server, and will be ignored when diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/table.py b/azure-mgmt-sql/azure/mgmt/sql/models/table.py deleted file mode 100755 index ff9b5f57152a..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/table.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class Table(Resource): - """Represents a database table. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: Resource name - :vartype name: str - :ivar id: Resource ID - :vartype id: str - :ivar type: Resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Resource tags - :type tags: dict - :ivar table_type: The type of database table. Possible values include: - 'BaseTable', 'View' - :vartype table_type: str or :class:`TableType - ` - :ivar columns: The columns from this table. - :vartype columns: list of :class:`Column ` - :ivar recommended_indexes: The recommended indices for this table. - :vartype recommended_indexes: list of :class:`RecommendedIndex - ` - """ - - _validation = { - 'name': {'readonly': True}, - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'table_type': {'readonly': True}, - 'columns': {'readonly': True}, - 'recommended_indexes': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'table_type': {'key': 'properties.tableType', 'type': 'TableType'}, - 'columns': {'key': 'properties.columns', 'type': '[Column]'}, - 'recommended_indexes': {'key': 'properties.recommendedIndexes', 'type': '[RecommendedIndex]'}, - } - - def __init__(self, location, tags=None): - super(Table, self).__init__(location=location, tags=tags) - self.table_type = None - self.columns = None - self.recommended_indexes = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/column.py b/azure-mgmt-sql/azure/mgmt/sql/models/tracked_resource.py similarity index 69% rename from azure-mgmt-sql/azure/mgmt/sql/models/column.py rename to azure-mgmt-sql/azure/mgmt/sql/models/tracked_resource.py index c0ca900a88c9..72171e5ddb7a 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/column.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/tracked_resource.py @@ -12,43 +12,40 @@ from .resource import Resource -class Column(Resource): - """Represents a database table column. +class TrackedResource(Resource): + """ARM tracked top level resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Resource name - :vartype name: str - :ivar id: Resource ID + :ivar id: Resource ID. :vartype id: str - :ivar type: Resource type + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. :vartype type: str - :param location: Resource location - :type location: str - :param tags: Resource tags + :param tags: Resource tags. :type tags: dict - :ivar column_type: The type of database table column. - :vartype column_type: str + :param location: Resource location. + :type location: str """ _validation = { - 'name': {'readonly': True}, 'id': {'readonly': True}, + 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'column_type': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'column_type': {'key': 'properties.columnType', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, } def __init__(self, location, tags=None): - super(Column, self).__init__(location=location, tags=tags) - self.column_type = None + super(TrackedResource, self).__init__() + self.tags = tags + self.location = location diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption.py b/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption.py index 4fad2a559a49..022ff5c129d0 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .sql_sub_resource import SqlSubResource +from .sub_resource import SubResource -class TransparentDataEncryption(SqlSubResource): +class TransparentDataEncryption(SubResource): """Represents a database transparent data encryption . Variables are only populated by the server, and will be ignored when @@ -24,8 +24,8 @@ class TransparentDataEncryption(SqlSubResource): :vartype id: str :param status: The status of the database transparent data encryption. Possible values include: 'Enabled', 'Disabled' - :type status: str or :class:`TransparentDataEncryptionStates - ` + :type status: str or :class:`TransparentDataEncryptionStatus + ` """ _validation = { @@ -36,7 +36,7 @@ class TransparentDataEncryption(SqlSubResource): _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'TransparentDataEncryptionStates'}, + 'status': {'key': 'properties.status', 'type': 'TransparentDataEncryptionStatus'}, } def __init__(self, status=None): diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption_activity.py b/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption_activity.py index c5f6e75371c5..b4bbcaa2b3da 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption_activity.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption_activity.py @@ -9,10 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .sql_sub_resource import SqlSubResource +from .sub_resource import SubResource -class TransparentDataEncryptionActivity(SqlSubResource): +class TransparentDataEncryptionActivity(SubResource): """Represents a database transparent data encryption Scan. Variables are only populated by the server, and will be ignored when @@ -24,8 +24,8 @@ class TransparentDataEncryptionActivity(SqlSubResource): :vartype id: str :ivar status: The status of the database. Possible values include: 'Encrypting', 'Decrypting' - :vartype status: str or :class:`TransparentDataEncryptionActivityStates - ` + :vartype status: str or :class:`TransparentDataEncryptionActivityStatus + ` :ivar percent_complete: The percent complete of the transparent data encryption scan for a database. :vartype percent_complete: float diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/upgrade_hint.py b/azure-mgmt-sql/azure/mgmt/sql/models/upgrade_hint.py deleted file mode 100755 index 2516c17774df..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/upgrade_hint.py +++ /dev/null @@ -1,33 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class UpgradeHint(Model): - """Represents a Upgrade Hint. - - :param target_service_level_objective: TargetServiceLevelObjective for - upgrade hint. - :type target_service_level_objective: str - :param target_service_level_objective_id: TargetServiceLevelObjectiveId - for upgrade hint. - :type target_service_level_objective_id: str - """ - - _attribute_map = { - 'target_service_level_objective': {'key': 'targetServiceLevelObjective', 'type': 'str'}, - 'target_service_level_objective_id': {'key': 'targetServiceLevelObjectiveId', 'type': 'str'}, - } - - def __init__(self, target_service_level_objective=None, target_service_level_objective_id=None): - self.target_service_level_objective = target_service_level_objective - self.target_service_level_objective_id = target_service_level_objective_id diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/upgrade_recommended_elastic_pool_properties.py b/azure-mgmt-sql/azure/mgmt/sql/models/upgrade_recommended_elastic_pool_properties.py deleted file mode 100755 index 91492f69da61..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/upgrade_recommended_elastic_pool_properties.py +++ /dev/null @@ -1,68 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class UpgradeRecommendedElasticPoolProperties(Model): - """Represents the properties of a recommended elastic pool being upgraded. - - :param name: The name of the recommended elastic pool being upgraded. - :type name: str - :param edition: The target edition for the recommended elastic pool being - upgraded. Possible values include: 'Basic', 'Standard', 'Premium' - :type edition: str or :class:`TargetElasticPoolEditions - ` - :param dtu: The DTU guarantee for the recommended elastic pool being - upgraded. - :type dtu: int - :param storage_mb: The storage limit in MB for the recommended elastic - pool being upgraded. - :type storage_mb: int - :param database_dtu_min: The DTU guarantee for database for the - recommended elastic pool being upgraded. - :type database_dtu_min: int - :param database_dtu_max: The DTU cap for database for the recommended - elastic pool being upgraded. - :type database_dtu_max: int - :param database_collection: The list of database names to be put in the - recommended elastic pool being upgraded. - :type database_collection: list of str - :param include_all_databases: Gets or sets whether all databases to be put - in the recommended elastic pool being upgraded. - :type include_all_databases: bool - """ - - _validation = { - 'name': {'required': True}, - 'edition': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'Name', 'type': 'str'}, - 'edition': {'key': 'Edition', 'type': 'TargetElasticPoolEditions'}, - 'dtu': {'key': 'Dtu', 'type': 'int'}, - 'storage_mb': {'key': 'StorageMb', 'type': 'int'}, - 'database_dtu_min': {'key': 'DatabaseDtuMin', 'type': 'int'}, - 'database_dtu_max': {'key': 'DatabaseDtuMax', 'type': 'int'}, - 'database_collection': {'key': 'DatabaseCollection', 'type': '[str]'}, - 'include_all_databases': {'key': 'IncludeAllDatabases', 'type': 'bool'}, - } - - def __init__(self, name, edition, dtu=None, storage_mb=None, database_dtu_min=None, database_dtu_max=None, database_collection=None, include_all_databases=None): - self.name = name - self.edition = edition - self.dtu = dtu - self.storage_mb = storage_mb - self.database_dtu_min = database_dtu_min - self.database_dtu_max = database_dtu_max - self.database_collection = database_collection - self.include_all_databases = include_all_databases diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py b/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py index 88c1012329b8..7b9bb5e7e54f 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py @@ -9,20 +9,18 @@ # regenerated. # -------------------------------------------------------------------------- -from .servers_operations import ServersOperations +from .capabilities_operations import CapabilitiesOperations +from .firewall_rules_operations import FirewallRulesOperations from .databases_operations import DatabasesOperations -from .import_export_operations import ImportExportOperations +from .servers_operations import ServersOperations from .elastic_pools_operations import ElasticPoolsOperations from .recommended_elastic_pools_operations import RecommendedElasticPoolsOperations -from .database_threat_detection_policies_operations import DatabaseThreatDetectionPoliciesOperations -from .database_blob_auditing_policies_operations import DatabaseBlobAuditingPoliciesOperations __all__ = [ - 'ServersOperations', + 'CapabilitiesOperations', + 'FirewallRulesOperations', 'DatabasesOperations', - 'ImportExportOperations', + 'ServersOperations', 'ElasticPoolsOperations', 'RecommendedElasticPoolsOperations', - 'DatabaseThreatDetectionPoliciesOperations', - 'DatabaseBlobAuditingPoliciesOperations', ] diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/capabilities_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/capabilities_operations.py new file mode 100755 index 000000000000..f6c328a6da9b --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/capabilities_operations.py @@ -0,0 +1,95 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +import uuid + +from .. import models + + +class CapabilitiesOperations(object): + """CapabilitiesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An objec model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". + """ + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2014-04-01" + + self.config = config + + def list_by_location( + self, location_id, custom_headers=None, raw=False, **operation_config): + """Gets the capabilities available for the specified location. + + :param location_id: The location id whose capabilities are retrieved. + :type location_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`. + :rtype: :class:`LocationCapabilities + ` + :rtype: :class:`ClientRawResponse` + if raw=true + :raises: :class:`CloudError` + """ + # Construct URL + url = '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationId}/capabilities' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'locationId': self._serialize.url("location_id", location_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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **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('LocationCapabilities', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/database_blob_auditing_policies_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/database_blob_auditing_policies_operations.py deleted file mode 100755 index 8af0418745dd..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/database_blob_auditing_policies_operations.py +++ /dev/null @@ -1,183 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -import uuid - -from .. import models - - -class DatabaseBlobAuditingPoliciesOperations(object): - """DatabaseBlobAuditingPoliciesOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2015-05-01-preview". - """ - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2015-05-01-preview" - - self.config = config - - def get( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - """Gets a blob auditing policy associated with a database. - - :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 for which database blob - audit policy is defined. - :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 - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: :class:`DatabaseBlobAuditingPolicy - ` - :rtype: :class:`ClientRawResponse` - if raw=true - :raises: :class:`CloudError` - """ - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/default' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - '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') - } - 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['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 and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **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('DatabaseBlobAuditingPolicy', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, server_name, database_name, database_blob_auditing_policy, custom_headers=None, raw=False, **operation_config): - """Creates or updates a blob auditing policy for a database. - - :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 for which database blob - audit policy will be defined. - :type database_name: str - :param database_blob_auditing_policy: The name of the database blob - auditing policy. - :type database_blob_auditing_policy: - :class:`DatabaseBlobAuditingPolicy - ` - :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`. - :rtype: :class:`DatabaseBlobAuditingPolicy - ` - :rtype: :class:`ClientRawResponse` - if raw=true - :raises: :class:`CloudError` - """ - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/default' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - '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') - } - 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['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(database_blob_auditing_policy, 'DatabaseBlobAuditingPolicy') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - - if response.status_code not in [200, 201]: - 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('DatabaseBlobAuditingPolicy', response) - if response.status_code == 201: - deserialized = self._deserialize('DatabaseBlobAuditingPolicy', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/database_threat_detection_policies_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/database_threat_detection_policies_operations.py deleted file mode 100755 index 58c0c3735fb5..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/database_threat_detection_policies_operations.py +++ /dev/null @@ -1,183 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -import uuid - -from .. import models - - -class DatabaseThreatDetectionPoliciesOperations(object): - """DatabaseThreatDetectionPoliciesOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". - """ - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2014-04-01" - - self.config = config - - def get( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - """Gets a Threat Detection policy associated with a database. - - :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 for which database - Threat Detection policy is defined. - :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 - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: :class:`DatabaseSecurityAlertPolicy - ` - :rtype: :class:`ClientRawResponse` - if raw=true - :raises: :class:`CloudError` - """ - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/default' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - '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') - } - 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['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 and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **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('DatabaseSecurityAlertPolicy', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, server_name, database_name, database_security_alert_policy, custom_headers=None, raw=False, **operation_config): - """Creates or updates a Threat Detection policy for a database. - - :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 for which database - Threat Detection policy is defined. - :type database_name: str - :param database_security_alert_policy: The database Threat Detection - policy. - :type database_security_alert_policy: - :class:`DatabaseSecurityAlertPolicy - ` - :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`. - :rtype: :class:`DatabaseSecurityAlertPolicy - ` - :rtype: :class:`ClientRawResponse` - if raw=true - :raises: :class:`CloudError` - """ - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/default' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - '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') - } - 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['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(database_security_alert_policy, 'DatabaseSecurityAlertPolicy') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - - if response.status_code not in [200, 201]: - 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('DatabaseSecurityAlertPolicy', response) - if response.status_code == 201: - deserialized = self._deserialize('DatabaseSecurityAlertPolicy', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/databases_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/databases_operations.py index d0591fde6709..41ce795a9264 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/databases_operations.py +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/databases_operations.py @@ -24,7 +24,6 @@ class DatabasesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". """ def __init__(self, client, config, serializer, deserializer): @@ -32,14 +31,110 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2014-04-01" self.config = config def import_method( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): + """Imports a bacpac into a new database. . + + :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 parameters: The required parameters for importing a Bacpac into + a database. + :type parameters: :class:`ImportRequest + ` + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :rtype: + :class:`AzureOperationPoller` + instance that returns :class:`ImportExportResponse + ` + :rtype: :class:`ClientRawResponse` + if raw=true + :raises: :class:`CloudError` + """ + api_version = "2014-04-01" + + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, '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['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, 'ImportRequest') + + # Construct and send request + def long_running_send(): + + request = self._client.post(url, query_parameters) + return self._client.send( + request, header_parameters, body_content, **operation_config) + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + return self._client.send( + request, header_parameters, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('ImportExportResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + if raw: + response = long_running_send() + return get_long_running_output(response) + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + + def create_import_operation( self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): - """Imports a bacpac into an existing database. The existing database must - be empty. + """Creates an import operation that imports a bacpac into an existing + database. The existing database must be empty. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -51,19 +146,21 @@ def import_method( :type database_name: str :param parameters: The required parameters for importing a Bacpac into a database. - :type parameters: :class:`ImportExtensionRequestParameters - ` + :type parameters: :class:`ImportExtensionRequest + ` :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :rtype: :class:`AzureOperationPoller` - instance that returns :class:`ImportExportOperationResponse - ` + instance that returns :class:`ImportExportResponse + ` :rtype: :class:`ClientRawResponse` if raw=true :raises: :class:`CloudError` """ + api_version = "2014-04-01" + # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/import' path_format_arguments = { @@ -76,7 +173,7 @@ def import_method( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -89,7 +186,7 @@ def import_method( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'ImportExtensionRequestParameters') + body_content = self._serialize.body(parameters, 'ImportExtensionRequest') # Construct and send request def long_running_send(): @@ -116,7 +213,7 @@ def get_long_running_output(response): deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ImportExportOperationResponse', response) + deserialized = self._deserialize('ImportExportResponse', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -148,19 +245,21 @@ def export( :param database_name: The name of the database to be exported. :type database_name: str :param parameters: The required parameters for exporting a database. - :type parameters: :class:`ExportRequestParameters - ` + :type parameters: :class:`ExportRequest + ` :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :rtype: :class:`AzureOperationPoller` - instance that returns :class:`ImportExportOperationResponse - ` + instance that returns :class:`ImportExportResponse + ` :rtype: :class:`ClientRawResponse` if raw=true :raises: :class:`CloudError` """ + api_version = "2014-04-01" + # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export' path_format_arguments = { @@ -173,7 +272,7 @@ def export( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -186,7 +285,7 @@ def export( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'ExportRequestParameters') + body_content = self._serialize.body(parameters, 'ExportRequest') # Construct and send request def long_running_send(): @@ -213,7 +312,7 @@ def get_long_running_output(response): deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ImportExportOperationResponse', response) + deserialized = self._deserialize('ImportExportResponse', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -257,6 +356,8 @@ def delete_replication_link( if raw=true :raises: :class:`CloudError` """ + api_version = "2014-04-01" + # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}' path_format_arguments = { @@ -270,7 +371,7 @@ def delete_replication_link( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -320,6 +421,8 @@ def get_replication_link( if raw=true :raises: :class:`CloudError` """ + api_version = "2014-04-01" + # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}' path_format_arguments = { @@ -333,7 +436,7 @@ def get_replication_link( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -390,6 +493,8 @@ def failover_replication_link( if raw=true :raises: :class:`CloudError` """ + api_version = "2014-04-01" + # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover' path_format_arguments = { @@ -403,7 +508,7 @@ def failover_replication_link( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -477,6 +582,8 @@ def failover_replication_link_allow_data_loss( if raw=true :raises: :class:`CloudError` """ + api_version = "2014-04-01" + # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss' path_format_arguments = { @@ -490,7 +597,7 @@ def failover_replication_link_allow_data_loss( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -559,6 +666,8 @@ def list_replication_links( ` :raises: :class:`CloudError` """ + api_version = "2014-04-01" + def internal_paging(next_link=None, raw=False): if not next_link: @@ -574,7 +683,7 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') else: url = next_link @@ -612,7 +721,7 @@ def internal_paging(next_link=None, raw=False): return deserialized - def pause_data_warehouse( + def pause( self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): """Pauses a data warehouse. @@ -634,6 +743,8 @@ def pause_data_warehouse( if raw=true :raises: :class:`CloudError` """ + api_version = "2014-04-01" + # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause' path_format_arguments = { @@ -646,7 +757,7 @@ def pause_data_warehouse( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -694,7 +805,7 @@ def get_long_running_output(response): long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) - def resume_data_warehouse( + def resume( self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): """Resumes a data warehouse. @@ -716,6 +827,8 @@ def resume_data_warehouse( if raw=true :raises: :class:`CloudError` """ + api_version = "2014-04-01" + # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume' path_format_arguments = { @@ -728,7 +841,7 @@ def resume_data_warehouse( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -798,6 +911,8 @@ def list_restore_points( ` :raises: :class:`CloudError` """ + api_version = "2014-04-01" + def internal_paging(next_link=None, raw=False): if not next_link: @@ -813,7 +928,7 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') else: url = next_link @@ -880,6 +995,8 @@ def create_or_update( if raw=true :raises: :class:`CloudError` """ + api_version = "2014-04-01" + # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}' path_format_arguments = { @@ -892,7 +1009,7 @@ def create_or_update( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -975,6 +1092,8 @@ def delete( if raw=true :raises: :class:`CloudError` """ + api_version = "2014-04-01" + # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}' path_format_arguments = { @@ -987,7 +1106,7 @@ def delete( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -1025,7 +1144,7 @@ def get( :param database_name: The name of the database to be retrieved. :type database_name: str :param expand: A comma separated list of child objects to expand in - the response. Possible properties: serviceTierAdvisors, upgradeHint, + the response. Possible properties: serviceTierAdvisors, transparentDataEncryption. :type expand: str :param dict custom_headers: headers that will be added to the request @@ -1038,6 +1157,8 @@ def get( if raw=true :raises: :class:`CloudError` """ + api_version = "2014-04-01" + # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}' path_format_arguments = { @@ -1050,7 +1171,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') if expand is not None: query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') @@ -1085,7 +1206,7 @@ def get( return deserialized def list_by_server( - self, resource_group_name, server_name, filter=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, server_name, expand=None, filter=None, custom_headers=None, raw=False, **operation_config): """Returns a list of databases in a server. :param resource_group_name: The name of the resource group that @@ -1094,6 +1215,10 @@ def list_by_server( :type resource_group_name: str :param server_name: The name of the server. :type server_name: str + :param expand: A comma separated list of child objects to expand in + the response. Possible properties: serviceTierAdvisors, + transparentDataEncryption. + :type expand: str :param filter: An OData filter expression that describes a subset of databases to return. :type filter: str @@ -1105,6 +1230,8 @@ def list_by_server( :rtype: :class:`DatabasePaged ` :raises: :class:`CloudError` """ + api_version = "2014-04-01" + def internal_paging(next_link=None, raw=False): if not next_link: @@ -1119,7 +1246,9 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') @@ -1180,6 +1309,8 @@ def list_usages( ` :raises: :class:`CloudError` """ + api_version = "2014-04-01" + def internal_paging(next_link=None, raw=False): if not next_link: @@ -1195,7 +1326,7 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') else: url = next_link @@ -1258,6 +1389,8 @@ def get_service_tier_advisor( if raw=true :raises: :class:`CloudError` """ + api_version = "2014-04-01" + # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/serviceTierAdvisors/{serviceTierAdvisorName}' path_format_arguments = { @@ -1271,7 +1404,7 @@ def get_service_tier_advisor( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -1324,6 +1457,8 @@ def list_service_tier_advisors( ` :raises: :class:`CloudError` """ + api_version = "2014-04-01" + def internal_paging(next_link=None, raw=False): if not next_link: @@ -1339,7 +1474,7 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') else: url = next_link @@ -1393,8 +1528,8 @@ def create_or_update_transparent_data_encryption_configuration( :type database_name: str :param status: The status of the database transparent data encryption. Possible values include: 'Enabled', 'Disabled' - :type status: str or :class:`TransparentDataEncryptionStates - ` + :type status: str or :class:`TransparentDataEncryptionStatus + ` :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -1408,6 +1543,8 @@ def create_or_update_transparent_data_encryption_configuration( """ parameters = models.TransparentDataEncryption(status=status) + api_version = "2014-04-01" + # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/current' path_format_arguments = { @@ -1420,7 +1557,7 @@ def create_or_update_transparent_data_encryption_configuration( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -1482,6 +1619,8 @@ def get_transparent_data_encryption_configuration( if raw=true :raises: :class:`CloudError` """ + api_version = "2014-04-01" + # Construct URL url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/current' path_format_arguments = { @@ -1494,7 +1633,7 @@ def get_transparent_data_encryption_configuration( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -1548,6 +1687,8 @@ def list_transparent_data_encryption_activity( ` :raises: :class:`CloudError` """ + api_version = "2014-04-01" + def internal_paging(next_link=None, raw=False): if not next_link: @@ -1563,7 +1704,7 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') else: url = next_link @@ -1600,3 +1741,301 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + + def get_threat_detection_policy( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """Gets a database's threat detection policy. + + :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 for which database + Threat Detection policy is defined. + :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 + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: :class:`DatabaseSecurityAlertPolicy + ` + :rtype: :class:`ClientRawResponse` + if raw=true + :raises: :class:`CloudError` + """ + api_version = "2014-04-01" + + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/default' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + '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') + } + 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **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('DatabaseSecurityAlertPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update_threat_detection_policy( + self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates a database's threat detection policy. + + :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 for which database + Threat Detection policy is defined. + :type database_name: str + :param parameters: The database Threat Detection policy. + :type parameters: :class:`DatabaseSecurityAlertPolicy + ` + :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`. + :rtype: :class:`DatabaseSecurityAlertPolicy + ` + :rtype: :class:`ClientRawResponse` + if raw=true + :raises: :class:`CloudError` + """ + api_version = "2014-04-01" + + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/default' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + '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') + } + 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['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, 'DatabaseSecurityAlertPolicy') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200, 201]: + 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('DatabaseSecurityAlertPolicy', response) + if response.status_code == 201: + deserialized = self._deserialize('DatabaseSecurityAlertPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def get_blob_auditing_policy( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """Gets a database's blob auditing policy. + + :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 for which database blob + audit policy is defined. + :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 + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: :class:`DatabaseBlobAuditingPolicy + ` + :rtype: :class:`ClientRawResponse` + if raw=true + :raises: :class:`CloudError` + """ + api_version = "2015-05-01-preview" + + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/default' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + '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') + } + 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['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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **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('DatabaseBlobAuditingPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update_blob_auditing_policy( + self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates a database's blob auditing policy. + + :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 for which database blob + audit policy will be defined. + :type database_name: str + :param parameters: The database blob auditing policy. + :type parameters: :class:`DatabaseBlobAuditingPolicy + ` + :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`. + :rtype: :class:`DatabaseBlobAuditingPolicy + ` + :rtype: :class:`ClientRawResponse` + if raw=true + :raises: :class:`CloudError` + """ + api_version = "2015-05-01-preview" + + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/default' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + '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') + } + 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['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, 'DatabaseBlobAuditingPolicy') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) + + if response.status_code not in [200, 201]: + 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('DatabaseBlobAuditingPolicy', response) + if response.status_code == 201: + deserialized = self._deserialize('DatabaseBlobAuditingPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/import_export_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/firewall_rules_operations.py similarity index 61% rename from azure-mgmt-sql/azure/mgmt/sql/operations/import_export_operations.py rename to azure-mgmt-sql/azure/mgmt/sql/operations/firewall_rules_operations.py index e7d86eaf5952..34b6ad8132e0 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/import_export_operations.py +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/firewall_rules_operations.py @@ -16,8 +16,8 @@ from .. import models -class ImportExportOperations(object): - """ImportExportOperations operations. +class FirewallRulesOperations(object): + """FirewallRulesOperations operations. :param client: Client for service requests. :param config: Configuration of service client. @@ -35,9 +35,9 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def list_by_server( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """The status of an import operation given the operation ID. + def create_or_update( + self, resource_group_name, server_name, firewall_rule_name, start_ip_address, end_ip_address, custom_headers=None, raw=False, **operation_config): + """Creates or updates a firewall rule. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -45,70 +45,81 @@ def list_by_server( :type resource_group_name: str :param server_name: The name of the server. :type server_name: str + :param firewall_rule_name: The name of the firewall rule. + :type firewall_rule_name: str + :param start_ip_address: The start IP address of the firewall rule. + Must be IPv4 format. Use value '0.0.0.0' to represent all + Azure-internal IP addresses. + :type start_ip_address: str + :param end_ip_address: The end IP address of the firewall rule. Must + be IPv4 format. Must be greater than or equal to startIpAddress. Use + value '0.0.0.0' to represent all Azure-internal IP addresses. + :type end_ip_address: 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`. - :rtype: :class:`ImportExportOperationResponsePaged - ` + :rtype: :class:`FirewallRule ` + :rtype: :class:`ClientRawResponse` + if raw=true :raises: :class:`CloudError` """ - def internal_paging(next_link=None, raw=False): + parameters = models.FirewallRule(start_ip_address=start_ip_address, end_ip_address=end_ip_address) - if not next_link: - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/importExportOperationResults' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + # Construct 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['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 headers - header_parameters = {} - 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, 'FirewallRule') - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, **operation_config) + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, **operation_config) - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - return response + deserialized = None - # Deserialize response - deserialized = models.ImportExportOperationResponsePaged(internal_paging, self._deserialize.dependencies) + if response.status_code == 200: + deserialized = self._deserialize('FirewallRule', response) + if response.status_code == 201: + deserialized = self._deserialize('FirewallRule', response) if raw: - header_dict = {} - client_raw_response = models.ImportExportOperationResponsePaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - def get_by_server( - self, resource_group_name, server_name, operation_id, custom_headers=None, raw=False, **operation_config): - """The of an import operation given the operation ID. + def delete( + self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): + """Deletes a firewall rule. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -116,26 +127,25 @@ def get_by_server( :type resource_group_name: str :param server_name: The name of the server. :type server_name: str - :param operation_id: The operation ID associated with the operation. - :type operation_id: str + :param firewall_rule_name: The name of the firewall rule. + :type firewall_rule_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`ImportExportOperationResponse - ` + :rtype: None :rtype: :class:`ClientRawResponse` if raw=true :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/importExportOperationResults/{operationId}' + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}' path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str') + 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -154,29 +164,21 @@ def get_by_server( 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) + request = self._client.delete(url, query_parameters) response = self._client.send(request, header_parameters, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 204]: 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('ImportExportOperationResponse', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - return deserialized - - def get_by_database( - self, resource_group_name, server_name, database_name, operation_id, custom_headers=None, raw=False, **operation_config): - """The status of an import or export operation on a database given the - operation ID. + def get( + self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): + """Gets a firewall rule. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -184,29 +186,25 @@ def get_by_database( :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 operation_id: The operation ID associated with the operation. - :type operation_id: str + :param firewall_rule_name: The name of the firewall rule. + :type firewall_rule_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :rtype: :class:`ImportExportOperationResponse - ` + :rtype: :class:`FirewallRule ` :rtype: :class:`ClientRawResponse` if raw=true :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/importExportOperationResults/{operationId}' + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}' path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), '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'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str') + 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -236,10 +234,81 @@ def get_by_database( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ImportExportOperationResponse', response) + deserialized = self._deserialize('FirewallRule', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized + + def list_by_server( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """Returns a list of firewall rules. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :rtype: :class:`FirewallRulePaged + ` + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules' + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + 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 and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.FirewallRulePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.FirewallRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/recommended_elastic_pools_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/recommended_elastic_pools_operations.py index e2b4719af335..a0f644199858 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/recommended_elastic_pools_operations.py +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/recommended_elastic_pools_operations.py @@ -173,7 +173,7 @@ def get_databases( return deserialized - def list( + def list_by_server( self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): """Returns recommended elastic pools. diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/servers_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/servers_operations.py index be19d78fcc29..0d1e7711831f 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/servers_operations.py +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/servers_operations.py @@ -11,7 +11,6 @@ from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrestazure.azure_operation import AzureOperationPoller import uuid from .. import models @@ -36,381 +35,6 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def create_or_update_firewall_rule( - self, resource_group_name, server_name, firewall_rule_name, start_ip_address, end_ip_address, custom_headers=None, raw=False, **operation_config): - """Creates or updates a firewall rule. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param firewall_rule_name: The name of the firewall rule. - :type firewall_rule_name: str - :param start_ip_address: The start IP address of the firewall rule. - Must be IPv4 format. Use value '0.0.0.0' to represent all - Azure-internal IP addresses. - :type start_ip_address: str - :param end_ip_address: The end IP address of the firewall rule. Must - be IPv4 format. Must be greater than or equal to startIpAddress. Use - value '0.0.0.0' to represent all Azure-internal IP addresses. - :type end_ip_address: 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`. - :rtype: :class:`ServerFirewallRule - ` - :rtype: :class:`ClientRawResponse` - if raw=true - :raises: :class:`CloudError` - """ - parameters = models.ServerFirewallRule(start_ip_address=start_ip_address, end_ip_address=end_ip_address) - - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['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, 'ServerFirewallRule') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **operation_config) - - if response.status_code not in [200, 201]: - 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('ServerFirewallRule', response) - if response.status_code == 201: - deserialized = self._deserialize('ServerFirewallRule', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def delete_firewall_rule( - self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): - """Deletes a firewall rule. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param firewall_rule_name: The name of the firewall rule. - :type firewall_rule_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: None - :rtype: :class:`ClientRawResponse` - if raw=true - :raises: :class:`CloudError` - """ - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['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 and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, **operation_config) - - if response.status_code not in [200, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def get_firewall_rule( - self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): - """Gets a firewall rule. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param firewall_rule_name: The name of the firewall rule. - :type firewall_rule_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: :class:`ServerFirewallRule - ` - :rtype: :class:`ClientRawResponse` - if raw=true - :raises: :class:`CloudError` - """ - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['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 and send request - request = self._client.get(url, query_parameters) - response = self._client.send(request, header_parameters, **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('ServerFirewallRule', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def list_firewall_rules( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """Returns a list of firewall rules. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :rtype: :class:`ServerFirewallRulePaged - ` - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - 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 and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - deserialized = models.ServerFirewallRulePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ServerFirewallRulePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - - def import_database( - self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): - """Imports a bacpac into a new database. . - - :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 parameters: The required parameters for importing a Bacpac into - a database. - :type parameters: :class:`ImportRequestParameters - ` - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :rtype: - :class:`AzureOperationPoller` - instance that returns :class:`ImportExportOperationResponse - ` - :rtype: :class:`ClientRawResponse` - if raw=true - :raises: :class:`CloudError` - """ - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import' - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['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, 'ImportRequestParameters') - - # Construct and send request - def long_running_send(): - - request = self._client.post(url, query_parameters) - return self._client.send( - request, header_parameters, body_content, **operation_config) - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - return self._client.send( - request, header_parameters, **operation_config) - - def get_long_running_output(response): - - if response.status_code not in [201, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('ImportExportOperationResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - if raw: - response = long_running_send() - return get_long_running_output(response) - - long_running_operation_timeout = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) - def list( self, custom_headers=None, raw=False, **operation_config): """Returns a list of servers. @@ -601,7 +225,7 @@ def delete( client_raw_response = ClientRawResponse(None, response) return client_raw_response - def get_by_resource_group( + def get( self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): """Gets a server. diff --git a/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py b/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py index 80ae7727e049..b704c43e5758 100755 --- a/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py +++ b/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py @@ -17,13 +17,12 @@ from msrestazure.azure_exceptions import CloudError from msrestazure.azure_operation import AzureOperationPoller import uuid -from .operations.servers_operations import ServersOperations +from .operations.capabilities_operations import CapabilitiesOperations +from .operations.firewall_rules_operations import FirewallRulesOperations from .operations.databases_operations import DatabasesOperations -from .operations.import_export_operations import ImportExportOperations +from .operations.servers_operations import ServersOperations from .operations.elastic_pools_operations import ElasticPoolsOperations from .operations.recommended_elastic_pools_operations import RecommendedElasticPoolsOperations -from .operations.database_threat_detection_policies_operations import DatabaseThreatDetectionPoliciesOperations -from .operations.database_blob_auditing_policies_operations import DatabaseBlobAuditingPoliciesOperations from . import models @@ -68,20 +67,18 @@ class SqlManagementClient(object): :ivar config: Configuration for client. :vartype config: SqlManagementClientConfiguration - :ivar servers: Servers operations - :vartype servers: .operations.ServersOperations + :ivar capabilities: Capabilities operations + :vartype capabilities: .operations.CapabilitiesOperations + :ivar firewall_rules: FirewallRules operations + :vartype firewall_rules: .operations.FirewallRulesOperations :ivar databases: Databases operations :vartype databases: .operations.DatabasesOperations - :ivar import_export_operations: ImportExportOperations operations - :vartype import_export_operations: .operations.ImportExportOperations + :ivar servers: Servers operations + :vartype servers: .operations.ServersOperations :ivar elastic_pools: ElasticPools operations :vartype elastic_pools: .operations.ElasticPoolsOperations :ivar recommended_elastic_pools: RecommendedElasticPools operations :vartype recommended_elastic_pools: .operations.RecommendedElasticPoolsOperations - :ivar database_threat_detection_policies: DatabaseThreatDetectionPolicies operations - :vartype database_threat_detection_policies: .operations.DatabaseThreatDetectionPoliciesOperations - :ivar database_blob_auditing_policies: DatabaseBlobAuditingPolicies operations - :vartype database_blob_auditing_policies: .operations.DatabaseBlobAuditingPoliciesOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -102,20 +99,18 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.servers = ServersOperations( + self.capabilities = CapabilitiesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.firewall_rules = FirewallRulesOperations( self._client, self.config, self._serialize, self._deserialize) self.databases = DatabasesOperations( self._client, self.config, self._serialize, self._deserialize) - self.import_export_operations = ImportExportOperations( + self.servers = ServersOperations( self._client, self.config, self._serialize, self._deserialize) self.elastic_pools = ElasticPoolsOperations( self._client, self.config, self._serialize, self._deserialize) self.recommended_elastic_pools = RecommendedElasticPoolsOperations( self._client, self.config, self._serialize, self._deserialize) - self.database_threat_detection_policies = DatabaseThreatDetectionPoliciesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.database_blob_auditing_policies = DatabaseBlobAuditingPoliciesOperations( - self._client, self.config, self._serialize, self._deserialize) def list_operations( self, custom_headers=None, raw=False, **operation_config):