Skip to content

Commit 96adcd5

Browse files
[AutoRelease] t2-networkcloud-2025-10-20-87154(can only be merged by SDK owner) (Azure#43517)
* code and test * update changelog --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent d2aa5a2 commit 96adcd5

File tree

239 files changed

+6044
-1817
lines changed

Some content is hidden

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

239 files changed

+6044
-1817
lines changed

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

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

3+
## 2.2.0b1 (2025-11-17)
4+
5+
### Features Added
6+
7+
- Model `NetworkCloudMgmtClient` added parameter `cloud_setting` in method `__init__`
8+
- Model `BareMetalMachine` added property `action_states`
9+
- Model `BareMetalMachine` added property `ca_certificate`
10+
- Model `BareMetalMachineKeySet` added property `privilege_level_name`
11+
- Enum `BareMetalMachineKeySetPrivilegeLevel` added member `OTHER`
12+
- Model `BareMetalMachineReplaceParameters` added property `safeguard_mode`
13+
- Model `BareMetalMachineReplaceParameters` added property `storage_policy`
14+
- Model `CloudServicesNetwork` added property `storage_options`
15+
- Model `CloudServicesNetwork` added property `storage_status`
16+
- Model `CloudServicesNetworkPatchParameters` added property `storage_options`
17+
- Model `Cluster` added property `action_states`
18+
- Model `CommandOutputSettings` added property `overrides`
19+
- Model `SecretArchiveReference` added property `key_vault_uri`
20+
- Model `StorageAppliance` added property `ca_certificate`
21+
- Model `VirtualMachine` added property `identity`
22+
- Model `VirtualMachine` added property `network_data_content`
23+
- Model `VirtualMachine` added property `user_data_content`
24+
- Model `VirtualMachinePatchParameters` added property `identity`
25+
- Model `Volume` added property `allocated_size_mi_b`
26+
- Model `Volume` added property `storage_appliance_id`
27+
- Added model `ActionState`
28+
- Added enum `ActionStateStatus`
29+
- Added enum `BareMetalMachineReplaceSafeguardMode`
30+
- Added enum `BareMetalMachineReplaceStoragePolicy`
31+
- Added model `CertificateInfo`
32+
- Added enum `CloudServicesNetworkStorageMode`
33+
- Added model `CloudServicesNetworkStorageOptions`
34+
- Added model `CloudServicesNetworkStorageOptionsPatch`
35+
- Added model `CloudServicesNetworkStorageStatus`
36+
- Added enum `CloudServicesNetworkStorageStatusStatus`
37+
- Added model `CommandOutputOverride`
38+
- Added enum `CommandOutputType`
39+
- Added enum `RelayType`
40+
- Added model `StepState`
41+
- Added enum `StepStateStatus`
42+
- Added model `StorageApplianceCommandSpecification`
43+
- Added model `StorageApplianceRunReadCommandsParameters`
44+
- Added model `VirtualMachineAssignRelayParameters`
45+
- Operation group `BareMetalMachinesOperations` added method `begin_run_data_extracts_restricted`
46+
- Operation group `StorageAppliancesOperations` added method `begin_run_read_commands`
47+
- Operation group `VirtualMachinesOperations` added method `begin_assign_relay`
48+
349
## 2.1.0 (2025-06-16)
450

551
### Features Added
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
include _meta.json
2-
recursive-include tests *.py *.json
3-
recursive-include samples *.py *.md
41
include *.md
5-
include azure/__init__.py
6-
include azure/mgmt/__init__.py
72
include LICENSE
83
include azure/mgmt/networkcloud/py.typed
4+
recursive-include tests *.py
5+
recursive-include samples *.py *.md
6+
include azure/__init__.py
7+
include azure/mgmt/__init__.py

sdk/networkcloud/azure-mgmt-networkcloud/_meta.json

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"commit": "a39b73b1c7d12a633805a3b2ed3177a8bfddd9e2",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"autorest": "3.10.2",
5+
"use": [
6+
"@autorest/[email protected]",
7+
"@autorest/[email protected]"
8+
],
9+
"autorest_command": "autorest specification/networkcloud/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --package-mode=azure-mgmt --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --tag=package-2025-07-01-preview --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
10+
"readme": "specification/networkcloud/resource-manager/readme.md"
11+
}

