Skip to content

Commit 2c4f540

Browse files
azure-sdkChenxiJiang333msyyc
authored
[AutoRelease] t2-mongocluster-2024-09-23-53028(can only be merged by SDK owner) (#37516)
* code and test * update-testcases * Update CHANGELOG.md * Update CHANGELOG.md * Update CHANGELOG.md * Update test_cli_mgmt_mongocluster_lro_test.py --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <[email protected]> Co-authored-by: ChenxiJiang333 <[email protected]> Co-authored-by: Yuchao Yan <[email protected]>
1 parent 11fa9c1 commit 2c4f540

File tree

66 files changed

+4665
-3628
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+4665
-3628
lines changed

sdk/mongocluster/azure-mgmt-mongocluster/CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# Release History
22

3+
## 1.0.0b2 (2024-09-23)
4+
5+
### Features Added
6+
7+
- Client `MongoClusterMgmtClient` added operation group `replicas`
8+
- Enum `CreateMode` added member `GEO_REPLICA`
9+
- Enum `CreateMode` added member `REPLICA`
10+
- Model `MongoClusterProperties` added property `replica_parameters`
11+
- Model `MongoClusterProperties` added property `preview_features`
12+
- Model `MongoClusterProperties` added property `replica`
13+
- Model `MongoClusterProperties` added property `infrastructure_version`
14+
- Model `MongoClusterUpdateProperties` added property `preview_features`
15+
- Added model `MongoClusterReplicaParameters`
16+
- Added enum `PreviewFeature`
17+
- Added enum `PromoteMode`
18+
- Added enum `PromoteOption`
19+
- Added model `PromoteReplicaRequest`
20+
- Added model `Replica`
21+
- Added model `ReplicationProperties`
22+
- Added enum `ReplicationRole`
23+
- Added enum `ReplicationState`
24+
- Model `MongoClustersOperations` added method `begin_promote`
25+
- Added model `ReplicasOperations`
26+
27+
### Breaking Changes
28+
29+
- Model `MongoClusterRestoreParameters` renamed its instance variable `point_in_time_u_t_c` to `point_in_time_utc`
30+
- Model `NodeGroupSpec` renamed its instance variable `disk_size_g_b` to `disk_size_gb`
31+
332
## 1.0.0b1 (2024-07-01)
433

534
### Other Changes
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"commit": "abad0096677005817d2c19df2364663e5583c8fc",
2+
"commit": "465d34792335e02d9bf8de153734420d769adac1",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"typespec_src": "specification/mongocluster/DocumentDB.MongoCluster.Management",
5-
"@azure-tools/typespec-python": "0.24.3",
6-
"@autorest/python": "6.14.3"
5+
"@azure-tools/typespec-python": "0.33.0"
76
}

sdk/mongocluster/azure-mgmt-mongocluster/assets.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_client.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
Operations,
2424
PrivateEndpointConnectionsOperations,
2525
PrivateLinksOperations,
26+
ReplicasOperations,
2627
)
2728

2829
if TYPE_CHECKING:
@@ -45,14 +46,16 @@ class MongoClusterMgmtClient: # pylint: disable=client-accepts-api-version-keyw
4546
azure.mgmt.mongocluster.operations.PrivateEndpointConnectionsOperations
4647
:ivar private_links: PrivateLinksOperations operations
4748
:vartype private_links: azure.mgmt.mongocluster.operations.PrivateLinksOperations
49+
:ivar replicas: ReplicasOperations operations
50+
:vartype replicas: azure.mgmt.mongocluster.operations.ReplicasOperations
4851
:param credential: Credential used to authenticate requests to the service. Required.
4952
:type credential: ~azure.core.credentials.TokenCredential
5053
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
5154
:type subscription_id: str
5255
:param base_url: Service host. Default value is "https://management.azure.com".
5356
:type base_url: str
5457
:keyword api_version: The API version to use for this operation. Default value is
55-
"2024-03-01-preview". Note that overriding this default value may result in unsupported
58+
"2024-06-01-preview". Note that overriding this default value may result in unsupported
5659
behavior.
5760
:paramtype api_version: str
5861
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -66,8 +69,9 @@ def __init__(
6669
base_url: str = "https://management.azure.com",
6770
**kwargs: Any
6871
) -> None:
72+
_endpoint = "{endpoint}"
6973
self._config = MongoClusterMgmtClientConfiguration(
70-
credential=credential, subscription_id=subscription_id, **kwargs
74+
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
7175
)
7276
_policies = kwargs.pop("policies", None)
7377
if _policies is None:
@@ -87,7 +91,7 @@ def __init__(
8791
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
8892
self._config.http_logging_policy,
8993
]
90-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
94+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
9195

9296
self._serialize = Serializer()
9397
self._deserialize = Deserializer()
@@ -99,6 +103,7 @@ def __init__(
99103
self._client, self._config, self._serialize, self._deserialize
100104
)
101105
self.private_links = PrivateLinksOperations(self._client, self._config, self._serialize, self._deserialize)
106+
self.replicas = ReplicasOperations(self._client, self._config, self._serialize, self._deserialize)
102107

103108
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
104109
"""Runs the network request through the client's chained policies.
@@ -119,7 +124,11 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
119124
"""
120125

121126
request_copy = deepcopy(request)
122-
request_copy.url = self._client.format_url(request_copy.url)
127+
path_format_arguments = {
128+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
129+
}
130+
131+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
123132
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
124133

125134
def close(self) -> None:

sdk/mongocluster/azure-mgmt-mongocluster/azure/mgmt/mongocluster/_configuration.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,22 @@ class MongoClusterMgmtClientConfiguration: # pylint: disable=too-many-instance-
2828
:type credential: ~azure.core.credentials.TokenCredential
2929
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3030
:type subscription_id: str
31+
:param base_url: Service host. Default value is "https://management.azure.com".
32+
:type base_url: str
3133
:keyword api_version: The API version to use for this operation. Default value is
32-
"2024-03-01-preview". Note that overriding this default value may result in unsupported
34+
"2024-06-01-preview". Note that overriding this default value may result in unsupported
3335
behavior.
3436
:paramtype api_version: str
3537
"""
3638

37-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
38-
api_version: str = kwargs.pop("api_version", "2024-03-01-preview")
39+
def __init__(
40+
self,
41+
credential: "TokenCredential",
42+
subscription_id: str,
43+
base_url: str = "https://management.azure.com",
44+
**kwargs: Any
45+
) -> None:
46+
api_version: str = kwargs.pop("api_version", "2024-06-01-preview")
3947

4048
if credential is None:
4149
raise ValueError("Parameter 'credential' must not be None.")
@@ -44,6 +52,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4452

4553
self.credential = credential
4654
self.subscription_id = subscription_id
55+
self.base_url = base_url
4756
self.api_version = api_version
4857
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4958
kwargs.setdefault("sdk_moniker", "mgmt-mongocluster/{}".format(VERSION))

0 commit comments

Comments
 (0)