Skip to content

Commit 5689065

Browse files
[AutoRelease] t2-servicefabricmanagedclusters-2023-11-21-77418(can only be merged by SDK owner) (#33261)
* code and test * update-testcase * Update assets.json * Update CHANGELOG.md * Update ci.yml --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <[email protected]> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent d8c71c8 commit 5689065

File tree

107 files changed

+3477
-334
lines changed

Some content is hidden

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

107 files changed

+3477
-334
lines changed

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

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

3+
## 2.0.0b5 (2024-01-18)
4+
5+
### Features Added
6+
7+
- Added operation ApplicationsOperations.begin_read_upgrade
8+
- Added operation ApplicationsOperations.begin_resume_upgrade
9+
- Added operation ApplicationsOperations.begin_start_rollback
10+
- Added operation group ManagedApplyMaintenanceWindowOperations
11+
- Added operation group ManagedMaintenanceWindowStatusOperations
12+
- Model ManagedCluster has a new parameter ddos_protection_plan_id
13+
- Model ManagedCluster has a new parameter public_i_pv6_prefix_id
14+
- Model ManagedCluster has a new parameter public_ip_prefix_id
15+
- Model ManagedCluster has a new parameter upgrade_description
16+
- Model NodeType has a new parameter additional_network_interface_configurations
17+
- Model NodeType has a new parameter dscp_configuration_id
18+
- Model NodeType has a new parameter enable_node_public_i_pv6
19+
- Model NodeType has a new parameter nat_gateway_id
20+
- Model NodeType has a new parameter service_artifact_reference_id
21+
- Model NodeType has a new parameter vm_image_plan
22+
- Model VMSSExtension has a new parameter setup_order
23+
324
## 2.0.0b4 (2023-05-20)
425

526
### Features Added

sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,3 @@ Code samples for this package can be found at:
5959
If you encounter any bugs or have suggestions, please file an issue in the
6060
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
6161
section of the project.
62-
63-
64-
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-servicefabricmanagedclusters%2FREADME.png)
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "e7e775e2f3fe00f25fbd0e7ca0d953e22eef93ff",
2+
"commit": "164375e67a1bffb207bcf603772c289dbe42d7b5",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.2",
4+
"autorest": "3.9.7",
55
"use": [
6-
"@autorest/python@6.4.8",
7-
"@autorest/modelerfour@4.24.3"
6+
"@autorest/python@6.7.1",
7+
"@autorest/modelerfour@4.26.2"
88
],
9-
"autorest_command": "autorest specification/servicefabricmanagedclusters/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.4.8 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/servicefabricmanagedclusters/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False",
1010
"readme": "specification/servicefabricmanagedclusters/resource-manager/readme.md"
1111
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"AssetsRepo": "Azure/azure-sdk-assets",
3+
"AssetsRepoPrefixPath": "python",
4+
"TagPrefix": "python/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters",
5+
"Tag": "python/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters_ea173c9b71"
6+
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ class ServiceFabricManagedClustersManagementClientConfiguration(
3131
:type credential: ~azure.core.credentials.TokenCredential
3232
:param subscription_id: The customer subscription identifier. Required.
3333
:type subscription_id: str
34-
:keyword api_version: Api Version. Default value is "2023-02-01-preview". Note that overriding
34+
:keyword api_version: Api Version. Default value is "2023-11-01-preview". Note that overriding
3535
this default value may result in unsupported behavior.
3636
:paramtype api_version: str
3737
"""
3838

3939
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
4040
super(ServiceFabricManagedClustersManagementClientConfiguration, self).__init__(**kwargs)
41-
api_version: str = kwargs.pop("api_version", "2023-02-01-preview")
41+
api_version: str = kwargs.pop("api_version", "2023-11-01-preview")
4242

4343
if credential is None:
4444
raise ValueError("Parameter 'credential' must not be None.")

sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/_serialization.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
662662
_serialized.update(_new_attr) # type: ignore
663663
_new_attr = _new_attr[k] # type: ignore
664664
_serialized = _serialized[k]
665-
except ValueError:
666-
continue
665+
except ValueError as err:
666+
if isinstance(err, SerializationError):
667+
raise
667668

668669
except (AttributeError, KeyError, TypeError) as err:
669670
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
@@ -741,6 +742,8 @@ def query(self, name, data, data_type, **kwargs):
741742
742743
:param data: The data to be serialized.
743744
:param str data_type: The type to be serialized from.
745+
:keyword bool skip_quote: Whether to skip quote the serialized result.
746+
Defaults to False.
744747
:rtype: str
745748
:raises: TypeError if serialization fails.
746749
:raises: ValueError if data is None
@@ -749,10 +752,8 @@ def query(self, name, data, data_type, **kwargs):
749752
# Treat the list aside, since we don't want to encode the div separator
750753
if data_type.startswith("["):
751754
internal_data_type = data_type[1:-1]
752-
data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data]
753-
if not kwargs.get("skip_quote", False):
754-
data = [quote(str(d), safe="") for d in data]
755-
return str(self.serialize_iter(data, internal_data_type, **kwargs))
755+
do_quote = not kwargs.get("skip_quote", False)
756+
return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs))
756757

757758
# Not a list, regular serialization
758759
output = self.serialize_data(data, data_type, **kwargs)
@@ -891,6 +892,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
891892
not be None or empty.
892893
:param str div: If set, this str will be used to combine the elements
893894
in the iterable into a combined string. Default is 'None'.
895+
:keyword bool do_quote: Whether to quote the serialized result of each iterable element.
896+
Defaults to False.
894897
:rtype: list, str
895898
"""
896899
if isinstance(data, str):
@@ -903,9 +906,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
903906
for d in data:
904907
try:
905908
serialized.append(self.serialize_data(d, iter_type, **kwargs))
906-
except ValueError:
909+
except ValueError as err:
910+
if isinstance(err, SerializationError):
911+
raise
907912
serialized.append(None)
908913

914+
if kwargs.get("do_quote", False):
915+
serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
916+
909917
if div:
910918
serialized = ["" if s is None else str(s) for s in serialized]
911919
serialized = div.join(serialized)
@@ -950,7 +958,9 @@ def serialize_dict(self, attr, dict_type, **kwargs):
950958
for key, value in attr.items():
951959
try:
952960
serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs)
953-
except ValueError:
961+
except ValueError as err:
962+
if isinstance(err, SerializationError):
963+
raise
954964
serialized[self.serialize_unicode(key)] = None
955965