sdk/networkcloud/azure-mgmt-networkcloud/apiview-properties.json

Lines changed: 535 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from typing import Any, TYPE_CHECKING
9+
from typing import Any, Optional, TYPE_CHECKING
1010

1111
from azure.core.pipeline import policies
1212
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1313

1414
from ._version import VERSION
1515

1616
if TYPE_CHECKING:
17+
from azure.core import AzureClouds
1718
from azure.core.credentials import TokenCredential
1819

1920

@@ -27,13 +28,22 @@ class NetworkCloudMgmtClientConfiguration: # pylint: disable=too-many-instance-
2728
:type credential: ~azure.core.credentials.TokenCredential
2829
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
2930
:type subscription_id: str
30-
:keyword api_version: Api Version. Default value is "2025-02-01". Note that overriding this
31-
default value may result in unsupported behavior.
31+
:param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
32+
None.
33+
:type cloud_setting: ~azure.core.AzureClouds
34+
:keyword api_version: Api Version. Default value is "2025-07-01-preview". Note that overriding
35+
this default value may result in unsupported behavior.
3236
:paramtype api_version: str
3337
"""
3438

35-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
36-
api_version: str = kwargs.pop("api_version", "2025-02-01")
39+
def __init__(
40+
self,
41+
credential: "TokenCredential",
42+
subscription_id: str,
43+
cloud_setting: Optional["AzureClouds"] = None,
44+
**kwargs: Any
45+
) -> None:
46+
api_version: str = kwargs.pop("api_version", "2025-07-01-preview")
3747

3848
if credential is None:
3949
raise ValueError("Parameter 'credential' must not be None.")
@@ -42,6 +52,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4252

4353
self.credential = credential
4454
self.subscription_id = subscription_id
55+
self.cloud_setting = cloud_setting
4556
self.api_version = api_version
4657
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4758
kwargs.setdefault("sdk_moniker", "mgmt-networkcloud/{}".format(VERSION))

sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/_network_cloud_mgmt_client.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
)
4545

4646
if TYPE_CHECKING:
47+
from azure.core import AzureClouds
4748
from azure.core.credentials import TokenCredential
4849

4950

@@ -101,23 +102,36 @@ class NetworkCloudMgmtClient: # pylint: disable=too-many-instance-attributes
101102
:type subscription_id: str
102103
:param base_url: Service URL. Default value is None.
103104
:type base_url: str
104-
:keyword api_version: Api Version. Default value is "2025-02-01". Note that overriding this
105-
default value may result in unsupported behavior.
105+
:keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
106+
None.
107+
:paramtype cloud_setting: ~azure.core.AzureClouds
108+
:keyword api_version: Api Version. Default value is "2025-07-01-preview". Note that overriding
109+
this default value may result in unsupported behavior.
106110
:paramtype api_version: str
107111
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
108112
Retry-After header is present.
109113
"""
110114

111115
def __init__(
112-
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
116+
self,
117+
credential: "TokenCredential",
118+
subscription_id: str,
119+
base_url: Optional[str] = None,
120+
*,
121+
cloud_setting: Optional["AzureClouds"] = None,
122+
**kwargs: Any
113123
) -> None:
114-
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
124+
_cloud = cloud_setting or settings.current.azure_cloud # type: ignore
115125
_endpoints = get_arm_endpoints(_cloud)
116126
if not base_url:
117127
base_url = _endpoints["resource_manager"]
118128
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
119129
self._config = NetworkCloudMgmtClientConfiguration(
120-
credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs
130+
credential=credential,
131+
subscription_id=subscription_id,
132+
cloud_setting=cloud_setting,
133+
credential_scopes=credential_scopes,
134+
**kwargs
121135
)
122136

123137
_policies = kwargs.pop("policies", None)

sdk/networkcloud/azure-mgmt-networkcloud/azure/mgmt/networkcloud/_utils/serialization.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import sys
2222
import codecs
2323
from typing import (
24-
Dict,
2524
Any,
2625
cast,
2726
Optional,
@@ -31,7 +30,6 @@
3130
Mapping,
3231
Callable,
3332
MutableMapping,
34-
List,
3533
)
3634

