Skip to content

Commit

Permalink
[AutoRelease] t2-cosmosdb-2023-04-29-47469(can only be merged by SDK …
Browse files Browse the repository at this point in the history
…owner) (#30154)

* code and test

* Update CHANGELOG.md

* Update CHANGELOG.md

---------

Co-authored-by: PythonSdkPipelines <PythonSdkPipelines>
Co-authored-by: Yuchao Yan <[email protected]>
  • Loading branch information
azure-sdk and msyyc authored May 8, 2023
1 parent 708f13c commit bc89d9d
Show file tree
Hide file tree
Showing 245 changed files with 494 additions and 404 deletions.
13 changes: 13 additions & 0 deletions sdk/cosmos/azure-mgmt-cosmosdb/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Release History

## 9.2.0 (2023-05-08)

### Features Added

- Model ContinuousModeBackupPolicy has a new parameter continuous_mode_properties
- Model RestorableDatabaseAccountGetResult has a new parameter oldest_restorable_time
- Model ThroughputSettingsGetPropertiesResource has a new parameter instant_maximum_throughput
- Model ThroughputSettingsGetPropertiesResource has a new parameter soft_allowed_maximum_throughput
- Model ThroughputSettingsResource has a new parameter instant_maximum_throughput
- Model ThroughputSettingsResource has a new parameter soft_allowed_maximum_throughput
- Added new enum type `ContinuousTier`
- Enum `PublicNetworkAccess` has a new value `SECURED_BY_PERIMETER`

## 9.1.0 (2023-04-21)

### Features Added
Expand Down
2 changes: 1 addition & 1 deletion sdk/cosmos/azure-mgmt-cosmosdb/_meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"commit": "e716082ac474f182e2220e4f38f1d6191e7636cf",
"commit": "be4adb7c2681e82c81c25902bb5e4964229a79a2",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ class CosmosDBManagementClientConfiguration(Configuration): # pylint: disable=t
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-03-15". Note that overriding this
:keyword api_version: Api Version. Default value is "2023-04-15". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(CosmosDBManagementClientConfiguration, self).__init__(**kwargs)
api_version: str = kwargs.pop("api_version", "2023-03-15")
api_version: str = kwargs.pop("api_version", "2023-04-15")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class CosmosDBManagementClient: # pylint: disable=client-accepts-api-version-ke
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2023-03-15". Note that overriding this
:keyword api_version: Api Version. Default value is "2023-04-15". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "9.1.0"
VERSION = "9.2.0"
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ class CosmosDBManagementClientConfiguration(Configuration): # pylint: disable=t
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-03-15". Note that overriding this
:keyword api_version: Api Version. Default value is "2023-04-15". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(CosmosDBManagementClientConfiguration, self).__init__(**kwargs)
api_version: str = kwargs.pop("api_version", "2023-03-15")
api_version: str = kwargs.pop("api_version", "2023-04-15")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class CosmosDBManagementClient: # pylint: disable=client-accepts-api-version-ke
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2023-03-15". Note that overriding this
:keyword api_version: Api Version. Default value is "2023-04-15". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
from ._models_py3 import ContinuousBackupInformation
from ._models_py3 import ContinuousBackupRestoreLocation
from ._models_py3 import ContinuousModeBackupPolicy
from ._models_py3 import ContinuousModeProperties
from ._models_py3 import CorsPolicy
from ._models_py3 import CreateUpdateOptions
from ._models_py3 import DataCenterResource
Expand Down Expand Up @@ -282,6 +283,7 @@
from ._cosmos_db_management_client_enums import ConflictResolutionMode
from ._cosmos_db_management_client_enums import ConnectionState
from ._cosmos_db_management_client_enums import ConnectorOffer
from ._cosmos_db_management_client_enums import ContinuousTier
from ._cosmos_db_management_client_enums import CreateMode
from ._cosmos_db_management_client_enums import CreatedByType
from ._cosmos_db_management_client_enums import DataType
Expand Down Expand Up @@ -375,6 +377,7 @@
"ContinuousBackupInformation",
"ContinuousBackupRestoreLocation",
"ContinuousModeBackupPolicy",
"ContinuousModeProperties",
"CorsPolicy",
"CreateUpdateOptions",
"DataCenterResource",
Expand Down Expand Up @@ -596,6 +599,7 @@
"ConflictResolutionMode",
"ConnectionState",
"ConnectorOffer",
"ContinuousTier",
"CreateMode",
"CreatedByType",
"DataType",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ class ConnectorOffer(str, Enum, metaclass=CaseInsensitiveEnumMeta):
SMALL = "Small"


class ContinuousTier(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Enum to indicate type of Continuous backup tier."""

CONTINUOUS7_DAYS = "Continuous7Days"
CONTINUOUS30_DAYS = "Continuous30Days"


class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The type of identity that created the resource."""

Expand Down Expand Up @@ -273,6 +280,7 @@ class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta):

ENABLED = "Enabled"
DISABLED = "Disabled"
SECURED_BY_PERIMETER = "SecuredByPerimeter"


class ResourceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2643,6 +2643,8 @@ class ContinuousModeBackupPolicy(BackupPolicy):
:ivar migration_state: The object representing the state of the migration between the backup
policies.
:vartype migration_state: ~azure.mgmt.cosmosdb.models.BackupPolicyMigrationState
:ivar continuous_mode_properties: Configuration values for continuous mode backup.
:vartype continuous_mode_properties: ~azure.mgmt.cosmosdb.models.ContinuousModeProperties
"""

_validation = {
Expand All @@ -2652,18 +2654,48 @@ class ContinuousModeBackupPolicy(BackupPolicy):
_attribute_map = {
"type": {"key": "type", "type": "str"},
"migration_state": {"key": "migrationState", "type": "BackupPolicyMigrationState"},
"continuous_mode_properties": {"key": "continuousModeProperties", "type": "ContinuousModeProperties"},
}

def __init__(
self, *, migration_state: Optional["_models.BackupPolicyMigrationState"] = None, **kwargs: Any
self,
*,
migration_state: Optional["_models.BackupPolicyMigrationState"] = None,
continuous_mode_properties: Optional["_models.ContinuousModeProperties"] = None,
**kwargs: Any
) -> None:
"""
:keyword migration_state: The object representing the state of the migration between the backup
policies.
:paramtype migration_state: ~azure.mgmt.cosmosdb.models.BackupPolicyMigrationState
:keyword continuous_mode_properties: Configuration values for continuous mode backup.
:paramtype continuous_mode_properties: ~azure.mgmt.cosmosdb.models.ContinuousModeProperties
"""
super().__init__(migration_state=migration_state, **kwargs)
self.type: str = "Continuous"
self.continuous_mode_properties = continuous_mode_properties


class ContinuousModeProperties(_serialization.Model):
"""Configuration values for periodic mode backup.

:ivar tier: Enum to indicate type of Continuous backup mode. Known values are:
"Continuous7Days" and "Continuous30Days".
:vartype tier: str or ~azure.mgmt.cosmosdb.models.ContinuousTier
"""

_attribute_map = {
"tier": {"key": "tier", "type": "str"},
}

def __init__(self, *, tier: Optional[Union[str, "_models.ContinuousTier"]] = None, **kwargs: Any) -> None:
"""
:keyword tier: Enum to indicate type of Continuous backup mode. Known values are:
"Continuous7Days" and "Continuous30Days".
:paramtype tier: str or ~azure.mgmt.cosmosdb.models.ContinuousTier
"""
super().__init__(**kwargs)
self.tier = tier


class CorsPolicy(_serialization.Model):
Expand Down Expand Up @@ -2877,7 +2909,7 @@ class DatabaseAccountCreateUpdateParameters(ARMResourceProperties): # pylint: d
"FirstPartyIdentity", "SystemAssignedIdentity" and more.
:vartype default_identity: str
:ivar public_network_access: Whether requests from Public Network are allowed. Known values
are: "Enabled" and "Disabled".
are: "Enabled", "Disabled", and "SecuredByPerimeter".
:vartype public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess
:ivar enable_free_tier: Flag to indicate whether Free Tier is enabled.
:vartype enable_free_tier: bool
Expand Down Expand Up @@ -3069,7 +3101,7 @@ def __init__( # pylint: disable=too-many-locals
"FirstPartyIdentity", "SystemAssignedIdentity" and more.
:paramtype default_identity: str
:keyword public_network_access: Whether requests from Public Network are allowed. Known values
are: "Enabled" and "Disabled".
are: "Enabled", "Disabled", and "SecuredByPerimeter".
:paramtype public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess
:keyword enable_free_tier: Flag to indicate whether Free Tier is enabled.
:paramtype enable_free_tier: bool
Expand Down Expand Up @@ -3231,7 +3263,7 @@ class DatabaseAccountGetResults(ARMResourceProperties): # pylint: disable=too-m
"FirstPartyIdentity", "SystemAssignedIdentity" and more.
:vartype default_identity: str
:ivar public_network_access: Whether requests from Public Network are allowed. Known values
are: "Enabled" and "Disabled".
are: "Enabled", "Disabled", and "SecuredByPerimeter".
:vartype public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess
:ivar enable_free_tier: Flag to indicate whether Free Tier is enabled.
:vartype enable_free_tier: bool
Expand Down Expand Up @@ -3437,7 +3469,7 @@ def __init__( # pylint: disable=too-many-locals
"FirstPartyIdentity", "SystemAssignedIdentity" and more.
:paramtype default_identity: str
:keyword public_network_access: Whether requests from Public Network are allowed. Known values
are: "Enabled" and "Disabled".
are: "Enabled", "Disabled", and "SecuredByPerimeter".
:paramtype public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess
:keyword enable_free_tier: Flag to indicate whether Free Tier is enabled.
:paramtype enable_free_tier: bool
Expand Down Expand Up @@ -3755,7 +3787,7 @@ class DatabaseAccountUpdateParameters(_serialization.Model): # pylint: disable=
"FirstPartyIdentity", "SystemAssignedIdentity" and more.
:vartype default_identity: str
:ivar public_network_access: Whether requests from Public Network are allowed. Known values
are: "Enabled" and "Disabled".
are: "Enabled", "Disabled", and "SecuredByPerimeter".
:vartype public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess
:ivar enable_free_tier: Flag to indicate whether Free Tier is enabled.
:vartype enable_free_tier: bool
Expand Down Expand Up @@ -3921,7 +3953,7 @@ def __init__( # pylint: disable=too-many-locals
"FirstPartyIdentity", "SystemAssignedIdentity" and more.
:paramtype default_identity: str
:keyword public_network_access: Whether requests from Public Network are allowed. Known values
are: "Enabled" and "Disabled".
are: "Enabled", "Disabled", and "SecuredByPerimeter".
:paramtype public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess
:keyword enable_free_tier: Flag to indicate whether Free Tier is enabled.
:paramtype enable_free_tier: bool
Expand Down Expand Up @@ -8481,6 +8513,9 @@ class RestorableDatabaseAccountGetResult(_serialization.Model):
:ivar deletion_time: The time at which the restorable database account has been deleted
(ISO-8601 format).
:vartype deletion_time: ~datetime.datetime
:ivar oldest_restorable_time: The least recent time at which the database account can be
restored to (ISO-8601 format).
:vartype oldest_restorable_time: ~datetime.datetime
:ivar api_type: The API type of the restorable database account. Known values are: "MongoDB",
"Gremlin", "Cassandra", "Table", "Sql", and "GremlinV2".
:vartype api_type: str or ~azure.mgmt.cosmosdb.models.ApiType
Expand All @@ -8505,6 +8540,7 @@ class RestorableDatabaseAccountGetResult(_serialization.Model):
"account_name": {"key": "properties.accountName", "type": "str"},
"creation_time": {"key": "properties.creationTime", "type": "iso-8601"},
"deletion_time": {"key": "properties.deletionTime", "type": "iso-8601"},
"oldest_restorable_time": {"key": "properties.oldestRestorableTime", "type": "iso-8601"},
"api_type": {"key": "properties.apiType", "type": "str"},
"restorable_locations": {"key": "properties.restorableLocations", "type": "[RestorableLocationResource]"},
}
Expand All @@ -8516,6 +8552,7 @@ def __init__(
account_name: Optional[str] = None,
creation_time: Optional[datetime.datetime] = None,
deletion_time: Optional[datetime.datetime] = None,
oldest_restorable_time: Optional[datetime.datetime] = None,
**kwargs: Any
) -> None:
"""
Expand All @@ -8528,6 +8565,9 @@ def __init__(
:keyword deletion_time: The time at which the restorable database account has been deleted
(ISO-8601 format).
:paramtype deletion_time: ~datetime.datetime
:keyword oldest_restorable_time: The least recent time at which the database account can be
restored to (ISO-8601 format).
:paramtype oldest_restorable_time: ~datetime.datetime
"""
super().__init__(**kwargs)
self.id = None
Expand All @@ -8537,6 +8577,7 @@ def __init__(
self.account_name = account_name
self.creation_time = creation_time
self.deletion_time = deletion_time
self.oldest_restorable_time = oldest_restorable_time
self.api_type = None
self.restorable_locations = None

Expand Down Expand Up @@ -12395,18 +12436,28 @@ class ThroughputSettingsResource(_serialization.Model):
:vartype minimum_throughput: str
:ivar offer_replace_pending: The throughput replace is pending.
:vartype offer_replace_pending: str
:ivar instant_maximum_throughput: The offer throughput value to instantly scale up without
triggering splits.
:vartype instant_maximum_throughput: str
:ivar soft_allowed_maximum_throughput: The maximum throughput value or the maximum
maxThroughput value (for autoscale) that can be specified.
:vartype soft_allowed_maximum_throughput: str
"""

_validation = {
"minimum_throughput": {"readonly": True},
"offer_replace_pending": {"readonly": True},
"instant_maximum_throughput": {"readonly": True},
"soft_allowed_maximum_throughput": {"readonly": True},
}

_attribute_map = {
"throughput": {"key": "throughput", "type": "int"},
"autoscale_settings": {"key": "autoscaleSettings", "type": "AutoscaleSettingsResource"},
"minimum_throughput": {"key": "minimumThroughput", "type": "str"},
"offer_replace_pending": {"key": "offerReplacePending", "type": "str"},
"instant_maximum_throughput": {"key": "instantMaximumThroughput", "type": "str"},
"soft_allowed_maximum_throughput": {"key": "softAllowedMaximumThroughput", "type": "str"},
}

def __init__(
Expand All @@ -12429,6 +12480,8 @@ def __init__(
self.autoscale_settings = autoscale_settings
self.minimum_throughput = None
self.offer_replace_pending = None
self.instant_maximum_throughput = None
self.soft_allowed_maximum_throughput = None


class ThroughputSettingsGetPropertiesResource(ThroughputSettingsResource, ExtendedResourceProperties):
Expand All @@ -12453,6 +12506,12 @@ class ThroughputSettingsGetPropertiesResource(ThroughputSettingsResource, Extend
:vartype minimum_throughput: str
:ivar offer_replace_pending: The throughput replace is pending.
:vartype offer_replace_pending: str
:ivar instant_maximum_throughput: The offer throughput value to instantly scale up without
triggering splits.
:vartype instant_maximum_throughput: str
:ivar soft_allowed_maximum_throughput: The maximum throughput value or the maximum
maxThroughput value (for autoscale) that can be specified.
:vartype soft_allowed_maximum_throughput: str
"""

_validation = {
Expand All @@ -12461,6 +12520,8 @@ class ThroughputSettingsGetPropertiesResource(ThroughputSettingsResource, Extend
"etag": {"readonly": True},
"minimum_throughput": {"readonly": True},
"offer_replace_pending": {"readonly": True},
"instant_maximum_throughput": {"readonly": True},
"soft_allowed_maximum_throughput": {"readonly": True},
}

_attribute_map = {
Expand All @@ -12471,6 +12532,8 @@ class ThroughputSettingsGetPropertiesResource(ThroughputSettingsResource, Extend
"autoscale_settings": {"key": "autoscaleSettings", "type": "AutoscaleSettingsResource"},
"minimum_throughput": {"key": "minimumThroughput", "type": "str"},
"offer_replace_pending": {"key": "offerReplacePending", "type": "str"},
"instant_maximum_throughput": {"key": "instantMaximumThroughput", "type": "str"},
"soft_allowed_maximum_throughput": {"key": "softAllowedMaximumThroughput", "type": "str"},
}

def __init__(
Expand All @@ -12496,6 +12559,8 @@ def __init__(
self.autoscale_settings = autoscale_settings
self.minimum_throughput = None
self.offer_replace_pending = None
self.instant_maximum_throughput = None
self.soft_allowed_maximum_throughput = None


class ThroughputSettingsGetResults(ARMResourceProperties):
Expand Down
Loading

0 comments on commit bc89d9d

Please sign in to comment.