diff --git a/azure-mgmt-cosmosdb/HISTORY.rst b/azure-mgmt-cosmosdb/HISTORY.rst index ab8dd85de981..7c98824d2184 100644 --- a/azure-mgmt-cosmosdb/HISTORY.rst +++ b/azure-mgmt-cosmosdb/HISTORY.rst @@ -3,6 +3,43 @@ Release History =============== +0.4.0 (2018-04-17) +++++++++++++++++++ + +**General Breaking changes** + +This version uses a next-generation code generator that *might* introduce breaking changes. + +- Model signatures now use only keyword-argument syntax. All positional arguments must be re-written as keyword-arguments. + To keep auto-completion in most cases, models are now generated for Python 2 and Python 3. Python 3 uses the "*" syntax for keyword-only arguments. +- Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to improve the behavior when unrecognized enum values are encountered. + While this is not a breaking change, the distinctions are important, and are documented here: + https://docs.python.org/3/library/enum.html#others + At a glance: + + - "is" should not be used at all. + - "format" will return the string value, where "%s" string formatting will return `NameOfEnum.stringvalue`. Format syntax should be prefered. + +- New Long Running Operation: + + - Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same. + - Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used. + - The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`, + without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`. + - New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`, + the response of the initial call will be returned without polling. + - `polling` parameter accepts instances of subclasses of `msrest.polling.PollingMethod`. + - `add_done_callback` will no longer raise if called after polling is finished, but will instead execute the callback right away. + +**Bugfixes** + +- Compatibility of the sdist with wheel 0.31.0 + +**Features** + +- Add VNet related properties to CosmosDB + + 0.3.1 (2018-02-01) ++++++++++++++++++ diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py index 18585f0fc927..64279b132b39 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py @@ -9,32 +9,62 @@ # regenerated. # -------------------------------------------------------------------------- -from .consistency_policy import ConsistencyPolicy -from .capability import Capability -from .location import Location -from .failover_policy import FailoverPolicy -from .database_account import DatabaseAccount -from .failover_policies import FailoverPolicies -from .resource import Resource -from .database_account_create_update_parameters import DatabaseAccountCreateUpdateParameters -from .database_account_patch_parameters import DatabaseAccountPatchParameters -from .database_account_list_read_only_keys_result import DatabaseAccountListReadOnlyKeysResult -from .database_account_list_keys_result import DatabaseAccountListKeysResult -from .database_account_connection_string import DatabaseAccountConnectionString -from .database_account_list_connection_strings_result import DatabaseAccountListConnectionStringsResult -from .database_account_regenerate_key_parameters import DatabaseAccountRegenerateKeyParameters -from .operation_display import OperationDisplay -from .operation import Operation -from .metric_name import MetricName -from .usage import Usage -from .partition_usage import PartitionUsage -from .metric_availability import MetricAvailability -from .metric_definition import MetricDefinition -from .metric_value import MetricValue -from .metric import Metric -from .percentile_metric_value import PercentileMetricValue -from .percentile_metric import PercentileMetric -from .partition_metric import PartitionMetric +try: + from .consistency_policy_py3 import ConsistencyPolicy + from .capability_py3 import Capability + from .location_py3 import Location + from .failover_policy_py3 import FailoverPolicy + from .virtual_network_rule_py3 import VirtualNetworkRule + from .database_account_py3 import DatabaseAccount + from .failover_policies_py3 import FailoverPolicies + from .resource_py3 import Resource + from .database_account_create_update_parameters_py3 import DatabaseAccountCreateUpdateParameters + from .database_account_patch_parameters_py3 import DatabaseAccountPatchParameters + from .database_account_list_read_only_keys_result_py3 import DatabaseAccountListReadOnlyKeysResult + from .database_account_list_keys_result_py3 import DatabaseAccountListKeysResult + from .database_account_connection_string_py3 import DatabaseAccountConnectionString + from .database_account_list_connection_strings_result_py3 import DatabaseAccountListConnectionStringsResult + from .database_account_regenerate_key_parameters_py3 import DatabaseAccountRegenerateKeyParameters + from .operation_display_py3 import OperationDisplay + from .operation_py3 import Operation + from .metric_name_py3 import MetricName + from .usage_py3 import Usage + from .partition_usage_py3 import PartitionUsage + from .metric_availability_py3 import MetricAvailability + from .metric_definition_py3 import MetricDefinition + from .metric_value_py3 import MetricValue + from .metric_py3 import Metric + from .percentile_metric_value_py3 import PercentileMetricValue + from .percentile_metric_py3 import PercentileMetric + from .partition_metric_py3 import PartitionMetric +except (SyntaxError, ImportError): + from .consistency_policy import ConsistencyPolicy + from .capability import Capability + from .location import Location + from .failover_policy import FailoverPolicy + from .virtual_network_rule import VirtualNetworkRule + from .database_account import DatabaseAccount + from .failover_policies import FailoverPolicies + from .resource import Resource + from .database_account_create_update_parameters import DatabaseAccountCreateUpdateParameters + from .database_account_patch_parameters import DatabaseAccountPatchParameters + from .database_account_list_read_only_keys_result import DatabaseAccountListReadOnlyKeysResult + from .database_account_list_keys_result import DatabaseAccountListKeysResult + from .database_account_connection_string import DatabaseAccountConnectionString + from .database_account_list_connection_strings_result import DatabaseAccountListConnectionStringsResult + from .database_account_regenerate_key_parameters import DatabaseAccountRegenerateKeyParameters + from .operation_display import OperationDisplay + from .operation import Operation + from .metric_name import MetricName + from .usage import Usage + from .partition_usage import PartitionUsage + from .metric_availability import MetricAvailability + from .metric_definition import MetricDefinition + from .metric_value import MetricValue + from .metric import Metric + from .percentile_metric_value import PercentileMetricValue + from .percentile_metric import PercentileMetric + from .partition_metric import PartitionMetric from .database_account_paged import DatabaseAccountPaged from .metric_paged import MetricPaged from .usage_paged import UsagePaged @@ -57,6 +87,7 @@ 'Capability', 'Location', 'FailoverPolicy', + 'VirtualNetworkRule', 'DatabaseAccount', 'FailoverPolicies', 'Resource', diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/capability.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/capability.py index c35660b17ffc..4af58eafe420 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/capability.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/capability.py @@ -15,7 +15,9 @@ class Capability(Model): """Cosmos DB capability object. - :param name: Name of the Cosmos DB capability + :param name: Name of the Cosmos DB capability. For example, "name": + "EnableCassandra". Current values also include "EnableTable" and + "EnableGremlin". :type name: str """ @@ -23,6 +25,6 @@ class Capability(Model): 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, name=None): - super(Capability, self).__init__() - self.name = name + def __init__(self, **kwargs): + super(Capability, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/capability_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/capability_py3.py new file mode 100644 index 000000000000..50a19a7ecad3 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/capability_py3.py @@ -0,0 +1,30 @@ +# 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 Capability(Model): + """Cosmos DB capability object. + + :param name: Name of the Cosmos DB capability. For example, "name": + "EnableCassandra". Current values also include "EnableTable" and + "EnableGremlin". + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(Capability, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/consistency_policy.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/consistency_policy.py index b66a9c1048a1..10e57668fd9d 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/consistency_policy.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/consistency_policy.py @@ -15,9 +15,12 @@ class ConsistencyPolicy(Model): """The consistency policy for the Cosmos DB database account. - :param default_consistency_level: The default consistency level and - configuration settings of the Cosmos DB account. Possible values include: - 'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix' + All required parameters must be populated in order to send to Azure. + + :param default_consistency_level: Required. The default consistency level + and configuration settings of the Cosmos DB account. Possible values + include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', + 'ConsistentPrefix' :type default_consistency_level: str or ~azure.mgmt.cosmosdb.models.DefaultConsistencyLevel :param max_staleness_prefix: When used with the Bounded Staleness @@ -44,8 +47,8 @@ class ConsistencyPolicy(Model): 'max_interval_in_seconds': {'key': 'maxIntervalInSeconds', 'type': 'int'}, } - def __init__(self, default_consistency_level, max_staleness_prefix=None, max_interval_in_seconds=None): - super(ConsistencyPolicy, self).__init__() - self.default_consistency_level = default_consistency_level - self.max_staleness_prefix = max_staleness_prefix - self.max_interval_in_seconds = max_interval_in_seconds + def __init__(self, **kwargs): + super(ConsistencyPolicy, self).__init__(**kwargs) + self.default_consistency_level = kwargs.get('default_consistency_level', None) + self.max_staleness_prefix = kwargs.get('max_staleness_prefix', None) + self.max_interval_in_seconds = kwargs.get('max_interval_in_seconds', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/consistency_policy_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/consistency_policy_py3.py new file mode 100644 index 000000000000..a544558dbc23 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/consistency_policy_py3.py @@ -0,0 +1,54 @@ +# 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 ConsistencyPolicy(Model): + """The consistency policy for the Cosmos DB database account. + + All required parameters must be populated in order to send to Azure. + + :param default_consistency_level: Required. The default consistency level + and configuration settings of the Cosmos DB account. Possible values + include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', + 'ConsistentPrefix' + :type default_consistency_level: str or + ~azure.mgmt.cosmosdb.models.DefaultConsistencyLevel + :param max_staleness_prefix: When used with the Bounded Staleness + consistency level, this value represents the number of stale requests + tolerated. Accepted range for this value is 1 – 2,147,483,647. Required + when defaultConsistencyPolicy is set to 'BoundedStaleness'. + :type max_staleness_prefix: long + :param max_interval_in_seconds: When used with the Bounded Staleness + consistency level, this value represents the time amount of staleness (in + seconds) tolerated. Accepted range for this value is 5 - 86400. Required + when defaultConsistencyPolicy is set to 'BoundedStaleness'. + :type max_interval_in_seconds: int + """ + + _validation = { + 'default_consistency_level': {'required': True}, + 'max_staleness_prefix': {'maximum': 2147483647, 'minimum': 1}, + 'max_interval_in_seconds': {'maximum': 86400, 'minimum': 5}, + } + + _attribute_map = { + 'default_consistency_level': {'key': 'defaultConsistencyLevel', 'type': 'DefaultConsistencyLevel'}, + 'max_staleness_prefix': {'key': 'maxStalenessPrefix', 'type': 'long'}, + 'max_interval_in_seconds': {'key': 'maxIntervalInSeconds', 'type': 'int'}, + } + + def __init__(self, *, default_consistency_level, max_staleness_prefix: int=None, max_interval_in_seconds: int=None, **kwargs) -> None: + super(ConsistencyPolicy, self).__init__(**kwargs) + self.default_consistency_level = default_consistency_level + self.max_staleness_prefix = max_staleness_prefix + self.max_interval_in_seconds = max_interval_in_seconds diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/cosmos_db_enums.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/cosmos_db_enums.py index b42298d4a92a..73dfa4fad8fa 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/cosmos_db_enums.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/cosmos_db_enums.py @@ -12,19 +12,19 @@ from enum import Enum -class DatabaseAccountKind(Enum): +class DatabaseAccountKind(str, Enum): global_document_db = "GlobalDocumentDB" mongo_db = "MongoDB" parse = "Parse" -class DatabaseAccountOfferType(Enum): +class DatabaseAccountOfferType(str, Enum): standard = "Standard" -class DefaultConsistencyLevel(Enum): +class DefaultConsistencyLevel(str, Enum): eventual = "Eventual" session = "Session" @@ -33,7 +33,7 @@ class DefaultConsistencyLevel(Enum): consistent_prefix = "ConsistentPrefix" -class KeyKind(Enum): +class KeyKind(str, Enum): primary = "primary" secondary = "secondary" @@ -41,7 +41,7 @@ class KeyKind(Enum): secondary_readonly = "secondaryReadonly" -class UnitType(Enum): +class UnitType(str, Enum): count = "Count" bytes = "Bytes" @@ -52,7 +52,7 @@ class UnitType(Enum): milliseconds = "Milliseconds" -class PrimaryAggregationType(Enum): +class PrimaryAggregationType(str, Enum): none = "None" average = "Average" diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account.py index de99fc82b01e..f746e080e25f 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account.py @@ -18,14 +18,16 @@ class DatabaseAccount(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The unique resource identifier of the database account. :vartype id: str :ivar name: The name of the database account. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :param location: The location of the resource group to which the resource - belongs. + :param location: Required. The location of the resource group to which the + resource belongs. :type location: str :param tags: :type tags: dict[str, str] @@ -48,6 +50,9 @@ class DatabaseAccount(Resource): as the allowed list of client IPs for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces. :type ip_range_filter: str + :param is_virtual_network_filter_enabled: Flag to indicate whether to + enable/disable Virtual Network ACL rules. + :type is_virtual_network_filter_enabled: bool :param enable_automatic_failover: Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and @@ -68,6 +73,10 @@ class DatabaseAccount(Resource): their failover priorities. :vartype failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] + :param virtual_network_rules: List of Virtual Network ACL rules configured + for the Cosmos DB account. + :type virtual_network_rules: + list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] """ _validation = { @@ -93,24 +102,28 @@ class DatabaseAccount(Resource): 'document_endpoint': {'key': 'properties.documentEndpoint', 'type': 'str'}, 'database_account_offer_type': {'key': 'properties.databaseAccountOfferType', 'type': 'DatabaseAccountOfferType'}, 'ip_range_filter': {'key': 'properties.ipRangeFilter', 'type': 'str'}, + 'is_virtual_network_filter_enabled': {'key': 'properties.isVirtualNetworkFilterEnabled', 'type': 'bool'}, 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, 'consistency_policy': {'key': 'properties.consistencyPolicy', 'type': 'ConsistencyPolicy'}, 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, 'write_locations': {'key': 'properties.writeLocations', 'type': '[Location]'}, 'read_locations': {'key': 'properties.readLocations', 'type': '[Location]'}, 'failover_policies': {'key': 'properties.failoverPolicies', 'type': '[FailoverPolicy]'}, + 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, } - def __init__(self, location, tags=None, kind="GlobalDocumentDB", provisioning_state=None, ip_range_filter=None, enable_automatic_failover=None, consistency_policy=None, capabilities=None): - super(DatabaseAccount, self).__init__(location=location, tags=tags) - self.kind = kind - self.provisioning_state = provisioning_state + def __init__(self, **kwargs): + super(DatabaseAccount, self).__init__(**kwargs) + self.kind = kwargs.get('kind', "GlobalDocumentDB") + self.provisioning_state = kwargs.get('provisioning_state', None) self.document_endpoint = None self.database_account_offer_type = None - self.ip_range_filter = ip_range_filter - self.enable_automatic_failover = enable_automatic_failover - self.consistency_policy = consistency_policy - self.capabilities = capabilities + self.ip_range_filter = kwargs.get('ip_range_filter', None) + self.is_virtual_network_filter_enabled = kwargs.get('is_virtual_network_filter_enabled', None) + self.enable_automatic_failover = kwargs.get('enable_automatic_failover', None) + self.consistency_policy = kwargs.get('consistency_policy', None) + self.capabilities = kwargs.get('capabilities', None) self.write_locations = None self.read_locations = None self.failover_policies = None + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_connection_string.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_connection_string.py index 906495c5a91a..113617832a67 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_connection_string.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_connection_string.py @@ -34,7 +34,7 @@ class DatabaseAccountConnectionString(Model): 'description': {'key': 'description', 'type': 'str'}, } - def __init__(self): - super(DatabaseAccountConnectionString, self).__init__() + def __init__(self, **kwargs): + super(DatabaseAccountConnectionString, self).__init__(**kwargs) self.connection_string = None self.description = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_connection_string_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_connection_string_py3.py new file mode 100644 index 000000000000..d2c8d2671007 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_connection_string_py3.py @@ -0,0 +1,40 @@ +# 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 DatabaseAccountConnectionString(Model): + """Connection string for the Cosmos DB account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar connection_string: Value of the connection string + :vartype connection_string: str + :ivar description: Description of the connection string + :vartype description: str + """ + + _validation = { + 'connection_string': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DatabaseAccountConnectionString, self).__init__(**kwargs) + self.connection_string = None + self.description = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters.py index c91faecbb224..4cd363937f05 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters.py @@ -18,14 +18,16 @@ class DatabaseAccountCreateUpdateParameters(Resource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The unique resource identifier of the database account. :vartype id: str :ivar name: The name of the database account. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :param location: The location of the resource group to which the resource - belongs. + :param location: Required. The location of the resource group to which the + resource belongs. :type location: str :param tags: :type tags: dict[str, str] @@ -36,16 +38,19 @@ class DatabaseAccountCreateUpdateParameters(Resource): :param consistency_policy: The consistency policy for the Cosmos DB account. :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy - :param locations: An array that contains the georeplication locations - enabled for the Cosmos DB account. + :param locations: Required. An array that contains the georeplication + locations enabled for the Cosmos DB account. :type locations: list[~azure.mgmt.cosmosdb.models.Location] - :ivar database_account_offer_type: Default value: "Standard" . + :ivar database_account_offer_type: Required. Default value: "Standard" . :vartype database_account_offer_type: str :param ip_range_filter: Cosmos DB Firewall Support: This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces. :type ip_range_filter: str + :param is_virtual_network_filter_enabled: Flag to indicate whether to + enable/disable Virtual Network ACL rules. + :type is_virtual_network_filter_enabled: bool :param enable_automatic_failover: Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and @@ -53,6 +58,10 @@ class DatabaseAccountCreateUpdateParameters(Resource): :type enable_automatic_failover: bool :param capabilities: List of Cosmos DB capabilities for the account :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + :param virtual_network_rules: List of Virtual Network ACL rules configured + for the Cosmos DB account. + :type virtual_network_rules: + list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] """ _validation = { @@ -75,17 +84,21 @@ class DatabaseAccountCreateUpdateParameters(Resource): 'locations': {'key': 'properties.locations', 'type': '[Location]'}, 'database_account_offer_type': {'key': 'properties.databaseAccountOfferType', 'type': 'str'}, 'ip_range_filter': {'key': 'properties.ipRangeFilter', 'type': 'str'}, + 'is_virtual_network_filter_enabled': {'key': 'properties.isVirtualNetworkFilterEnabled', 'type': 'bool'}, 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, + 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, } database_account_offer_type = "Standard" - def __init__(self, location, locations, tags=None, kind="GlobalDocumentDB", consistency_policy=None, ip_range_filter=None, enable_automatic_failover=None, capabilities=None): - super(DatabaseAccountCreateUpdateParameters, self).__init__(location=location, tags=tags) - self.kind = kind - self.consistency_policy = consistency_policy - self.locations = locations - self.ip_range_filter = ip_range_filter - self.enable_automatic_failover = enable_automatic_failover - self.capabilities = capabilities + def __init__(self, **kwargs): + super(DatabaseAccountCreateUpdateParameters, self).__init__(**kwargs) + self.kind = kwargs.get('kind', "GlobalDocumentDB") + self.consistency_policy = kwargs.get('consistency_policy', None) + self.locations = kwargs.get('locations', None) + self.ip_range_filter = kwargs.get('ip_range_filter', None) + self.is_virtual_network_filter_enabled = kwargs.get('is_virtual_network_filter_enabled', None) + self.enable_automatic_failover = kwargs.get('enable_automatic_failover', None) + self.capabilities = kwargs.get('capabilities', None) + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters_py3.py new file mode 100644 index 000000000000..a370ca82c0f2 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters_py3.py @@ -0,0 +1,104 @@ +# 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 DatabaseAccountCreateUpdateParameters(Resource): + """Parameters to create and update Cosmos DB database accounts. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The unique resource identifier of the database account. + :vartype id: str + :ivar name: The name of the database account. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :param location: Required. The location of the resource group to which the + resource belongs. + :type location: str + :param tags: + :type tags: dict[str, str] + :param kind: Indicates the type of database account. This can only be set + at database account creation. Possible values include: 'GlobalDocumentDB', + 'MongoDB', 'Parse'. Default value: "GlobalDocumentDB" . + :type kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind + :param consistency_policy: The consistency policy for the Cosmos DB + account. + :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy + :param locations: Required. An array that contains the georeplication + locations enabled for the Cosmos DB account. + :type locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar database_account_offer_type: Required. Default value: "Standard" . + :vartype database_account_offer_type: str + :param ip_range_filter: Cosmos DB Firewall Support: This value specifies + the set of IP addresses or IP address ranges in CIDR form to be included + as the allowed list of client IPs for a given database account. IP + addresses/ranges must be comma separated and must not contain any spaces. + :type ip_range_filter: str + :param is_virtual_network_filter_enabled: Flag to indicate whether to + enable/disable Virtual Network ACL rules. + :type is_virtual_network_filter_enabled: bool + :param enable_automatic_failover: Enables automatic failover of the write + region in the rare event that the region is unavailable due to an outage. + Automatic failover will result in a new write region for the account and + is chosen based on the failover priorities configured for the account. + :type enable_automatic_failover: bool + :param capabilities: List of Cosmos DB capabilities for the account + :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + :param virtual_network_rules: List of Virtual Network ACL rules configured + for the Cosmos DB account. + :type virtual_network_rules: + list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'locations': {'required': True}, + 'database_account_offer_type': {'required': True, 'constant': True}, + } + + _attribute_map = { + '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}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'consistency_policy': {'key': 'properties.consistencyPolicy', 'type': 'ConsistencyPolicy'}, + 'locations': {'key': 'properties.locations', 'type': '[Location]'}, + 'database_account_offer_type': {'key': 'properties.databaseAccountOfferType', 'type': 'str'}, + 'ip_range_filter': {'key': 'properties.ipRangeFilter', 'type': 'str'}, + 'is_virtual_network_filter_enabled': {'key': 'properties.isVirtualNetworkFilterEnabled', 'type': 'bool'}, + 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, + 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, + 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + } + + database_account_offer_type = "Standard" + + def __init__(self, *, location: str, locations, tags=None, kind="GlobalDocumentDB", consistency_policy=None, ip_range_filter: str=None, is_virtual_network_filter_enabled: bool=None, enable_automatic_failover: bool=None, capabilities=None, virtual_network_rules=None, **kwargs) -> None: + super(DatabaseAccountCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + self.kind = kind + self.consistency_policy = consistency_policy + self.locations = locations + self.ip_range_filter = ip_range_filter + self.is_virtual_network_filter_enabled = is_virtual_network_filter_enabled + self.enable_automatic_failover = enable_automatic_failover + self.capabilities = capabilities + self.virtual_network_rules = virtual_network_rules diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_connection_strings_result.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_connection_strings_result.py index 7088a45b4297..4238c1c68bd5 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_connection_strings_result.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_connection_strings_result.py @@ -25,6 +25,6 @@ class DatabaseAccountListConnectionStringsResult(Model): 'connection_strings': {'key': 'connectionStrings', 'type': '[DatabaseAccountConnectionString]'}, } - def __init__(self, connection_strings=None): - super(DatabaseAccountListConnectionStringsResult, self).__init__() - self.connection_strings = connection_strings + def __init__(self, **kwargs): + super(DatabaseAccountListConnectionStringsResult, self).__init__(**kwargs) + self.connection_strings = kwargs.get('connection_strings', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_connection_strings_result_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_connection_strings_result_py3.py new file mode 100644 index 000000000000..dcf39d62634b --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_connection_strings_result_py3.py @@ -0,0 +1,30 @@ +# 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 DatabaseAccountListConnectionStringsResult(Model): + """The connection strings for the given database account. + + :param connection_strings: An array that contains the connection strings + for the Cosmos DB account. + :type connection_strings: + list[~azure.mgmt.cosmosdb.models.DatabaseAccountConnectionString] + """ + + _attribute_map = { + 'connection_strings': {'key': 'connectionStrings', 'type': '[DatabaseAccountConnectionString]'}, + } + + def __init__(self, *, connection_strings=None, **kwargs) -> None: + super(DatabaseAccountListConnectionStringsResult, self).__init__(**kwargs) + self.connection_strings = connection_strings diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_keys_result.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_keys_result.py index cd0df747dec4..8da636886258 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_keys_result.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_keys_result.py @@ -46,8 +46,8 @@ class DatabaseAccountListKeysResult(Model): 'secondary_readonly_master_key': {'key': 'properties.secondaryReadonlyMasterKey', 'type': 'str'}, } - def __init__(self): - super(DatabaseAccountListKeysResult, self).__init__() + def __init__(self, **kwargs): + super(DatabaseAccountListKeysResult, self).__init__(**kwargs) self.primary_master_key = None self.secondary_master_key = None self.primary_readonly_master_key = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_keys_result_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_keys_result_py3.py new file mode 100644 index 000000000000..3b060e748026 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_keys_result_py3.py @@ -0,0 +1,54 @@ +# 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 DatabaseAccountListKeysResult(Model): + """The access keys for the given database account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar primary_master_key: Base 64 encoded value of the primary read-write + key. + :vartype primary_master_key: str + :ivar secondary_master_key: Base 64 encoded value of the secondary + read-write key. + :vartype secondary_master_key: str + :ivar primary_readonly_master_key: Base 64 encoded value of the primary + read-only key. + :vartype primary_readonly_master_key: str + :ivar secondary_readonly_master_key: Base 64 encoded value of the + secondary read-only key. + :vartype secondary_readonly_master_key: str + """ + + _validation = { + 'primary_master_key': {'readonly': True}, + 'secondary_master_key': {'readonly': True}, + 'primary_readonly_master_key': {'readonly': True}, + 'secondary_readonly_master_key': {'readonly': True}, + } + + _attribute_map = { + 'primary_master_key': {'key': 'primaryMasterKey', 'type': 'str'}, + 'secondary_master_key': {'key': 'secondaryMasterKey', 'type': 'str'}, + 'primary_readonly_master_key': {'key': 'properties.primaryReadonlyMasterKey', 'type': 'str'}, + 'secondary_readonly_master_key': {'key': 'properties.secondaryReadonlyMasterKey', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DatabaseAccountListKeysResult, self).__init__(**kwargs) + self.primary_master_key = None + self.secondary_master_key = None + self.primary_readonly_master_key = None + self.secondary_readonly_master_key = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_read_only_keys_result.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_read_only_keys_result.py index 7e257be3c022..806ef75fa732 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_read_only_keys_result.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_read_only_keys_result.py @@ -36,7 +36,7 @@ class DatabaseAccountListReadOnlyKeysResult(Model): 'secondary_readonly_master_key': {'key': 'secondaryReadonlyMasterKey', 'type': 'str'}, } - def __init__(self): - super(DatabaseAccountListReadOnlyKeysResult, self).__init__() + def __init__(self, **kwargs): + super(DatabaseAccountListReadOnlyKeysResult, self).__init__(**kwargs) self.primary_readonly_master_key = None self.secondary_readonly_master_key = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_read_only_keys_result_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_read_only_keys_result_py3.py new file mode 100644 index 000000000000..fc4b99fadd90 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_list_read_only_keys_result_py3.py @@ -0,0 +1,42 @@ +# 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 DatabaseAccountListReadOnlyKeysResult(Model): + """The read-only access keys for the given database account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar primary_readonly_master_key: Base 64 encoded value of the primary + read-only key. + :vartype primary_readonly_master_key: str + :ivar secondary_readonly_master_key: Base 64 encoded value of the + secondary read-only key. + :vartype secondary_readonly_master_key: str + """ + + _validation = { + 'primary_readonly_master_key': {'readonly': True}, + 'secondary_readonly_master_key': {'readonly': True}, + } + + _attribute_map = { + 'primary_readonly_master_key': {'key': 'primaryReadonlyMasterKey', 'type': 'str'}, + 'secondary_readonly_master_key': {'key': 'secondaryReadonlyMasterKey', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DatabaseAccountListReadOnlyKeysResult, self).__init__(**kwargs) + self.primary_readonly_master_key = None + self.secondary_readonly_master_key = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_patch_parameters.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_patch_parameters.py index 25ea23ee39ea..c6ce68f18224 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_patch_parameters.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_patch_parameters.py @@ -26,7 +26,7 @@ class DatabaseAccountPatchParameters(Model): 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, } - def __init__(self, tags=None, capabilities=None): - super(DatabaseAccountPatchParameters, self).__init__() - self.tags = tags - self.capabilities = capabilities + def __init__(self, **kwargs): + super(DatabaseAccountPatchParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.capabilities = kwargs.get('capabilities', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_patch_parameters_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_patch_parameters_py3.py new file mode 100644 index 000000000000..3554c8922fe2 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_patch_parameters_py3.py @@ -0,0 +1,32 @@ +# 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 DatabaseAccountPatchParameters(Model): + """Parameters for patching Azure Cosmos DB database account properties. + + :param tags: + :type tags: dict[str, str] + :param capabilities: List of Cosmos DB capabilities for the account + :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, + } + + def __init__(self, *, tags=None, capabilities=None, **kwargs) -> None: + super(DatabaseAccountPatchParameters, self).__init__(**kwargs) + self.tags = tags + self.capabilities = capabilities diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_py3.py new file mode 100644 index 000000000000..eb8b56802aee --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_py3.py @@ -0,0 +1,129 @@ +# 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 DatabaseAccount(Resource): + """An Azure Cosmos DB database account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The unique resource identifier of the database account. + :vartype id: str + :ivar name: The name of the database account. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :param location: Required. The location of the resource group to which the + resource belongs. + :type location: str + :param tags: + :type tags: dict[str, str] + :param kind: Indicates the type of database account. This can only be set + at database account creation. Possible values include: 'GlobalDocumentDB', + 'MongoDB', 'Parse'. Default value: "GlobalDocumentDB" . + :type kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind + :param provisioning_state: + :type provisioning_state: str + :ivar document_endpoint: The connection endpoint for the Cosmos DB + database account. + :vartype document_endpoint: str + :ivar database_account_offer_type: The offer type for the Cosmos DB + database account. Default value: Standard. Possible values include: + 'Standard' + :vartype database_account_offer_type: str or + ~azure.mgmt.cosmosdb.models.DatabaseAccountOfferType + :param ip_range_filter: Cosmos DB Firewall Support: This value specifies + the set of IP addresses or IP address ranges in CIDR form to be included + as the allowed list of client IPs for a given database account. IP + addresses/ranges must be comma separated and must not contain any spaces. + :type ip_range_filter: str + :param is_virtual_network_filter_enabled: Flag to indicate whether to + enable/disable Virtual Network ACL rules. + :type is_virtual_network_filter_enabled: bool + :param enable_automatic_failover: Enables automatic failover of the write + region in the rare event that the region is unavailable due to an outage. + Automatic failover will result in a new write region for the account and + is chosen based on the failover priorities configured for the account. + :type enable_automatic_failover: bool + :param consistency_policy: The consistency policy for the Cosmos DB + database account. + :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy + :param capabilities: List of Cosmos DB capabilities for the account + :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + :ivar write_locations: An array that contains the write location for the + Cosmos DB account. + :vartype write_locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar read_locations: An array that contains of the read locations enabled + for the Cosmos DB account. + :vartype read_locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar failover_policies: An array that contains the regions ordered by + their failover priorities. + :vartype failover_policies: + list[~azure.mgmt.cosmosdb.models.FailoverPolicy] + :param virtual_network_rules: List of Virtual Network ACL rules configured + for the Cosmos DB account. + :type virtual_network_rules: + list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'document_endpoint': {'readonly': True}, + 'database_account_offer_type': {'readonly': True}, + 'write_locations': {'readonly': True}, + 'read_locations': {'readonly': True}, + 'failover_policies': {'readonly': True}, + } + + _attribute_map = { + '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}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'document_endpoint': {'key': 'properties.documentEndpoint', 'type': 'str'}, + 'database_account_offer_type': {'key': 'properties.databaseAccountOfferType', 'type': 'DatabaseAccountOfferType'}, + 'ip_range_filter': {'key': 'properties.ipRangeFilter', 'type': 'str'}, + 'is_virtual_network_filter_enabled': {'key': 'properties.isVirtualNetworkFilterEnabled', 'type': 'bool'}, + 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, + 'consistency_policy': {'key': 'properties.consistencyPolicy', 'type': 'ConsistencyPolicy'}, + 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, + 'write_locations': {'key': 'properties.writeLocations', 'type': '[Location]'}, + 'read_locations': {'key': 'properties.readLocations', 'type': '[Location]'}, + 'failover_policies': {'key': 'properties.failoverPolicies', 'type': '[FailoverPolicy]'}, + 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + } + + def __init__(self, *, location: str, tags=None, kind="GlobalDocumentDB", provisioning_state: str=None, ip_range_filter: str=None, is_virtual_network_filter_enabled: bool=None, enable_automatic_failover: bool=None, consistency_policy=None, capabilities=None, virtual_network_rules=None, **kwargs) -> None: + super(DatabaseAccount, self).__init__(location=location, tags=tags, **kwargs) + self.kind = kind + self.provisioning_state = provisioning_state + self.document_endpoint = None + self.database_account_offer_type = None + self.ip_range_filter = ip_range_filter + self.is_virtual_network_filter_enabled = is_virtual_network_filter_enabled + self.enable_automatic_failover = enable_automatic_failover + self.consistency_policy = consistency_policy + self.capabilities = capabilities + self.write_locations = None + self.read_locations = None + self.failover_policies = None + self.virtual_network_rules = virtual_network_rules diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_regenerate_key_parameters.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_regenerate_key_parameters.py index 8e4746b69994..c122b82647ce 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_regenerate_key_parameters.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_regenerate_key_parameters.py @@ -15,8 +15,10 @@ class DatabaseAccountRegenerateKeyParameters(Model): """Parameters to regenerate the keys within the database account. - :param key_kind: The access key to regenerate. Possible values include: - 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' + All required parameters must be populated in order to send to Azure. + + :param key_kind: Required. The access key to regenerate. Possible values + include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' :type key_kind: str or ~azure.mgmt.cosmosdb.models.KeyKind """ @@ -28,6 +30,6 @@ class DatabaseAccountRegenerateKeyParameters(Model): 'key_kind': {'key': 'keyKind', 'type': 'str'}, } - def __init__(self, key_kind): - super(DatabaseAccountRegenerateKeyParameters, self).__init__() - self.key_kind = key_kind + def __init__(self, **kwargs): + super(DatabaseAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_kind = kwargs.get('key_kind', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_regenerate_key_parameters_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_regenerate_key_parameters_py3.py new file mode 100644 index 000000000000..0ab59e91d274 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_regenerate_key_parameters_py3.py @@ -0,0 +1,35 @@ +# 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 DatabaseAccountRegenerateKeyParameters(Model): + """Parameters to regenerate the keys within the database account. + + All required parameters must be populated in order to send to Azure. + + :param key_kind: Required. The access key to regenerate. Possible values + include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' + :type key_kind: str or ~azure.mgmt.cosmosdb.models.KeyKind + """ + + _validation = { + 'key_kind': {'required': True}, + } + + _attribute_map = { + 'key_kind': {'key': 'keyKind', 'type': 'str'}, + } + + def __init__(self, *, key_kind, **kwargs) -> None: + super(DatabaseAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_kind = key_kind diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policies.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policies.py index 30d24ac08ef2..465593e38b6e 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policies.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policies.py @@ -15,7 +15,9 @@ class FailoverPolicies(Model): """The list of new failover policies for the failover priority change. - :param failover_policies: List of failover policies. + All required parameters must be populated in order to send to Azure. + + :param failover_policies: Required. List of failover policies. :type failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] """ @@ -27,6 +29,6 @@ class FailoverPolicies(Model): 'failover_policies': {'key': 'failoverPolicies', 'type': '[FailoverPolicy]'}, } - def __init__(self, failover_policies): - super(FailoverPolicies, self).__init__() - self.failover_policies = failover_policies + def __init__(self, **kwargs): + super(FailoverPolicies, self).__init__(**kwargs) + self.failover_policies = kwargs.get('failover_policies', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policies_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policies_py3.py new file mode 100644 index 000000000000..ef0230b30f7d --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policies_py3.py @@ -0,0 +1,34 @@ +# 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 FailoverPolicies(Model): + """The list of new failover policies for the failover priority change. + + All required parameters must be populated in order to send to Azure. + + :param failover_policies: Required. List of failover policies. + :type failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] + """ + + _validation = { + 'failover_policies': {'required': True}, + } + + _attribute_map = { + 'failover_policies': {'key': 'failoverPolicies', 'type': '[FailoverPolicy]'}, + } + + def __init__(self, *, failover_policies, **kwargs) -> None: + super(FailoverPolicies, self).__init__(**kwargs) + self.failover_policies = failover_policies diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policy.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policy.py index 0bc2971a563d..032a8850ec6a 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policy.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policy.py @@ -42,8 +42,8 @@ class FailoverPolicy(Model): 'failover_priority': {'key': 'failoverPriority', 'type': 'int'}, } - def __init__(self, location_name=None, failover_priority=None): - super(FailoverPolicy, self).__init__() + def __init__(self, **kwargs): + super(FailoverPolicy, self).__init__(**kwargs) self.id = None - self.location_name = location_name - self.failover_priority = failover_priority + self.location_name = kwargs.get('location_name', None) + self.failover_priority = kwargs.get('failover_priority', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policy_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policy_py3.py new file mode 100644 index 000000000000..94451fd116d8 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/failover_policy_py3.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 FailoverPolicy(Model): + """The failover policy for a given region of a database account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The unique identifier of the region in which the database + account replicates to. Example: <accountName>-<locationName>. + :vartype id: str + :param location_name: The name of the region in which the database account + exists. + :type location_name: str + :param failover_priority: The failover priority of the region. A failover + priority of 0 indicates a write region. The maximum value for a failover + priority = (total number of regions - 1). Failover priority values must be + unique for each of the regions in which the database account exists. + :type failover_priority: int + """ + + _validation = { + 'id': {'readonly': True}, + 'failover_priority': {'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location_name': {'key': 'locationName', 'type': 'str'}, + 'failover_priority': {'key': 'failoverPriority', 'type': 'int'}, + } + + def __init__(self, *, location_name: str=None, failover_priority: int=None, **kwargs) -> None: + super(FailoverPolicy, self).__init__(**kwargs) + self.id = None + self.location_name = location_name + self.failover_priority = failover_priority diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/location.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/location.py index 4b7e4b832758..220c9a4128c0 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/location.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/location.py @@ -50,10 +50,10 @@ class Location(Model): 'failover_priority': {'key': 'failoverPriority', 'type': 'int'}, } - def __init__(self, location_name=None, provisioning_state=None, failover_priority=None): - super(Location, self).__init__() + def __init__(self, **kwargs): + super(Location, self).__init__(**kwargs) self.id = None - self.location_name = location_name + self.location_name = kwargs.get('location_name', None) self.document_endpoint = None - self.provisioning_state = provisioning_state - self.failover_priority = failover_priority + self.provisioning_state = kwargs.get('provisioning_state', None) + self.failover_priority = kwargs.get('failover_priority', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/location_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/location_py3.py new file mode 100644 index 000000000000..5ef5bbf16998 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/location_py3.py @@ -0,0 +1,59 @@ +# 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 Location(Model): + """A region in which the Azure Cosmos DB database account is deployed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The unique identifier of the region within the database account. + Example: <accountName>-<locationName>. + :vartype id: str + :param location_name: The name of the region. + :type location_name: str + :ivar document_endpoint: The connection endpoint for the specific region. + Example: + https://<accountName>-<locationName>.documents.azure.com:443/ + :vartype document_endpoint: str + :param provisioning_state: + :type provisioning_state: str + :param failover_priority: The failover priority of the region. A failover + priority of 0 indicates a write region. The maximum value for a failover + priority = (total number of regions - 1). Failover priority values must be + unique for each of the regions in which the database account exists. + :type failover_priority: int + """ + + _validation = { + 'id': {'readonly': True}, + 'document_endpoint': {'readonly': True}, + 'failover_priority': {'minimum': 0}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location_name': {'key': 'locationName', 'type': 'str'}, + 'document_endpoint': {'key': 'documentEndpoint', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'failover_priority': {'key': 'failoverPriority', 'type': 'int'}, + } + + def __init__(self, *, location_name: str=None, provisioning_state: str=None, failover_priority: int=None, **kwargs) -> None: + super(Location, self).__init__(**kwargs) + self.id = None + self.location_name = location_name + self.document_endpoint = None + self.provisioning_state = provisioning_state + self.failover_priority = failover_priority diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric.py index c4fef23b2b87..ab7b78168c72 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric.py @@ -53,11 +53,11 @@ class Metric(Model): 'metric_values': {'key': 'metricValues', 'type': '[MetricValue]'}, } - def __init__(self, unit=None): - super(Metric, self).__init__() + def __init__(self, **kwargs): + super(Metric, self).__init__(**kwargs) self.start_time = None self.end_time = None self.time_grain = None - self.unit = unit + self.unit = kwargs.get('unit', None) self.name = None self.metric_values = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_availability.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_availability.py index 4d84785ef0d3..3158a74ce99a 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_availability.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_availability.py @@ -35,7 +35,7 @@ class MetricAvailability(Model): 'retention': {'key': 'retention', 'type': 'str'}, } - def __init__(self): - super(MetricAvailability, self).__init__() + def __init__(self, **kwargs): + super(MetricAvailability, self).__init__(**kwargs) self.time_grain = None self.retention = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_availability_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_availability_py3.py new file mode 100644 index 000000000000..0da15e806cb7 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_availability_py3.py @@ -0,0 +1,41 @@ +# 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 MetricAvailability(Model): + """The availability of the metric. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar time_grain: The time grain to be used to summarize the metric + values. + :vartype time_grain: str + :ivar retention: The retention for the metric values. + :vartype retention: str + """ + + _validation = { + 'time_grain': {'readonly': True}, + 'retention': {'readonly': True}, + } + + _attribute_map = { + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'retention': {'key': 'retention', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(MetricAvailability, self).__init__(**kwargs) + self.time_grain = None + self.retention = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_definition.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_definition.py index 679ad46697a8..7cbbbe13aafb 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_definition.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_definition.py @@ -52,10 +52,10 @@ class MetricDefinition(Model): 'name': {'key': 'name', 'type': 'MetricName'}, } - def __init__(self, unit=None): - super(MetricDefinition, self).__init__() + def __init__(self, **kwargs): + super(MetricDefinition, self).__init__(**kwargs) self.metric_availabilities = None self.primary_aggregation_type = None - self.unit = unit + self.unit = kwargs.get('unit', None) self.resource_uri = None self.name = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_definition_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_definition_py3.py new file mode 100644 index 000000000000..23100a92f942 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_definition_py3.py @@ -0,0 +1,61 @@ +# 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 MetricDefinition(Model): + """The definition of a metric. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar metric_availabilities: The list of metric availabilities for the + account. + :vartype metric_availabilities: + list[~azure.mgmt.cosmosdb.models.MetricAvailability] + :ivar primary_aggregation_type: The primary aggregation type of the + metric. Possible values include: 'None', 'Average', 'Total', 'Minimimum', + 'Maximum', 'Last' + :vartype primary_aggregation_type: str or + ~azure.mgmt.cosmosdb.models.PrimaryAggregationType + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar resource_uri: The resource uri of the database. + :vartype resource_uri: str + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + """ + + _validation = { + 'metric_availabilities': {'readonly': True}, + 'primary_aggregation_type': {'readonly': True}, + 'resource_uri': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'metric_availabilities': {'key': 'metricAvailabilities', 'type': '[MetricAvailability]'}, + 'primary_aggregation_type': {'key': 'primaryAggregationType', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + } + + def __init__(self, *, unit=None, **kwargs) -> None: + super(MetricDefinition, self).__init__(**kwargs) + self.metric_availabilities = None + self.primary_aggregation_type = None + self.unit = unit + self.resource_uri = None + self.name = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_name.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_name.py index 67ef26714503..fd3e3d504c9d 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_name.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_name.py @@ -34,7 +34,7 @@ class MetricName(Model): 'localized_value': {'key': 'localizedValue', 'type': 'str'}, } - def __init__(self): - super(MetricName, self).__init__() + def __init__(self, **kwargs): + super(MetricName, self).__init__(**kwargs) self.value = None self.localized_value = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_name_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_name_py3.py new file mode 100644 index 000000000000..811d94729969 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_name_py3.py @@ -0,0 +1,40 @@ +# 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 MetricName(Model): + """A metric name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The name of the metric. + :vartype value: str + :ivar localized_value: The friendly name of the metric. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(MetricName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_py3.py new file mode 100644 index 000000000000..61f368c2e7a4 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_py3.py @@ -0,0 +1,63 @@ +# 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 Metric(Model): + """Metric data. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar start_time: The start time for the metric (ISO-8601 format). + :vartype start_time: datetime + :ivar end_time: The end time for the metric (ISO-8601 format). + :vartype end_time: datetime + :ivar time_grain: The time grain to be used to summarize the metric + values. + :vartype time_grain: str + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + :ivar metric_values: The metric values for the specified time window and + timestep. + :vartype metric_values: list[~azure.mgmt.cosmosdb.models.MetricValue] + """ + + _validation = { + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'time_grain': {'readonly': True}, + 'name': {'readonly': True}, + 'metric_values': {'readonly': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + 'metric_values': {'key': 'metricValues', 'type': '[MetricValue]'}, + } + + def __init__(self, *, unit=None, **kwargs) -> None: + super(Metric, self).__init__(**kwargs) + self.start_time = None + self.end_time = None + self.time_grain = None + self.unit = unit + self.name = None + self.metric_values = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_value.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_value.py index bed80f5ab4ed..ba9585752ce4 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_value.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_value.py @@ -50,8 +50,8 @@ class MetricValue(Model): 'total': {'key': 'total', 'type': 'float'}, } - def __init__(self): - super(MetricValue, self).__init__() + def __init__(self, **kwargs): + super(MetricValue, self).__init__(**kwargs) self._count = None self.average = None self.maximum = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_value_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_value_py3.py new file mode 100644 index 000000000000..bbe471459725 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_value_py3.py @@ -0,0 +1,60 @@ +# 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 MetricValue(Model): + """Represents metrics values. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar _count: The number of values for the metric. + :vartype _count: float + :ivar average: The average value of the metric. + :vartype average: float + :ivar maximum: The max value of the metric. + :vartype maximum: float + :ivar minimum: The min value of the metric. + :vartype minimum: float + :ivar timestamp: The metric timestamp (ISO-8601 format). + :vartype timestamp: datetime + :ivar total: The total value of the metric. + :vartype total: float + """ + + _validation = { + '_count': {'readonly': True}, + 'average': {'readonly': True}, + 'maximum': {'readonly': True}, + 'minimum': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'total': {'readonly': True}, + } + + _attribute_map = { + '_count': {'key': '_count', 'type': 'float'}, + 'average': {'key': 'average', 'type': 'float'}, + 'maximum': {'key': 'maximum', 'type': 'float'}, + 'minimum': {'key': 'minimum', 'type': 'float'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'total': {'key': 'total', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(MetricValue, self).__init__(**kwargs) + self._count = None + self.average = None + self.maximum = None + self.minimum = None + self.timestamp = None + self.total = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation.py index d4f1a1d7b4cd..e0445c09f516 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation.py @@ -26,7 +26,7 @@ class Operation(Model): 'display': {'key': 'display', 'type': 'OperationDisplay'}, } - def __init__(self, name=None, display=None): - super(Operation, self).__init__() - self.name = name - self.display = display + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_display.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_display.py index 39eab11883f3..3fc650540a64 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_display.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_display.py @@ -33,9 +33,9 @@ class OperationDisplay(Model): 'description': {'key': 'Description', 'type': 'str'}, } - def __init__(self, provider=None, resource=None, operation=None, description=None): - super(OperationDisplay, self).__init__() - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_display_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_display_py3.py new file mode 100644 index 000000000000..7a2edcb7cd56 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_display_py3.py @@ -0,0 +1,41 @@ +# 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 OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.ResourceProvider + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Description of operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'Provider', 'type': 'str'}, + 'resource': {'key': 'Resource', 'type': 'str'}, + 'operation': {'key': 'Operation', 'type': 'str'}, + 'description': {'key': 'Description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_py3.py new file mode 100644 index 000000000000..06e896c83984 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/operation_py3.py @@ -0,0 +1,32 @@ +# 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 Operation(Model): + """REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.cosmosdb.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_metric.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_metric.py index 351fceccb976..b00c2462067d 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_metric.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_metric.py @@ -63,7 +63,7 @@ class PartitionMetric(Metric): 'partition_key_range_id': {'key': 'partitionKeyRangeId', 'type': 'str'}, } - def __init__(self, unit=None): - super(PartitionMetric, self).__init__(unit=unit) + def __init__(self, **kwargs): + super(PartitionMetric, self).__init__(**kwargs) self.partition_id = None self.partition_key_range_id = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_metric_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_metric_py3.py new file mode 100644 index 000000000000..ef6c7b39306b --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_metric_py3.py @@ -0,0 +1,69 @@ +# 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 .metric import Metric + + +class PartitionMetric(Metric): + """The metric values for a single partition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar start_time: The start time for the metric (ISO-8601 format). + :vartype start_time: datetime + :ivar end_time: The end time for the metric (ISO-8601 format). + :vartype end_time: datetime + :ivar time_grain: The time grain to be used to summarize the metric + values. + :vartype time_grain: str + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + :ivar metric_values: The metric values for the specified time window and + timestep. + :vartype metric_values: list[~azure.mgmt.cosmosdb.models.MetricValue] + :ivar partition_id: The parition id (GUID identifier) of the metric + values. + :vartype partition_id: str + :ivar partition_key_range_id: The partition key range id (integer + identifier) of the metric values. + :vartype partition_key_range_id: str + """ + + _validation = { + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'time_grain': {'readonly': True}, + 'name': {'readonly': True}, + 'metric_values': {'readonly': True}, + 'partition_id': {'readonly': True}, + 'partition_key_range_id': {'readonly': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + 'metric_values': {'key': 'metricValues', 'type': '[MetricValue]'}, + 'partition_id': {'key': 'partitionId', 'type': 'str'}, + 'partition_key_range_id': {'key': 'partitionKeyRangeId', 'type': 'str'}, + } + + def __init__(self, *, unit=None, **kwargs) -> None: + super(PartitionMetric, self).__init__(unit=unit, **kwargs) + self.partition_id = None + self.partition_key_range_id = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_usage.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_usage.py index 638e0ba4e79f..e19c3f5d49ad 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_usage.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_usage.py @@ -56,7 +56,7 @@ class PartitionUsage(Usage): 'partition_key_range_id': {'key': 'partitionKeyRangeId', 'type': 'str'}, } - def __init__(self, unit=None): - super(PartitionUsage, self).__init__(unit=unit) + def __init__(self, **kwargs): + super(PartitionUsage, self).__init__(**kwargs) self.partition_id = None self.partition_key_range_id = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_usage_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_usage_py3.py new file mode 100644 index 000000000000..e0e9603a3113 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/partition_usage_py3.py @@ -0,0 +1,62 @@ +# 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 .usage import Usage + + +class PartitionUsage(Usage): + """The partition level usage data for a usage request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + :ivar quota_period: The quota period used to summarize the usage values. + :vartype quota_period: str + :ivar limit: Maximum value for this metric + :vartype limit: int + :ivar current_value: Current value for this metric + :vartype current_value: int + :ivar partition_id: The parition id (GUID identifier) of the usages. + :vartype partition_id: str + :ivar partition_key_range_id: The partition key range id (integer + identifier) of the usages. + :vartype partition_key_range_id: str + """ + + _validation = { + 'name': {'readonly': True}, + 'quota_period': {'readonly': True}, + 'limit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'partition_id': {'readonly': True}, + 'partition_key_range_id': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'partition_id': {'key': 'partitionId', 'type': 'str'}, + 'partition_key_range_id': {'key': 'partitionKeyRangeId', 'type': 'str'}, + } + + def __init__(self, *, unit=None, **kwargs) -> None: + super(PartitionUsage, self).__init__(unit=unit, **kwargs) + self.partition_id = None + self.partition_key_range_id = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric.py index 19159dceb9f6..183b1cedab90 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric.py @@ -54,11 +54,11 @@ class PercentileMetric(Model): 'metric_values': {'key': 'metricValues', 'type': '[PercentileMetricValue]'}, } - def __init__(self, unit=None): - super(PercentileMetric, self).__init__() + def __init__(self, **kwargs): + super(PercentileMetric, self).__init__(**kwargs) self.start_time = None self.end_time = None self.time_grain = None - self.unit = unit + self.unit = kwargs.get('unit', None) self.name = None self.metric_values = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_py3.py new file mode 100644 index 000000000000..665dad9c9a04 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_py3.py @@ -0,0 +1,64 @@ +# 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 PercentileMetric(Model): + """Percentile Metric data. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar start_time: The start time for the metric (ISO-8601 format). + :vartype start_time: datetime + :ivar end_time: The end time for the metric (ISO-8601 format). + :vartype end_time: datetime + :ivar time_grain: The time grain to be used to summarize the metric + values. + :vartype time_grain: str + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + :ivar metric_values: The percentile metric values for the specified time + window and timestep. + :vartype metric_values: + list[~azure.mgmt.cosmosdb.models.PercentileMetricValue] + """ + + _validation = { + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'time_grain': {'readonly': True}, + 'name': {'readonly': True}, + 'metric_values': {'readonly': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + 'metric_values': {'key': 'metricValues', 'type': '[PercentileMetricValue]'}, + } + + def __init__(self, *, unit=None, **kwargs) -> None: + super(PercentileMetric, self).__init__(**kwargs) + self.start_time = None + self.end_time = None + self.time_grain = None + self.unit = unit + self.name = None + self.metric_values = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_value.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_value.py index addcad664365..5e11e347b3c5 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_value.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_value.py @@ -78,8 +78,8 @@ class PercentileMetricValue(MetricValue): 'p99': {'key': 'P99', 'type': 'float'}, } - def __init__(self): - super(PercentileMetricValue, self).__init__() + def __init__(self, **kwargs): + super(PercentileMetricValue, self).__init__(**kwargs) self.p10 = None self.p25 = None self.p50 = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_value_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_value_py3.py new file mode 100644 index 000000000000..458757205785 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/percentile_metric_value_py3.py @@ -0,0 +1,89 @@ +# 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 .metric_value import MetricValue + + +class PercentileMetricValue(MetricValue): + """Represents percentile metrics values. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar _count: The number of values for the metric. + :vartype _count: float + :ivar average: The average value of the metric. + :vartype average: float + :ivar maximum: The max value of the metric. + :vartype maximum: float + :ivar minimum: The min value of the metric. + :vartype minimum: float + :ivar timestamp: The metric timestamp (ISO-8601 format). + :vartype timestamp: datetime + :ivar total: The total value of the metric. + :vartype total: float + :ivar p10: The 10th percentile value for the metric. + :vartype p10: float + :ivar p25: The 25th percentile value for the metric. + :vartype p25: float + :ivar p50: The 50th percentile value for the metric. + :vartype p50: float + :ivar p75: The 75th percentile value for the metric. + :vartype p75: float + :ivar p90: The 90th percentile value for the metric. + :vartype p90: float + :ivar p95: The 95th percentile value for the metric. + :vartype p95: float + :ivar p99: The 99th percentile value for the metric. + :vartype p99: float + """ + + _validation = { + '_count': {'readonly': True}, + 'average': {'readonly': True}, + 'maximum': {'readonly': True}, + 'minimum': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'total': {'readonly': True}, + 'p10': {'readonly': True}, + 'p25': {'readonly': True}, + 'p50': {'readonly': True}, + 'p75': {'readonly': True}, + 'p90': {'readonly': True}, + 'p95': {'readonly': True}, + 'p99': {'readonly': True}, + } + + _attribute_map = { + '_count': {'key': '_count', 'type': 'float'}, + 'average': {'key': 'average', 'type': 'float'}, + 'maximum': {'key': 'maximum', 'type': 'float'}, + 'minimum': {'key': 'minimum', 'type': 'float'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'total': {'key': 'total', 'type': 'float'}, + 'p10': {'key': 'P10', 'type': 'float'}, + 'p25': {'key': 'P25', 'type': 'float'}, + 'p50': {'key': 'P50', 'type': 'float'}, + 'p75': {'key': 'P75', 'type': 'float'}, + 'p90': {'key': 'P90', 'type': 'float'}, + 'p95': {'key': 'P95', 'type': 'float'}, + 'p99': {'key': 'P99', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(PercentileMetricValue, self).__init__(**kwargs) + self.p10 = None + self.p25 = None + self.p50 = None + self.p75 = None + self.p90 = None + self.p95 = None + self.p99 = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/resource.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/resource.py index bbf0e36a9f9c..2301bf320b7a 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/resource.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/resource.py @@ -18,14 +18,16 @@ class Resource(Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The unique resource identifier of the database account. :vartype id: str :ivar name: The name of the database account. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :param location: The location of the resource group to which the resource - belongs. + :param location: Required. The location of the resource group to which the + resource belongs. :type location: str :param tags: :type tags: dict[str, str] @@ -46,10 +48,10 @@ class Resource(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, location, tags=None): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None - self.location = location - self.tags = tags + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/resource_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/resource_py3.py new file mode 100644 index 000000000000..58f36e19ff13 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/resource_py3.py @@ -0,0 +1,57 @@ +# 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 Resource(Model): + """A database account resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The unique resource identifier of the database account. + :vartype id: str + :ivar name: The name of the database account. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :param location: Required. The location of the resource group to which the + resource belongs. + :type location: str + :param tags: + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + '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: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/usage.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/usage.py index bcbf384ccaa9..1564bd6ad3b8 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/usage.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/usage.py @@ -47,9 +47,9 @@ class Usage(Model): 'current_value': {'key': 'currentValue', 'type': 'int'}, } - def __init__(self, unit=None): - super(Usage, self).__init__() - self.unit = unit + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.unit = kwargs.get('unit', None) self.name = None self.quota_period = None self.limit = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/usage_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/usage_py3.py new file mode 100644 index 000000000000..287f0d9dc038 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/usage_py3.py @@ -0,0 +1,56 @@ +# 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 Usage(Model): + """The usage data for a usage request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cosmosdb.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cosmosdb.models.MetricName + :ivar quota_period: The quota period used to summarize the usage values. + :vartype quota_period: str + :ivar limit: Maximum value for this metric + :vartype limit: int + :ivar current_value: Current value for this metric + :vartype current_value: int + """ + + _validation = { + 'name': {'readonly': True}, + 'quota_period': {'readonly': True}, + 'limit': {'readonly': True}, + 'current_value': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + } + + def __init__(self, *, unit=None, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = unit + self.name = None + self.quota_period = None + self.limit = None + self.current_value = None diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/virtual_network_rule.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/virtual_network_rule.py new file mode 100644 index 000000000000..6ea87e5236a0 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/virtual_network_rule.py @@ -0,0 +1,29 @@ +# 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 VirtualNetworkRule(Model): + """Virtual Network ACL Rule object. + + :param id: Resource ID of a subnet, for example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/virtual_network_rule_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/virtual_network_rule_py3.py new file mode 100644 index 000000000000..707c8a3f615c --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/virtual_network_rule_py3.py @@ -0,0 +1,29 @@ +# 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 VirtualNetworkRule(Model): + """Virtual Network ACL Rule object. + + :param id: Resource ID of a subnet, for example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_operations.py index a64793279cc8..b5dc016df775 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_operations.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_operations.py @@ -22,7 +22,7 @@ class CollectionOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". """ @@ -69,7 +69,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics' + url = self.list_metrics.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -119,6 +119,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics'} def list_usages( self, resource_group_name, account_name, database_rid, collection_rid, filter=None, custom_headers=None, raw=False, **operation_config): @@ -151,7 +152,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages' + url = self.list_usages.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -202,6 +203,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages'} def list_metric_definitions( self, resource_group_name, account_name, database_rid, collection_rid, custom_headers=None, raw=False, **operation_config): @@ -229,7 +231,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions' + url = self.list_metric_definitions.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -278,3 +280,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_partition_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_partition_operations.py index 815fe0eff68f..7161a7d94b99 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_partition_operations.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_partition_operations.py @@ -22,7 +22,7 @@ class CollectionPartitionOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". """ @@ -69,7 +69,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics' + url = self.list_metrics.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -119,6 +119,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics'} def list_usages( self, resource_group_name, account_name, database_rid, collection_rid, filter=None, custom_headers=None, raw=False, **operation_config): @@ -151,7 +152,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages' + url = self.list_usages.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -202,3 +203,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_partition_region_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_partition_region_operations.py index 6bce96b3a9f7..6e0db4e6a432 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_partition_region_operations.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_partition_region_operations.py @@ -22,7 +22,7 @@ class CollectionPartitionRegionOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". """ @@ -72,7 +72,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics' + url = self.list_metrics.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -123,3 +123,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_region_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_region_operations.py index 05a6c104e856..de907ce6479b 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_region_operations.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_region_operations.py @@ -22,7 +22,7 @@ class CollectionRegionOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". """ @@ -72,7 +72,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics' + url = self.list_metrics.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -123,3 +123,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_account_region_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_account_region_operations.py index 1de4926d9145..787b0bae785b 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_account_region_operations.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_account_region_operations.py @@ -22,7 +22,7 @@ class DatabaseAccountRegionOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". """ @@ -68,7 +68,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/metrics' + url = self.list_metrics.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -117,3 +117,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/metrics'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_accounts_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_accounts_operations.py index bafe55578808..c6bfb6636de9 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_accounts_operations.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_accounts_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class DatabaseAccountsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". """ @@ -59,7 +59,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' + url = self.get.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -100,6 +100,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}'} def _patch_initial( @@ -107,7 +108,7 @@ def _patch_initial( update_parameters = models.DatabaseAccountPatchParameters(tags=tags, capabilities=capabilities) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' + url = self.patch.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -154,7 +155,7 @@ def _patch_initial( return deserialized def patch( - self, resource_group_name, account_name, tags=None, capabilities=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, account_name, tags=None, capabilities=None, custom_headers=None, raw=False, polling=True, **operation_config): """Patches the properties of an existing Azure Cosmos DB database account. :param resource_group_name: Name of an Azure resource group. @@ -166,13 +167,16 @@ def patch( :param capabilities: List of Cosmos DB capabilities for the account :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - DatabaseAccount or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DatabaseAccount or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.DatabaseAccount] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.DatabaseAccount]] :raises: :class:`CloudError` """ raw_result = self._patch_initial( @@ -184,30 +188,8 @@ def patch( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('DatabaseAccount', response) if raw: @@ -216,18 +198,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = 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) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}'} def _create_or_update_initial( self, resource_group_name, account_name, create_update_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' + url = self.create_or_update.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -274,7 +258,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, account_name, create_update_parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, account_name, create_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an Azure Cosmos DB database account. :param resource_group_name: Name of an Azure resource group. @@ -286,13 +270,16 @@ def create_or_update( :type create_update_parameters: ~azure.mgmt.cosmosdb.models.DatabaseAccountCreateUpdateParameters :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns - DatabaseAccount or ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DatabaseAccount or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.DatabaseAccount] - or ~msrest.pipeline.ClientRawResponse + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.DatabaseAccount]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -303,30 +290,8 @@ def create_or_update( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - deserialized = self._deserialize('DatabaseAccount', response) if raw: @@ -335,18 +300,20 @@ def get_long_running_output(response): return deserialized - long_running_operation_timeout = operation_config.get( + lro_delay = 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) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}'} def _delete_initial( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}' + url = self.delete.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -382,7 +349,7 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, account_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes an existing Azure Cosmos DB database account. :param resource_group_name: Name of an Azure resource group. @@ -390,12 +357,14 @@ def delete( :param account_name: Cosmos DB database account name. :type account_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 - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._delete_initial( @@ -405,40 +374,20 @@ def delete( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 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 - long_running_operation_timeout = operation_config.get( + lro_delay = 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) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}'} def _failover_priority_change_initial( @@ -446,7 +395,7 @@ def _failover_priority_change_initial( failover_parameters = models.FailoverPolicies(failover_policies=failover_policies) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange' + url = self.failover_priority_change.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -486,7 +435,7 @@ def _failover_priority_change_initial( return client_raw_response def failover_priority_change( - self, resource_group_name, account_name, failover_policies, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, account_name, failover_policies, custom_headers=None, raw=False, polling=True, **operation_config): """Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover @@ -501,12 +450,14 @@ def failover_priority_change( :type failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._failover_priority_change_initial( @@ -517,40 +468,20 @@ def failover_priority_change( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 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 - long_running_operation_timeout = operation_config.get( + lro_delay = 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) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + failover_priority_change.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -571,7 +502,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -616,6 +547,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -638,7 +570,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -684,6 +616,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts'} def list_keys( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -706,7 +639,7 @@ def list_keys( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys' + url = self.list_keys.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -747,6 +680,7 @@ def list_keys( return client_raw_response return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys'} def list_connection_strings( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -770,7 +704,7 @@ def list_connection_strings( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings' + url = self.list_connection_strings.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -811,6 +745,7 @@ def list_connection_strings( return client_raw_response return deserialized + list_connection_strings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings'} def list_read_only_keys( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -834,7 +769,7 @@ def list_read_only_keys( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys' + url = self.list_read_only_keys.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -875,6 +810,7 @@ def list_read_only_keys( return client_raw_response return deserialized + list_read_only_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys'} def _regenerate_key_initial( @@ -882,7 +818,7 @@ def _regenerate_key_initial( key_to_regenerate = models.DatabaseAccountRegenerateKeyParameters(key_kind=key_kind) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey' + url = self.regenerate_key.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -922,7 +858,7 @@ def _regenerate_key_initial( return client_raw_response def regenerate_key( - self, resource_group_name, account_name, key_kind, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, account_name, key_kind, custom_headers=None, raw=False, polling=True, **operation_config): """Regenerates an access key for the specified Azure Cosmos DB database account. @@ -935,12 +871,14 @@ def regenerate_key( 'secondaryReadonly' :type key_kind: str or ~azure.mgmt.cosmosdb.models.KeyKind :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._regenerate_key_initial( @@ -951,40 +889,20 @@ def regenerate_key( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [200, 202]: - 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 - long_running_operation_timeout = operation_config.get( + lro_delay = 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) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey'} def check_name_exists( self, account_name, custom_headers=None, raw=False, **operation_config): @@ -1004,7 +922,7 @@ def check_name_exists( :raises: :class:`CloudError` """ # Construct URL - url = '/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}' + url = self.check_name_exists.metadata['url'] path_format_arguments = { 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3) } @@ -1038,6 +956,7 @@ def check_name_exists( client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized + check_name_exists.metadata = {'url': '/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}'} def list_metrics( self, resource_group_name, account_name, filter, custom_headers=None, raw=False, **operation_config): @@ -1067,7 +986,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics' + url = self.list_metrics.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -1115,6 +1034,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics'} def list_usages( self, resource_group_name, account_name, filter=None, custom_headers=None, raw=False, **operation_config): @@ -1142,7 +1062,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages' + url = self.list_usages.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -1191,6 +1111,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages'} def list_metric_definitions( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -1214,7 +1135,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions' + url = self.list_metric_definitions.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -1261,3 +1182,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_operations.py index b57a601a6084..c9cb0713069b 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_operations.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_operations.py @@ -22,7 +22,7 @@ class DatabaseOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". """ @@ -67,7 +67,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics' + url = self.list_metrics.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -116,6 +116,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics'} def list_usages( self, resource_group_name, account_name, database_rid, filter=None, custom_headers=None, raw=False, **operation_config): @@ -145,7 +146,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages' + url = self.list_usages.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -195,6 +196,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages'} def list_metric_definitions( self, resource_group_name, account_name, database_rid, custom_headers=None, raw=False, **operation_config): @@ -220,7 +222,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions' + url = self.list_metric_definitions.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -268,3 +270,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/operations.py index 1613a8307b01..245c7d5749b6 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/operations.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.DocumentDB/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -96,3 +96,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.DocumentDB/operations'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/partition_key_range_id_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/partition_key_range_id_operations.py index eefab00df5fb..ae0f9366a7ba 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/partition_key_range_id_operations.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/partition_key_range_id_operations.py @@ -22,7 +22,7 @@ class PartitionKeyRangeIdOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". """ @@ -72,7 +72,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics' + url = self.list_metrics.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -123,3 +123,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/partition_key_range_id_region_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/partition_key_range_id_region_operations.py index 91bcbb89582a..d8299349f17a 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/partition_key_range_id_region_operations.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/partition_key_range_id_region_operations.py @@ -22,7 +22,7 @@ class PartitionKeyRangeIdRegionOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". """ @@ -75,7 +75,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics' + url = self.list_metrics.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -127,3 +127,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/percentile_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/percentile_operations.py index c2094ec265f9..adf7d5313b57 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/percentile_operations.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/percentile_operations.py @@ -22,7 +22,7 @@ class PercentileOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". """ @@ -66,7 +66,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics' + url = self.list_metrics.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -114,3 +114,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/percentile_source_target_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/percentile_source_target_operations.py index 0068faac888e..45c02b4bba49 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/percentile_source_target_operations.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/percentile_source_target_operations.py @@ -22,7 +22,7 @@ class PercentileSourceTargetOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". """ @@ -72,7 +72,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics' + url = self.list_metrics.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -122,3 +122,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/percentile_target_operations.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/percentile_target_operations.py index 8994b01575ab..06395707cc59 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/percentile_target_operations.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/percentile_target_operations.py @@ -22,7 +22,7 @@ class PercentileTargetOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Version of the API to be used with the client request. The current version is 2015-04-08. Constant value: "2015-04-08". """ @@ -69,7 +69,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics' + url = self.list_metrics.metadata['url'] 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', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -118,3 +118,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics'} diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/version.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/version.py index 54fdd938c10a..85da2c00c1a6 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/version.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.3.1" +VERSION = "0.4.0"