Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ class CosmosDBManagementClientConfiguration(AzureConfiguration):
"""

def __init__(
self, credentials, subscription_id, base_url=None):
self, credentials, subscription_id, subscription_id1, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if subscription_id1 is None:
raise ValueError("Parameter 'subscription_id1' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

Expand All @@ -48,3 +50,4 @@ def __init__(

self.credentials = credentials
self.subscription_id = subscription_id
self.subscription_id1 = subscription_id1
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,15 @@ class CosmosDBManagementClient(SDKClient):
object<msrestazure.azure_active_directory>`
:param subscription_id: Azure subscription ID.
:type subscription_id: str
:param subscription_id1: The ID of the target subscription.
:type subscription_id1: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):
self, credentials, subscription_id, subscription_id1, base_url=None):

self.config = CosmosDBManagementClientConfiguration(credentials, subscription_id, base_url)
self.config = CosmosDBManagementClientConfiguration(credentials, subscription_id, subscription_id1, base_url)
super(CosmosDBManagementClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
try:
from ._models_py3 import ARMProxyResource
from ._models_py3 import ARMResourceProperties
from ._models_py3 import AutopilotSettingsResource
from ._models_py3 import AutoUpgradePolicyResource
from ._models_py3 import AzureEntityResource
from ._models_py3 import Capability
Expand Down Expand Up @@ -84,6 +83,7 @@
from ._models_py3 import PrivateEndpointProperty
from ._models_py3 import PrivateLinkResource
from ._models_py3 import PrivateLinkServiceConnectionStateProperty
from ._models_py3 import ProvisionedThroughputSettingsResource
from ._models_py3 import ProxyResource
from ._models_py3 import RegionForOnlineOffline
from ._models_py3 import Resource
Expand Down Expand Up @@ -125,7 +125,6 @@
except (SyntaxError, ImportError):
from ._models import ARMProxyResource
from ._models import ARMResourceProperties
from ._models import AutopilotSettingsResource
from ._models import AutoUpgradePolicyResource
from ._models import AzureEntityResource
from ._models import Capability
Expand Down Expand Up @@ -197,6 +196,7 @@
from ._models import PrivateEndpointProperty
from ._models import PrivateLinkResource
from ._models import PrivateLinkServiceConnectionStateProperty
from ._models import ProvisionedThroughputSettingsResource
from ._models import ProxyResource
from ._models import RegionForOnlineOffline
from ._models import Resource
Expand Down Expand Up @@ -279,7 +279,6 @@
__all__ = [
'ARMProxyResource',
'ARMResourceProperties',
'AutopilotSettingsResource',
'AutoUpgradePolicyResource',
'AzureEntityResource',
'Capability',
Expand Down Expand Up @@ -351,6 +350,7 @@
'PrivateEndpointProperty',
'PrivateLinkResource',
'PrivateLinkServiceConnectionStateProperty',
'ProvisionedThroughputSettingsResource',
'ProxyResource',
'RegionForOnlineOffline',
'Resource',
Expand Down
110 changes: 56 additions & 54 deletions sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,43 +89,6 @@ def __init__(self, **kwargs):
self.tags = kwargs.get('tags', None)


class AutopilotSettingsResource(Model):
"""Cosmos DB autopilot settings object.

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.

:param max_throughput: Required. Represents max throughput an autopilot
container can operate at.
:type max_throughput: int
:param auto_upgrade_policy: Cosmos DB resource auto-upgrade policy
:type auto_upgrade_policy:
~azure.mgmt.cosmosdb.models.AutoUpgradePolicyResource
:ivar target_max_throughput: Represents target max throughput an autopilot
container should operate at once offer is no longer in pending state.
:vartype target_max_throughput: int
"""

_validation = {
'max_throughput': {'required': True},
'target_max_throughput': {'readonly': True},
}

_attribute_map = {
'max_throughput': {'key': 'maxThroughput', 'type': 'int'},
'auto_upgrade_policy': {'key': 'autoUpgradePolicy', 'type': 'AutoUpgradePolicyResource'},
'target_max_throughput': {'key': 'targetMaxThroughput', 'type': 'int'},
}

def __init__(self, **kwargs):
super(AutopilotSettingsResource, self).__init__(**kwargs)
self.max_throughput = kwargs.get('max_throughput', None)
self.auto_upgrade_policy = kwargs.get('auto_upgrade_policy', None)
self.target_max_throughput = None


class AutoUpgradePolicyResource(Model):
"""Cosmos DB resource auto-upgrade policy.

Expand Down Expand Up @@ -3015,6 +2978,43 @@ def __init__(self, **kwargs):
self.actions_required = None


class ProvisionedThroughputSettingsResource(Model):
"""Cosmos DB provisioned throughput settings object.

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.

:param max_throughput: Required. Represents maximum throughput container
can scale up to.
:type max_throughput: int
:param auto_upgrade_policy: Cosmos DB resource auto-upgrade policy
:type auto_upgrade_policy:
~azure.mgmt.cosmosdb.models.AutoUpgradePolicyResource
:ivar target_max_throughput: Represents target maximum throughput
container can scale up to once offer is no longer in pending state.
:vartype target_max_throughput: int
"""

