diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/CHANGELOG.md b/sdk/cosmos/azure-mgmt-cosmosdb/CHANGELOG.md index 41f5a326b8a0..1ac2b113f518 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/CHANGELOG.md +++ b/sdk/cosmos/azure-mgmt-cosmosdb/CHANGELOG.md @@ -1,5 +1,19 @@ # Release History +## 10.0.0b6 (2025-04-02) + +### Features Added + + - Model `DataTransferJobGetResults` added property `source_and_destination_containers` + - Model `DataTransferJobProperties` added property `source_and_destination_containers` + - Added model `AzureBlobStorageContainerEntity` + - Added model `ContainerEntity` + - Added model `CosmosCassandraContainerEntity` + - Added model `CosmosMongoContainerEntity` + - Added model `CosmosMongoVCoreContainerEntity` + - Added model `CosmosSqlContainerEntity` + - Added model `DataTransferContainerDetails` + ## 10.0.0b5 (2024-12-23) ### Features Added diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/README.md b/sdk/cosmos/azure-mgmt-cosmosdb/README.md index d5ea6e879b60..235419d949ba 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/README.md +++ b/sdk/cosmos/azure-mgmt-cosmosdb/README.md @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables. +By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json b/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json index 334ec5daeaa6..368a2febce74 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json +++ b/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json @@ -1,11 +1,11 @@ { - "commit": "4aad50a36767f7c36673f2c7982bb4055dbf5ed4", + "commit": "9e7a46fda6029da703131c0607d9a1f3498700b8", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.10.2", "use": [ - "@autorest/python@6.26.4", + "@autorest/python@6.27.4", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/cosmos-db/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.26.4 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", + "autorest_command": "autorest specification/cosmos-db/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.27.4 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", "readme": "specification/cosmos-db/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_serialization.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_serialization.py index ce17d1798ce7..b24ab2885450 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_serialization.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_serialization.py @@ -310,7 +310,7 @@ def _create_xml_node(tag, prefix=None, ns=None): return ET.Element(tag) -class Model(object): +class Model: """Mixin for all client request body/response body models to support serialization and deserialization. """ @@ -563,7 +563,7 @@ def _decode_attribute_map_key(key): return key.replace("\\.", ".") -class Serializer(object): # pylint: disable=too-many-public-methods +class Serializer: # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -1441,7 +1441,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument return children[0] -class Deserializer(object): +class Deserializer: """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. @@ -1683,17 +1683,21 @@ def _instantiate_model(self, response, attrs, additional_properties=None): subtype = getattr(response, "_subtype_map", {}) try: readonly = [ - k for k, v in response._validation.items() if v.get("readonly") # pylint: disable=protected-access + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") ] const = [ - k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") ] kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} response_obj = response(**kwargs) for attr in readonly: setattr(response_obj, attr, attrs.get(attr)) if additional_properties: - response_obj.additional_properties = additional_properties + response_obj.additional_properties = additional_properties # type: ignore return response_obj except TypeError as err: msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_version.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_version.py index 369c45b5ae2e..5acb87b765a9 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_version.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "10.0.0b5" +VERSION = "10.0.0b6" diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py index 9458f8878acd..c80a3334fdce 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py @@ -27,6 +27,7 @@ AutoscaleSettings, AutoscaleSettingsResource, AzureBlobDataTransferDataSourceSink, + AzureBlobStorageContainerEntity, BackupInformation, BackupPolicy, BackupPolicyMigrationState, @@ -83,20 +84,26 @@ ConflictResolutionPolicy, ConnectionError, ConsistencyPolicy, + ContainerEntity, ContainerPartitionKey, ContinuousBackupInformation, ContinuousBackupRestoreLocation, ContinuousModeBackupPolicy, ContinuousModeProperties, CorsPolicy, + CosmosCassandraContainerEntity, CosmosCassandraDataTransferDataSourceSink, + CosmosMongoContainerEntity, CosmosMongoDataTransferDataSourceSink, + CosmosMongoVCoreContainerEntity, CosmosMongoVCoreDataTransferDataSourceSink, + CosmosSqlContainerEntity, CosmosSqlDataTransferDataSourceSink, CreateJobRequest, CreateUpdateOptions, DataCenterResource, DataCenterResourceProperties, + DataTransferContainerDetails, DataTransferDataSourceSink, DataTransferJobFeedResults, DataTransferJobGetResults, @@ -454,6 +461,7 @@ "AutoscaleSettings", "AutoscaleSettingsResource", "AzureBlobDataTransferDataSourceSink", + "AzureBlobStorageContainerEntity", "BackupInformation", "BackupPolicy", "BackupPolicyMigrationState", @@ -510,20 +518,26 @@ "ConflictResolutionPolicy", "ConnectionError", "ConsistencyPolicy", + "ContainerEntity", "ContainerPartitionKey", "ContinuousBackupInformation", "ContinuousBackupRestoreLocation", "ContinuousModeBackupPolicy", "ContinuousModeProperties", "CorsPolicy", + "CosmosCassandraContainerEntity", "CosmosCassandraDataTransferDataSourceSink", + "CosmosMongoContainerEntity", "CosmosMongoDataTransferDataSourceSink", + "CosmosMongoVCoreContainerEntity", "CosmosMongoVCoreDataTransferDataSourceSink", + "CosmosSqlContainerEntity", "CosmosSqlDataTransferDataSourceSink", "CreateJobRequest", "CreateUpdateOptions", "DataCenterResource", "DataCenterResourceProperties", + "DataTransferContainerDetails", "DataTransferDataSourceSink", "DataTransferJobFeedResults", "DataTransferJobGetResults", diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py index 5cd554b3e43d..ec55d11a7e50 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py @@ -498,8 +498,8 @@ class DataTransferDataSourceSink(_serialization.Model): All required parameters must be populated in order to send to server. - :ivar component: Known values are: "CosmosDBCassandra", "CosmosDBMongo", "CosmosDBMongoVCore", - "CosmosDBSql", and "AzureBlobStorage". + :ivar component: Required. Known values are: "CosmosDBCassandra", "CosmosDBMongo", + "CosmosDBMongoVCore", "CosmosDBSql", and "AzureBlobStorage". :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent """ @@ -530,10 +530,10 @@ class AzureBlobDataTransferDataSourceSink(DataTransferDataSourceSink): All required parameters must be populated in order to send to server. - :ivar component: Known values are: "CosmosDBCassandra", "CosmosDBMongo", "CosmosDBMongoVCore", - "CosmosDBSql", and "AzureBlobStorage". + :ivar component: Required. Known values are: "CosmosDBCassandra", "CosmosDBMongo", + "CosmosDBMongoVCore", "CosmosDBSql", and "AzureBlobStorage". :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent - :ivar container_name: Required. + :ivar container_name: :vartype container_name: str :ivar endpoint_url: :vartype endpoint_url: str @@ -541,7 +541,6 @@ class AzureBlobDataTransferDataSourceSink(DataTransferDataSourceSink): _validation = { "component": {"required": True}, - "container_name": {"required": True}, } _attribute_map = { @@ -550,9 +549,11 @@ class AzureBlobDataTransferDataSourceSink(DataTransferDataSourceSink): "endpoint_url": {"key": "endpointUrl", "type": "str"}, } - def __init__(self, *, container_name: str, endpoint_url: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, *, container_name: Optional[str] = None, endpoint_url: Optional[str] = None, **kwargs: Any + ) -> None: """ - :keyword container_name: Required. + :keyword container_name: :paramtype container_name: str :keyword endpoint_url: :paramtype endpoint_url: str @@ -563,6 +564,75 @@ def __init__(self, *, container_name: str, endpoint_url: Optional[str] = None, * self.endpoint_url = endpoint_url +class ContainerEntity(_serialization.Model): + """ContainerEntity. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AzureBlobStorageContainerEntity, CosmosCassandraContainerEntity, + CosmosMongoVCoreContainerEntity, CosmosSqlContainerEntity + + All required parameters must be populated in order to send to server. + + :ivar component: Required. Known values are: "CosmosDBCassandra", "CosmosDBMongo", + "CosmosDBMongoVCore", "CosmosDBSql", and "AzureBlobStorage". + :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent + """ + + _validation = { + "component": {"required": True}, + } + + _attribute_map = { + "component": {"key": "component", "type": "str"}, + } + + _subtype_map = { + "component": { + "AzureBlobStorage": "AzureBlobStorageContainerEntity", + "CosmosDBCassandra": "CosmosCassandraContainerEntity", + "CosmosDBMongo": "CosmosMongoVCoreContainerEntity", + "CosmosDBSql": "CosmosSqlContainerEntity", + } + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.component: Optional[str] = None + + +class AzureBlobStorageContainerEntity(ContainerEntity): + """A CosmosDB Mongo container entity. + + All required parameters must be populated in order to send to server. + + :ivar component: Required. Known values are: "CosmosDBCassandra", "CosmosDBMongo", + "CosmosDBMongoVCore", "CosmosDBSql", and "AzureBlobStorage". + :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent + :ivar container_name: Required. + :vartype container_name: str + """ + + _validation = { + "component": {"required": True}, + "container_name": {"required": True}, + } + + _attribute_map = { + "component": {"key": "component", "type": "str"}, + "container_name": {"key": "containerName", "type": "str"}, + } + + def __init__(self, *, container_name: str, **kwargs: Any) -> None: + """ + :keyword container_name: Required. + :paramtype container_name: str + """ + super().__init__(**kwargs) + self.component: str = "AzureBlobStorage" + self.container_name = container_name + + class BackupInformation(_serialization.Model): """Backup information of a resource. @@ -774,8 +844,8 @@ class BaseCosmosDataTransferDataSourceSink(DataTransferDataSourceSink): All required parameters must be populated in order to send to server. - :ivar component: Known values are: "CosmosDBCassandra", "CosmosDBMongo", "CosmosDBMongoVCore", - "CosmosDBSql", and "AzureBlobStorage". + :ivar component: Required. Known values are: "CosmosDBCassandra", "CosmosDBMongo", + "CosmosDBMongoVCore", "CosmosDBSql", and "AzureBlobStorage". :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent :ivar remote_account_name: :vartype remote_account_name: str @@ -2901,9 +2971,9 @@ class ClusterResourceProperties(_serialization.Model): :ivar delegated_management_subnet_id: Resource id of a subnet that this cluster's management service should have its network interface attached to. The subnet must be routable to all subnets that will be delegated to data centers. The resource id must be of the form - '/subscriptions/:code:``/resourceGroups/:code:``/providers/Microsoft.Network/virtualNetworks/:code:``/subnets/:code:``'. + '/subscriptions/\\ :code:``/resourceGroups/\\ :code:``/providers/Microsoft.Network/virtualNetworks/\\ :code:``/subnets/\\ + :code:``'. :vartype delegated_management_subnet_id: str :ivar cassandra_version: Which version of Cassandra should this cluster converge to running (e.g., 3.11). When updated, the cluster may take some time to migrate to the new version. @@ -3055,9 +3125,9 @@ def __init__( # pylint: disable=too-many-locals :keyword delegated_management_subnet_id: Resource id of a subnet that this cluster's management service should have its network interface attached to. The subnet must be routable to all subnets that will be delegated to data centers. The resource id must be of the form - '/subscriptions/:code:``/resourceGroups/:code:``/providers/Microsoft.Network/virtualNetworks/:code:``/subnets/:code:``'. + '/subscriptions/\\ :code:``/resourceGroups/\\ :code:``/providers/Microsoft.Network/virtualNetworks/\\ :code:``/subnets/\\ + :code:``'. :paramtype delegated_management_subnet_id: str :keyword cassandra_version: Which version of Cassandra should this cluster converge to running (e.g., 3.11). When updated, the cluster may take some time to migrate to the new version. @@ -3876,26 +3946,63 @@ def __init__( self.max_age_in_seconds = max_age_in_seconds +class CosmosCassandraContainerEntity(ContainerEntity): + """A CosmosDB Cassandra container entity. + + All required parameters must be populated in order to send to server. + + :ivar component: Required. Known values are: "CosmosDBCassandra", "CosmosDBMongo", + "CosmosDBMongoVCore", "CosmosDBSql", and "AzureBlobStorage". + :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent + :ivar key_space_name: Required. + :vartype key_space_name: str + :ivar table_name: Required. + :vartype table_name: str + """ + + _validation = { + "component": {"required": True}, + "key_space_name": {"required": True}, + "table_name": {"required": True}, + } + + _attribute_map = { + "component": {"key": "component", "type": "str"}, + "key_space_name": {"key": "keySpaceName", "type": "str"}, + "table_name": {"key": "tableName", "type": "str"}, + } + + def __init__(self, *, key_space_name: str, table_name: str, **kwargs: Any) -> None: + """ + :keyword key_space_name: Required. + :paramtype key_space_name: str + :keyword table_name: Required. + :paramtype table_name: str + """ + super().__init__(**kwargs) + self.component: str = "CosmosDBCassandra" + self.key_space_name = key_space_name + self.table_name = table_name + + class CosmosCassandraDataTransferDataSourceSink(BaseCosmosDataTransferDataSourceSink): # pylint: disable=name-too-long """A CosmosDB Cassandra API data source/sink. All required parameters must be populated in order to send to server. - :ivar component: Known values are: "CosmosDBCassandra", "CosmosDBMongo", "CosmosDBMongoVCore", - "CosmosDBSql", and "AzureBlobStorage". + :ivar component: Required. Known values are: "CosmosDBCassandra", "CosmosDBMongo", + "CosmosDBMongoVCore", "CosmosDBSql", and "AzureBlobStorage". :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent :ivar remote_account_name: :vartype remote_account_name: str - :ivar keyspace_name: Required. + :ivar keyspace_name: :vartype keyspace_name: str - :ivar table_name: Required. + :ivar table_name: :vartype table_name: str """ _validation = { "component": {"required": True}, - "keyspace_name": {"required": True}, - "table_name": {"required": True}, } _attribute_map = { @@ -3906,14 +4013,19 @@ class CosmosCassandraDataTransferDataSourceSink(BaseCosmosDataTransferDataSource } def __init__( - self, *, keyspace_name: str, table_name: str, remote_account_name: Optional[str] = None, **kwargs: Any + self, + *, + remote_account_name: Optional[str] = None, + keyspace_name: Optional[str] = None, + table_name: Optional[str] = None, + **kwargs: Any ) -> None: """ :keyword remote_account_name: :paramtype remote_account_name: str - :keyword keyspace_name: Required. + :keyword keyspace_name: :paramtype keyspace_name: str - :keyword table_name: Required. + :keyword table_name: :paramtype table_name: str """ super().__init__(remote_account_name=remote_account_name, **kwargs) @@ -3922,16 +4034,14 @@ def __init__( self.table_name = table_name -class CosmosMongoDataTransferDataSourceSink(BaseCosmosDataTransferDataSourceSink): - """A CosmosDB Mongo API data source/sink. +class CosmosMongoContainerEntity(ContainerEntity): + """A CosmosDB Mongo container entity. All required parameters must be populated in order to send to server. - :ivar component: Known values are: "CosmosDBCassandra", "CosmosDBMongo", "CosmosDBMongoVCore", - "CosmosDBSql", and "AzureBlobStorage". + :ivar component: Required. Known values are: "CosmosDBCassandra", "CosmosDBMongo", + "CosmosDBMongoVCore", "CosmosDBSql", and "AzureBlobStorage". :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent - :ivar remote_account_name: - :vartype remote_account_name: str :ivar database_name: Required. :vartype database_name: str :ivar collection_name: Required. @@ -3944,6 +4054,45 @@ class CosmosMongoDataTransferDataSourceSink(BaseCosmosDataTransferDataSourceSink "collection_name": {"required": True}, } + _attribute_map = { + "component": {"key": "component", "type": "str"}, + "database_name": {"key": "databaseName", "type": "str"}, + "collection_name": {"key": "collectionName", "type": "str"}, + } + + def __init__(self, *, database_name: str, collection_name: str, **kwargs: Any) -> None: + """ + :keyword database_name: Required. + :paramtype database_name: str + :keyword collection_name: Required. + :paramtype collection_name: str + """ + super().__init__(**kwargs) + self.component: str = "CosmosDBMongo" + self.database_name = database_name + self.collection_name = collection_name + + +class CosmosMongoDataTransferDataSourceSink(BaseCosmosDataTransferDataSourceSink): + """A CosmosDB Mongo API data source/sink. + + All required parameters must be populated in order to send to server. + + :ivar component: Required. Known values are: "CosmosDBCassandra", "CosmosDBMongo", + "CosmosDBMongoVCore", "CosmosDBSql", and "AzureBlobStorage". + :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent + :ivar remote_account_name: + :vartype remote_account_name: str + :ivar database_name: + :vartype database_name: str + :ivar collection_name: + :vartype collection_name: str + """ + + _validation = { + "component": {"required": True}, + } + _attribute_map = { "component": {"key": "component", "type": "str"}, "remote_account_name": {"key": "remoteAccountName", "type": "str"}, @@ -3952,17 +4101,61 @@ class CosmosMongoDataTransferDataSourceSink(BaseCosmosDataTransferDataSourceSink } def __init__( - self, *, database_name: str, collection_name: str, remote_account_name: Optional[str] = None, **kwargs: Any + self, + *, + remote_account_name: Optional[str] = None, + database_name: Optional[str] = None, + collection_name: Optional[str] = None, + **kwargs: Any ) -> None: """ :keyword remote_account_name: :paramtype remote_account_name: str + :keyword database_name: + :paramtype database_name: str + :keyword collection_name: + :paramtype collection_name: str + """ + super().__init__(remote_account_name=remote_account_name, **kwargs) + self.component: str = "CosmosDBMongo" + self.database_name = database_name + self.collection_name = collection_name + + +class CosmosMongoVCoreContainerEntity(ContainerEntity): + """A CosmosDB Mongo vCore container entity. + + All required parameters must be populated in order to send to server. + + :ivar component: Required. Known values are: "CosmosDBCassandra", "CosmosDBMongo", + "CosmosDBMongoVCore", "CosmosDBSql", and "AzureBlobStorage". + :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent + :ivar database_name: Required. + :vartype database_name: str + :ivar collection_name: Required. + :vartype collection_name: str + """ + + _validation = { + "component": {"required": True}, + "database_name": {"required": True}, + "collection_name": {"required": True}, + } + + _attribute_map = { + "component": {"key": "component", "type": "str"}, + "database_name": {"key": "databaseName", "type": "str"}, + "collection_name": {"key": "collectionName", "type": "str"}, + } + + def __init__(self, *, database_name: str, collection_name: str, **kwargs: Any) -> None: + """ :keyword database_name: Required. :paramtype database_name: str :keyword collection_name: Required. :paramtype collection_name: str """ - super().__init__(remote_account_name=remote_account_name, **kwargs) + super().__init__(**kwargs) self.component: str = "CosmosDBMongo" self.database_name = database_name self.collection_name = collection_name @@ -3973,12 +4166,12 @@ class CosmosMongoVCoreDataTransferDataSourceSink(DataTransferDataSourceSink): # All required parameters must be populated in order to send to server. - :ivar component: Known values are: "CosmosDBCassandra", "CosmosDBMongo", "CosmosDBMongoVCore", - "CosmosDBSql", and "AzureBlobStorage". + :ivar component: Required. Known values are: "CosmosDBCassandra", "CosmosDBMongo", + "CosmosDBMongoVCore", "CosmosDBSql", and "AzureBlobStorage". :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent - :ivar database_name: Required. + :ivar database_name: :vartype database_name: str - :ivar collection_name: Required. + :ivar collection_name: :vartype collection_name: str :ivar host_name: :vartype host_name: str @@ -3988,8 +4181,6 @@ class CosmosMongoVCoreDataTransferDataSourceSink(DataTransferDataSourceSink): # _validation = { "component": {"required": True}, - "database_name": {"required": True}, - "collection_name": {"required": True}, } _attribute_map = { @@ -4003,16 +4194,16 @@ class CosmosMongoVCoreDataTransferDataSourceSink(DataTransferDataSourceSink): # def __init__( self, *, - database_name: str, - collection_name: str, + database_name: Optional[str] = None, + collection_name: Optional[str] = None, host_name: Optional[str] = None, connection_string_key_vault_uri: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword database_name: Required. + :keyword database_name: :paramtype database_name: str - :keyword collection_name: Required. + :keyword collection_name: :paramtype collection_name: str :keyword host_name: :paramtype host_name: str @@ -4027,16 +4218,14 @@ def __init__( self.connection_string_key_vault_uri = connection_string_key_vault_uri -class CosmosSqlDataTransferDataSourceSink(BaseCosmosDataTransferDataSourceSink): - """A CosmosDB No Sql API data source/sink. +class CosmosSqlContainerEntity(ContainerEntity): + """A CosmosDB noSql container entity. All required parameters must be populated in order to send to server. - :ivar component: Known values are: "CosmosDBCassandra", "CosmosDBMongo", "CosmosDBMongoVCore", - "CosmosDBSql", and "AzureBlobStorage". + :ivar component: Required. Known values are: "CosmosDBCassandra", "CosmosDBMongo", + "CosmosDBMongoVCore", "CosmosDBSql", and "AzureBlobStorage". :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent - :ivar remote_account_name: - :vartype remote_account_name: str :ivar database_name: Required. :vartype database_name: str :ivar container_name: Required. @@ -4049,6 +4238,45 @@ class CosmosSqlDataTransferDataSourceSink(BaseCosmosDataTransferDataSourceSink): "container_name": {"required": True}, } + _attribute_map = { + "component": {"key": "component", "type": "str"}, + "database_name": {"key": "databaseName", "type": "str"}, + "container_name": {"key": "containerName", "type": "str"}, + } + + def __init__(self, *, database_name: str, container_name: str, **kwargs: Any) -> None: + """ + :keyword database_name: Required. + :paramtype database_name: str + :keyword container_name: Required. + :paramtype container_name: str + """ + super().__init__(**kwargs) + self.component: str = "CosmosDBSql" + self.database_name = database_name + self.container_name = container_name + + +class CosmosSqlDataTransferDataSourceSink(BaseCosmosDataTransferDataSourceSink): + """A CosmosDB No Sql API data source/sink. + + All required parameters must be populated in order to send to server. + + :ivar component: Required. Known values are: "CosmosDBCassandra", "CosmosDBMongo", + "CosmosDBMongoVCore", "CosmosDBSql", and "AzureBlobStorage". + :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent + :ivar remote_account_name: + :vartype remote_account_name: str + :ivar database_name: + :vartype database_name: str + :ivar container_name: + :vartype container_name: str + """ + + _validation = { + "component": {"required": True}, + } + _attribute_map = { "component": {"key": "component", "type": "str"}, "remote_account_name": {"key": "remoteAccountName", "type": "str"}, @@ -4057,14 +4285,19 @@ class CosmosSqlDataTransferDataSourceSink(BaseCosmosDataTransferDataSourceSink): } def __init__( - self, *, database_name: str, container_name: str, remote_account_name: Optional[str] = None, **kwargs: Any + self, + *, + remote_account_name: Optional[str] = None, + database_name: Optional[str] = None, + container_name: Optional[str] = None, + **kwargs: Any ) -> None: """ :keyword remote_account_name: :paramtype remote_account_name: str - :keyword database_name: Required. + :keyword database_name: :paramtype database_name: str - :keyword container_name: Required. + :keyword container_name: :paramtype container_name: str """ super().__init__(remote_account_name=remote_account_name, **kwargs) @@ -5678,10 +5911,10 @@ class DataCenterResourceProperties(_serialization.Model): :ivar delegated_subnet_id: Resource id of a subnet the nodes in this data center should have their network interfaces connected to. The subnet must be in the same region specified in 'dataCenterLocation' and must be able to route to the subnet specified in the cluster's - 'delegatedManagementSubnetId' property. This resource id will be of the form - '/subscriptions/:code:``/resourceGroups/:code:``/providers/Microsoft.Network/virtualNetworks/:code:``/subnets/:code:``'. + 'delegatedManagementSubnetId' property. This resource id will be of the form '/subscriptions/\\ + :code:``/resourceGroups/\\ :code:``/providers/Microsoft.Network/virtualNetworks/\\ :code:``/subnets/\\ + :code:``'. :vartype delegated_subnet_id: str :ivar node_count: The number of nodes the data center should have. This is the desired number. After it is set, it may take some time for the data center to be scaled to match. To monitor @@ -5779,10 +6012,10 @@ def __init__( :keyword delegated_subnet_id: Resource id of a subnet the nodes in this data center should have their network interfaces connected to. The subnet must be in the same region specified in 'dataCenterLocation' and must be able to route to the subnet specified in the cluster's - 'delegatedManagementSubnetId' property. This resource id will be of the form - '/subscriptions/:code:``/resourceGroups/:code:``/providers/Microsoft.Network/virtualNetworks/:code:``/subnets/:code:``'. + 'delegatedManagementSubnetId' property. This resource id will be of the form '/subscriptions/\\ + :code:``/resourceGroups/\\ :code:``/providers/Microsoft.Network/virtualNetworks/\\ :code:``/subnets/\\ + :code:``'. :paramtype delegated_subnet_id: str :keyword node_count: The number of nodes the data center should have. This is the desired number. After it is set, it may take some time for the data center to be scaled to match. To @@ -5838,6 +6071,53 @@ def __init__( self.private_endpoint_ip_address = private_endpoint_ip_address +class DataTransferContainerDetails(_serialization.Model): + """Data transfer entity. + + 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 server. + + :ivar total_count: + :vartype total_count: int + :ivar processed_count: + :vartype processed_count: int + :ivar source: Required. + :vartype source: ~azure.mgmt.cosmosdb.models.ContainerEntity + :ivar destination: Required. + :vartype destination: ~azure.mgmt.cosmosdb.models.ContainerEntity + """ + + _validation = { + "total_count": {"readonly": True}, + "processed_count": {"readonly": True}, + "source": {"required": True}, + "destination": {"required": True}, + } + + _attribute_map = { + "total_count": {"key": "totalCount", "type": "int"}, + "processed_count": {"key": "processedCount", "type": "int"}, + "source": {"key": "source", "type": "ContainerEntity"}, + "destination": {"key": "destination", "type": "ContainerEntity"}, + } + + def __init__( + self, *, source: "_models.ContainerEntity", destination: "_models.ContainerEntity", **kwargs: Any + ) -> None: + """ + :keyword source: Required. + :paramtype source: ~azure.mgmt.cosmosdb.models.ContainerEntity + :keyword destination: Required. + :paramtype destination: ~azure.mgmt.cosmosdb.models.ContainerEntity + """ + super().__init__(**kwargs) + self.total_count = None + self.processed_count = None + self.source = source + self.destination = destination + + class DataTransferJobFeedResults(_serialization.Model): """The List operation response, that contains the Data Transfer jobs and their properties. @@ -5883,6 +6163,9 @@ class DataTransferJobGetResults(ARMProxyResource): :vartype source: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink :ivar destination: Destination DataStore details. :vartype destination: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink + :ivar source_and_destination_containers: + :vartype source_and_destination_containers: + list[~azure.mgmt.cosmosdb.models.DataTransferContainerDetails] :ivar status: Job Status. :vartype status: str :ivar processed_count: Processed Count. @@ -5922,6 +6205,10 @@ class DataTransferJobGetResults(ARMProxyResource): "job_name": {"key": "properties.jobName", "type": "str"}, "source": {"key": "properties.source", "type": "DataTransferDataSourceSink"}, "destination": {"key": "properties.destination", "type": "DataTransferDataSourceSink"}, + "source_and_destination_containers": { + "key": "properties.sourceAndDestinationContainers", + "type": "[DataTransferContainerDetails]", + }, "status": {"key": "properties.status", "type": "str"}, "processed_count": {"key": "properties.processedCount", "type": "int"}, "total_count": {"key": "properties.totalCount", "type": "int"}, @@ -5937,6 +6224,7 @@ def __init__( *, source: Optional["_models.DataTransferDataSourceSink"] = None, destination: Optional["_models.DataTransferDataSourceSink"] = None, + source_and_destination_containers: Optional[List["_models.DataTransferContainerDetails"]] = None, worker_count: Optional[int] = None, mode: Optional[Union[str, "_models.DataTransferJobMode"]] = None, **kwargs: Any @@ -5946,6 +6234,9 @@ def __init__( :paramtype source: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink :keyword destination: Destination DataStore details. :paramtype destination: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink + :keyword source_and_destination_containers: + :paramtype source_and_destination_containers: + list[~azure.mgmt.cosmosdb.models.DataTransferContainerDetails] :keyword worker_count: Worker count. :paramtype worker_count: int :keyword mode: Mode of job execution. Known values are: "Offline" and "Online". @@ -5955,6 +6246,7 @@ def __init__( self.job_name = None self.source = source self.destination = destination + self.source_and_destination_containers = source_and_destination_containers self.status = None self.processed_count = None self.total_count = None @@ -5978,6 +6270,9 @@ class DataTransferJobProperties(_serialization.Model): :vartype source: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink :ivar destination: Destination DataStore details. Required. :vartype destination: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink + :ivar source_and_destination_containers: + :vartype source_and_destination_containers: + list[~azure.mgmt.cosmosdb.models.DataTransferContainerDetails] :ivar status: Job Status. :vartype status: str :ivar processed_count: Processed Count. @@ -6013,6 +6308,10 @@ class DataTransferJobProperties(_serialization.Model): "job_name": {"key": "jobName", "type": "str"}, "source": {"key": "source", "type": "DataTransferDataSourceSink"}, "destination": {"key": "destination", "type": "DataTransferDataSourceSink"}, + "source_and_destination_containers": { + "key": "sourceAndDestinationContainers", + "type": "[DataTransferContainerDetails]", + }, "status": {"key": "status", "type": "str"}, "processed_count": {"key": "processedCount", "type": "int"}, "total_count": {"key": "totalCount", "type": "int"}, @@ -6028,6 +6327,7 @@ def __init__( *, source: "_models.DataTransferDataSourceSink", destination: "_models.DataTransferDataSourceSink", + source_and_destination_containers: Optional[List["_models.DataTransferContainerDetails"]] = None, worker_count: Optional[int] = None, mode: Optional[Union[str, "_models.DataTransferJobMode"]] = None, **kwargs: Any @@ -6037,6 +6337,9 @@ def __init__( :paramtype source: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink :keyword destination: Destination DataStore details. Required. :paramtype destination: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink + :keyword source_and_destination_containers: + :paramtype source_and_destination_containers: + list[~azure.mgmt.cosmosdb.models.DataTransferContainerDetails] :keyword worker_count: Worker count. :paramtype worker_count: int :keyword mode: Mode of job execution. Known values are: "Offline" and "Online". @@ -6046,6 +6349,7 @@ def __init__( self.job_name = None self.source = source self.destination = destination + self.source_and_destination_containers = source_and_destination_containers self.status = None self.processed_count = None self.total_count = None diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_data_transfer_jobs_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_data_transfer_jobs_operations.py index 49137efc816c..77384f329590 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_data_transfer_jobs_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_data_transfer_jobs_operations.py @@ -35,6 +35,14 @@ def test_data_transfer_jobs_create(self, resource_group): "lastUpdatedUtcTime": "2020-02-20 00:00:00", "mode": "str", "processedCount": 0, + "sourceAndDestinationContainers": [ + { + "destination": "container_entity", + "source": "container_entity", + "processedCount": 0, + "totalCount": 0, + } + ], "status": "str", "totalCount": 0, "workerCount": 0, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_data_transfer_jobs_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_data_transfer_jobs_operations_async.py index 54a8ffe58f90..725cc835497f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_data_transfer_jobs_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_data_transfer_jobs_operations_async.py @@ -36,6 +36,14 @@ async def test_data_transfer_jobs_create(self, resource_group): "lastUpdatedUtcTime": "2020-02-20 00:00:00", "mode": "str", "processedCount": 0, + "sourceAndDestinationContainers": [ + { + "destination": "container_entity", + "source": "container_entity", + "processedCount": 0, + "totalCount": 0, + } + ], "status": "str", "totalCount": 0, "workerCount": 0,