3735
try:
@@ -229,12 +227,12 @@ class Model:
229227
serialization and deserialization.
230228
"""
231229

232-
_subtype_map: Dict[str, Dict[str, Any]] = {}
233-
_attribute_map: Dict[str, Dict[str, Any]] = {}
234-
_validation: Dict[str, Dict[str, Any]] = {}
230+
_subtype_map: dict[str, dict[str, Any]] = {}
231+
_attribute_map: dict[str, dict[str, Any]] = {}
232+
_validation: dict[str, dict[str, Any]] = {}
235233

236234
def __init__(self, **kwargs: Any) -> None:
237-
self.additional_properties: Optional[Dict[str, Any]] = {}
235+
self.additional_properties: Optional[dict[str, Any]] = {}
238236
for k in kwargs: # pylint: disable=consider-using-dict-items
239237
if k not in self._attribute_map:
240238
_LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__)
@@ -311,7 +309,7 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON:
311309
def as_dict(
312310
self,
313311
keep_readonly: bool = True,
314-
key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
312+
key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer,
315313
**kwargs: Any
316314
) -> JSON:
317315
"""Return a dict that can be serialized using json.dump.
@@ -380,7 +378,7 @@ def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self:
380378
def from_dict(
381379
cls,
382380
data: Any,
383-
key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None,
381+
key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None,
384382
content_type: Optional[str] = None,
385383
) -> Self:
386384
"""Parse a dict using given key extractor return a model.
@@ -414,7 +412,7 @@ def _flatten_subtype(cls, key, objects):
414412
return {}
415413
result = dict(cls._subtype_map[key])
416414
for valuetype in cls._subtype_map[key].values():
417-
result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access
415+
result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access
418416
return result
419417

420418
@classmethod
@@ -528,7 +526,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
528526
"[]": self.serialize_iter,
529527
"{}": self.serialize_dict,
530528
}
531-
self.dependencies: Dict[str, type] = dict(classes) if classes else {}
529+
self.dependencies: dict[str, type] = dict(classes) if classes else {}
532530
self.key_transformer = full_restapi_key_transformer
533531
self.client_side_validation = True
534532

@@ -579,7 +577,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to
579577

580578
if attr_name == "additional_properties" and attr_desc["key"] == "":
581579
if target_obj.additional_properties is not None:
582-
serialized.update(target_obj.additional_properties)
580+
serialized |= target_obj.additional_properties
583581
continue
584582
try:
585583

@@ -789,7 +787,7 @@ def serialize_data(self, data, data_type, **kwargs):
789787

790788
# If dependencies is empty, try with current data class
791789
# It has to be a subclass of Enum anyway
792-
enum_type = self.dependencies.get(data_type, data.__class__)
790+
enum_type = self.dependencies.get(data_type, cast(type, data.__class__))
793791
if issubclass(enum_type, Enum):
794792
return Serializer.serialize_enum(data, enum_obj=enum_type)
795793

@@ -1184,7 +1182,7 @@ def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argumen
11841182

11851183
while "." in key:
11861184
# Need the cast, as for some reasons "split" is typed as list[str | Any]
1187-
dict_keys = cast(List[str], _FLATTEN.split(key))
1185+
dict_keys = cast(list[str], _FLATTEN.split(key))
11881186
if len(dict_keys) == 1:
11891187
key = _decode_attribute_map_key(dict_keys[0])
11901188
break
@@ -1386,7 +1384,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
13861384
"duration": (isodate.Duration, datetime.timedelta),
13871385
"iso-8601": (datetime.datetime),
13881386
}
1389-
self.dependencies: Dict[str, type] = dict(classes) if classes else {}
1387+
self.dependencies: dict[str, type] = dict(classes) if classes else {}
13901388
self.key_extractors = [rest_key_extractor, xml_key_extractor]
13911389
# Additional properties only works if the "rest_key_extractor" is used to
13921390
# extract the keys. Making it to work whatever the key extractor is too much

0 commit comments

Comments
 (0)