77# --------------------------------------------------------------------------
88
99from copy import deepcopy
10- from typing import Any , TYPE_CHECKING
10+ from typing import Any , Optional , TYPE_CHECKING , cast
1111from typing_extensions import Self
1212
1313from azure .core .pipeline import policies
1414from azure .core .rest import HttpRequest , HttpResponse
15+ from azure .core .settings import settings
1516from azure .mgmt .core import ARMPipelineClient
1617from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
18+ from azure .mgmt .core .tools import get_arm_endpoints
1719
1820from . import models as _models
1921from ._configuration import CosmosDBManagementClientConfiguration
20- from ._serialization import Deserializer , Serializer
22+ from ._utils . serialization import Deserializer , Serializer
2123from .operations import (
2224 CassandraClustersOperations ,
2325 CassandraDataCentersOperations ,
2426 CassandraResourcesOperations ,
25- ChaosFaultOperations ,
2627 CollectionOperations ,
2728 CollectionPartitionOperations ,
2829 CollectionPartitionRegionOperations ,
2930 CollectionRegionOperations ,
30- DataTransferJobsOperations ,
3131 DatabaseAccountRegionOperations ,
3232 DatabaseAccountsOperations ,
3333 DatabaseOperations ,
34- GraphResourcesOperations ,
3534 GremlinResourcesOperations ,
3635 LocationsOperations ,
3736 MongoDBResourcesOperations ,
38- NetworkSecurityPerimeterConfigurationsOperations ,
3937 NotebookWorkspacesOperations ,
4038 Operations ,
4139 PartitionKeyRangeIdOperations ,
6058 ServiceOperations ,
6159 SqlResourcesOperations ,
6260 TableResourcesOperations ,
63- ThroughputPoolAccountOperations ,
64- ThroughputPoolAccountsOperations ,
65- ThroughputPoolOperations ,
66- ThroughputPoolsOperations ,
6761)
6862
6963if TYPE_CHECKING :
7064 from azure .core .credentials import TokenCredential
7165
7266
7367class CosmosDBManagementClient : # pylint: disable=too-many-instance-attributes
74- """Azure Cosmos DB Chaos Fault REST API.
68+ """Azure Cosmos DB Database Service Resource Provider REST API.
7569
76- :ivar chaos_fault: ChaosFaultOperations operations
77- :vartype chaos_fault: azure.mgmt.cosmosdb.operations.ChaosFaultOperations
7870 :ivar database_accounts: DatabaseAccountsOperations operations
7971 :vartype database_accounts: azure.mgmt.cosmosdb.operations.DatabaseAccountsOperations
8072 :ivar operations: Operations operations
@@ -105,8 +97,6 @@ class CosmosDBManagementClient: # pylint: disable=too-many-instance-attributes
10597 :ivar partition_key_range_id_region: PartitionKeyRangeIdRegionOperations operations
10698 :vartype partition_key_range_id_region:
10799 azure.mgmt.cosmosdb.operations.PartitionKeyRangeIdRegionOperations
108- :ivar graph_resources: GraphResourcesOperations operations
109- :vartype graph_resources: azure.mgmt.cosmosdb.operations.GraphResourcesOperations
110100 :ivar sql_resources: SqlResourcesOperations operations
111101 :vartype sql_resources: azure.mgmt.cosmosdb.operations.SqlResourcesOperations
112102 :ivar mongo_db_resources: MongoDBResourcesOperations operations
@@ -119,16 +109,10 @@ class CosmosDBManagementClient: # pylint: disable=too-many-instance-attributes
119109 :vartype gremlin_resources: azure.mgmt.cosmosdb.operations.GremlinResourcesOperations
120110 :ivar locations: LocationsOperations operations
121111 :vartype locations: azure.mgmt.cosmosdb.operations.LocationsOperations
122- :ivar data_transfer_jobs: DataTransferJobsOperations operations
123- :vartype data_transfer_jobs: azure.mgmt.cosmosdb.operations.DataTransferJobsOperations
124112 :ivar cassandra_clusters: CassandraClustersOperations operations
125113 :vartype cassandra_clusters: azure.mgmt.cosmosdb.operations.CassandraClustersOperations
126114 :ivar cassandra_data_centers: CassandraDataCentersOperations operations
127115 :vartype cassandra_data_centers: azure.mgmt.cosmosdb.operations.CassandraDataCentersOperations
128- :ivar network_security_perimeter_configurations:
129- NetworkSecurityPerimeterConfigurationsOperations operations
130- :vartype network_security_perimeter_configurations:
131- azure.mgmt.cosmosdb.operations.NetworkSecurityPerimeterConfigurationsOperations
132116 :ivar notebook_workspaces: NotebookWorkspacesOperations operations
133117 :vartype notebook_workspaces: azure.mgmt.cosmosdb.operations.NotebookWorkspacesOperations
134118 :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
@@ -173,39 +157,31 @@ class CosmosDBManagementClient: # pylint: disable=too-many-instance-attributes
173157 azure.mgmt.cosmosdb.operations.RestorableTableResourcesOperations
174158 :ivar service: ServiceOperations operations
175159 :vartype service: azure.mgmt.cosmosdb.operations.ServiceOperations
176- :ivar throughput_pools: ThroughputPoolsOperations operations
177- :vartype throughput_pools: azure.mgmt.cosmosdb.operations.ThroughputPoolsOperations
178- :ivar throughput_pool: ThroughputPoolOperations operations
179- :vartype throughput_pool: azure.mgmt.cosmosdb.operations.ThroughputPoolOperations
180- :ivar throughput_pool_accounts: ThroughputPoolAccountsOperations operations
181- :vartype throughput_pool_accounts:
182- azure.mgmt.cosmosdb.operations.ThroughputPoolAccountsOperations
183- :ivar throughput_pool_account: ThroughputPoolAccountOperations operations
184- :vartype throughput_pool_account:
185- azure.mgmt.cosmosdb.operations.ThroughputPoolAccountOperations
186160 :param credential: Credential needed for the client to connect to Azure. Required.
187161 :type credential: ~azure.core.credentials.TokenCredential
188- :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
162+ :param subscription_id: The ID of the target subscription. Required.
189163 :type subscription_id: str
190- :param base_url: Service URL. Default value is "https://management.azure.com" .
164+ :param base_url: Service URL. Default value is None .
191165 :type base_url: str
192- :keyword api_version: Api Version. Default value is "2024-12-01-preview ". Note that overriding
193- this default value may result in unsupported behavior.
166+ :keyword api_version: Api Version. Default value is "2025-04-15 ". Note that overriding this
167+ default value may result in unsupported behavior.
194168 :paramtype api_version: str
195169 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
196170 Retry-After header is present.
197171 """
198172
199173 def __init__ (
200- self ,
201- credential : "TokenCredential" ,
202- subscription_id : str ,
203- base_url : str = "https://management.azure.com" ,
204- ** kwargs : Any
174+ self , credential : "TokenCredential" , subscription_id : str , base_url : Optional [str ] = None , ** kwargs : Any
205175 ) -> None :
176+ _cloud = kwargs .pop ("cloud_setting" , None ) or settings .current .azure_cloud # type: ignore
177+ _endpoints = get_arm_endpoints (_cloud )
178+ if not base_url :
179+ base_url = _endpoints ["resource_manager" ]
180+ credential_scopes = kwargs .pop ("credential_scopes" , _endpoints ["credential_scopes" ])
206181 self ._config = CosmosDBManagementClientConfiguration (
207- credential = credential , subscription_id = subscription_id , ** kwargs
182+ credential = credential , subscription_id = subscription_id , credential_scopes = credential_scopes , ** kwargs
208183 )
184+
209185 _policies = kwargs .pop ("policies" , None )
210186 if _policies is None :
211187 _policies = [
@@ -224,13 +200,12 @@ def __init__(
224200 policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
225201 self ._config .http_logging_policy ,
226202 ]
227- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
203+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = cast ( str , base_url ) , policies = _policies , ** kwargs )
228204
229205 client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
230206 self ._serialize = Serializer (client_models )
231207 self ._deserialize = Deserializer (client_models )
232208 self ._serialize .client_side_validation = False
233- self .chaos_fault = ChaosFaultOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
234209 self .database_accounts = DatabaseAccountsOperations (
235210 self ._client , self ._config , self ._serialize , self ._deserialize
236211 )
@@ -262,7 +237,6 @@ def __init__(
262237 self .partition_key_range_id_region = PartitionKeyRangeIdRegionOperations (
263238 self ._client , self ._config , self ._serialize , self ._deserialize
264239 )
265- self .graph_resources = GraphResourcesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
266240 self .sql_resources = SqlResourcesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
267241 self .mongo_db_resources = MongoDBResourcesOperations (
268242 self ._client , self ._config , self ._serialize , self ._deserialize
@@ -275,18 +249,12 @@ def __init__(
275249 self ._client , self ._config , self ._serialize , self ._deserialize
276250 )
277251 self .locations = LocationsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
278- self .data_transfer_jobs = DataTransferJobsOperations (
279- self ._client , self ._config , self ._serialize , self ._deserialize
280- )
281252 self .cassandra_clusters = CassandraClustersOperations (
282253 self ._client , self ._config , self ._serialize , self ._deserialize
283254 )
284255 self .cassandra_data_centers = CassandraDataCentersOperations (
285256 self ._client , self ._config , self ._serialize , self ._deserialize
286257 )
287- self .network_security_perimeter_configurations = NetworkSecurityPerimeterConfigurationsOperations (
288- self ._client , self ._config , self ._serialize , self ._deserialize
289- )
290258 self .notebook_workspaces = NotebookWorkspacesOperations (
291259 self ._client , self ._config , self ._serialize , self ._deserialize
292260 )
@@ -333,16 +301,6 @@ def __init__(
333301 self ._client , self ._config , self ._serialize , self ._deserialize
334302 )
335303 self .service = ServiceOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
336- self .throughput_pools = ThroughputPoolsOperations (
337- self ._client , self ._config , self ._serialize , self ._deserialize
338- )
339- self .throughput_pool = ThroughputPoolOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
340- self .throughput_pool_accounts = ThroughputPoolAccountsOperations (
341- self ._client , self ._config , self ._serialize , self ._deserialize
342- )
343- self .throughput_pool_account = ThroughputPoolAccountOperations (
344- self ._client , self ._config , self ._serialize , self ._deserialize
345- )
346304
347305 def _send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
348306 """Runs the network request through the client's chained policies.
0 commit comments