956966
if "xml" in serialization_ctxt:

sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/_service_fabric_managed_clusters_management_client.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
ApplicationTypeVersionsOperations,
2020
ApplicationTypesOperations,
2121
ApplicationsOperations,
22+
ManagedApplyMaintenanceWindowOperations,
2223
ManagedAzResiliencyStatusOperations,
2324
ManagedClusterVersionOperations,
2425
ManagedClustersOperations,
26+
ManagedMaintenanceWindowStatusOperations,
2527
ManagedUnsupportedVMSizesOperations,
2628
NodeTypeSkusOperations,
2729
NodeTypesOperations,
@@ -36,7 +38,7 @@
3638
from azure.core.credentials import TokenCredential
3739

3840

39-
class ServiceFabricManagedClustersManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes,name-too-long
41+
class ServiceFabricManagedClustersManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
4042
"""Service Fabric Managed Clusters Management Client.
4143
4244
:ivar application_types: ApplicationTypesOperations operations
@@ -56,6 +58,12 @@ class ServiceFabricManagedClustersManagementClient: # pylint: disable=client-ac
5658
:ivar managed_az_resiliency_status: ManagedAzResiliencyStatusOperations operations
5759
:vartype managed_az_resiliency_status:
5860
azure.mgmt.servicefabricmanagedclusters.operations.ManagedAzResiliencyStatusOperations
61+
:ivar managed_maintenance_window_status: ManagedMaintenanceWindowStatusOperations operations
62+
:vartype managed_maintenance_window_status:
63+
azure.mgmt.servicefabricmanagedclusters.operations.ManagedMaintenanceWindowStatusOperations
64+
:ivar managed_apply_maintenance_window: ManagedApplyMaintenanceWindowOperations operations
65+
:vartype managed_apply_maintenance_window:
66+
azure.mgmt.servicefabricmanagedclusters.operations.ManagedApplyMaintenanceWindowOperations
5967
:ivar managed_cluster_version: ManagedClusterVersionOperations operations
6068
:vartype managed_cluster_version:
6169
azure.mgmt.servicefabricmanagedclusters.operations.ManagedClusterVersionOperations
@@ -81,7 +89,7 @@ class ServiceFabricManagedClustersManagementClient: # pylint: disable=client-ac
8189
:type subscription_id: str
8290
:param base_url: Service URL. Default value is "https://management.azure.com".
8391
:type base_url: str
84-
:keyword api_version: Api Version. Default value is "2023-02-01-preview". Note that overriding
92+
:keyword api_version: Api Version. Default value is "2023-11-01-preview". Note that overriding
8593
this default value may result in unsupported behavior.
8694
:paramtype api_version: str
8795
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -118,6 +126,12 @@ def __init__(
118126
self.managed_az_resiliency_status = ManagedAzResiliencyStatusOperations(
119127
self._client, self._config, self._serialize, self._deserialize
120128
)
129+
self.managed_maintenance_window_status = ManagedMaintenanceWindowStatusOperations(
130+
self._client, self._config, self._serialize, self._deserialize
131+
)
132+
self.managed_apply_maintenance_window = ManagedApplyMaintenanceWindowOperations(
133+
self._client, self._config, self._serialize, self._deserialize
134+
)
121135
self.managed_cluster_version = ManagedClusterVersionOperations(
122136
self._client, self._config, self._serialize, self._deserialize
123137
)

sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/_vendor.py

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

8-
from typing import List, cast
9-
108
from azure.core.pipeline.transport import HttpRequest
119

1210

@@ -16,15 +14,3 @@ def _convert_request(request, files=None):
1614
if files:
1715
request.set_formdata_body(files)
1816
return request
19-
20-
21-
def _format_url_section(template, **kwargs):
22-
components = template.split("/")
23-
while components:
24-
try:
25-
return template.format(**kwargs)
26-
except KeyError as key:
27-
# Need the cast, as for some reasons "split" is typed as list[str | Any]
28-
formatted_components = cast(List[str], template.split("/"))
29-
components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
30-
template = "/".join(components)

sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "2.0.0b4"
9+
VERSION = "2.0.0b5"

sdk/servicefabricmanagedclusters/azure-mgmt-servicefabricmanagedclusters/azure/mgmt/servicefabricmanagedclusters/aio/_configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ class ServiceFabricManagedClustersManagementClientConfiguration(
3131
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
3232
:param subscription_id: The customer subscription identifier. Required.
3333
:type subscription_id: str
34-
:keyword api_version: Api Version. Default value is "2023-02-01-preview". Note that overriding
34+
:keyword api_version: Api Version. Default value is "2023-11-01-preview". Note that overriding
3535
this default value may result in unsupported behavior.
3636
:paramtype api_version: str
3737
"""
3838

3939
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
4040
super(ServiceFabricManagedClustersManagementClientConfiguration, self).__init__(**kwargs)
41-
api_version: str = kwargs.pop("api_version", "2023-02-01-preview")
41+
api_version: str = kwargs.pop("api_version", "2023-11-01-preview")
4242

4343
if credential is None:
4444
raise ValueError("Parameter 'credential' must not be None.")

0 commit comments

Comments
 (0)