_validation = {
'max_throughput': {'required': True},
'target_max_throughput': {'readonly': True},
}

_attribute_map = {
'max_throughput': {'key': 'maxThroughput', 'type': 'int'},
'auto_upgrade_policy': {'key': 'autoUpgradePolicy', 'type': 'AutoUpgradePolicyResource'},
'target_max_throughput': {'key': 'targetMaxThroughput', 'type': 'int'},
}

def __init__(self, **kwargs):
super(ProvisionedThroughputSettingsResource, self).__init__(**kwargs)
self.max_throughput = kwargs.get('max_throughput', None)
self.auto_upgrade_policy = kwargs.get('auto_upgrade_policy', None)
self.target_max_throughput = None


class RegionForOnlineOffline(Model):
"""Cosmos DB region to online or offline.

Expand Down Expand Up @@ -4134,13 +4134,14 @@ class ThroughputSettingsGetPropertiesResource(Model):
sending a request.

:param throughput: Value of the Cosmos DB resource throughput. Either
throughput is required or autopilotSettings is required, but not both.
throughput is required or provisionedThroughputSettings is required, but
not both.
:type throughput: int
:param autopilot_settings: Cosmos DB resource for Autopilot settings.
Either throughput is required or autopilotSettings is required, but not
both.
:type autopilot_settings:
~azure.mgmt.cosmosdb.models.AutopilotSettingsResource
:param provisioned_throughput_settings: Cosmos DB resource for provisioned
throughput settings. Either throughput is required or
provisionedThroughputSettings is required, but not both.
:type provisioned_throughput_settings:
~azure.mgmt.cosmosdb.models.ProvisionedThroughputSettingsResource
:ivar minimum_throughput: The minimum throughput of the resource
:vartype minimum_throughput: str
:ivar offer_replace_pending: The throughput replace is pending
Expand All @@ -4165,7 +4166,7 @@ class ThroughputSettingsGetPropertiesResource(Model):

_attribute_map = {
'throughput': {'key': 'throughput', 'type': 'int'},
'autopilot_settings': {'key': 'autopilotSettings', 'type': 'AutopilotSettingsResource'},
'provisioned_throughput_settings': {'key': 'provisionedThroughputSettings', 'type': 'ProvisionedThroughputSettingsResource'},
'minimum_throughput': {'key': 'minimumThroughput', 'type': 'str'},
'offer_replace_pending': {'key': 'offerReplacePending', 'type': 'str'},
'_rid': {'key': '_rid', 'type': 'str'},
Expand All @@ -4176,7 +4177,7 @@ class ThroughputSettingsGetPropertiesResource(Model):
def __init__(self, **kwargs):
super(ThroughputSettingsGetPropertiesResource, self).__init__(**kwargs)
self.throughput = kwargs.get('throughput', None)
self.autopilot_settings = kwargs.get('autopilot_settings', None)
self.provisioned_throughput_settings = kwargs.get('provisioned_throughput_settings', None)
self.minimum_throughput = None
self.offer_replace_pending = None
self._rid = None
Expand Down Expand Up @@ -4228,19 +4229,20 @@ def __init__(self, **kwargs):

class ThroughputSettingsResource(Model):
"""Cosmos DB resource throughput object. Either throughput is required or
autopilotSettings is required, but not both.
provisionedThroughputSettings is required, but not both.

Variables are only populated by the server, and will be ignored when
sending a request.

:param throughput: Value of the Cosmos DB resource throughput. Either
throughput is required or autopilotSettings is required, but not both.
throughput is required or provisionedThroughputSettings is required, but
not both.
:type throughput: int
:param autopilot_settings: Cosmos DB resource for Autopilot settings.
Either throughput is required or autopilotSettings is required, but not
both.
:type autopilot_settings:
~azure.mgmt.cosmosdb.models.AutopilotSettingsResource
:param provisioned_throughput_settings: Cosmos DB resource for provisioned
throughput settings. Either throughput is required or
provisionedThroughputSettings is required, but not both.
:type provisioned_throughput_settings:
~azure.mgmt.cosmosdb.models.ProvisionedThroughputSettingsResource
:ivar minimum_throughput: The minimum throughput of the resource
:vartype minimum_throughput: str
:ivar offer_replace_pending: The throughput replace is pending
Expand All @@ -4254,15 +4256,15 @@ class ThroughputSettingsResource(Model):

_attribute_map = {
'throughput': {'key': 'throughput', 'type': 'int'},
'autopilot_settings': {'key': 'autopilotSettings', 'type': 'AutopilotSettingsResource'},
'provisioned_throughput_settings': {'key': 'provisionedThroughputSettings', 'type': 'ProvisionedThroughputSettingsResource'},
'minimum_throughput': {'key': 'minimumThroughput', 'type': 'str'},
'offer_replace_pending': {'key': 'offerReplacePending', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ThroughputSettingsResource, self).__init__(**kwargs)
self.throughput = kwargs.get('throughput', None)
self.autopilot_settings = kwargs.get('autopilot_settings', None)
self.provisioned_throughput_settings = kwargs.get('provisioned_throughput_settings', None)
self.minimum_throughput = None
self.offer_replace_pending = None

Expand Down
Loading