Skip to content

Commit ce3559e

Browse files
sonalsingh-msftSonal Singh (from Dev Box)Copilot
authored
Update AVNM connectivity configuration CLI to use 2024-07-01 API version (#9125)
* Generated Azure CLI extension changes * Resolve errors in test files * Add passing tests * Fix connect-config parameter applies-to-groups * Update src/network-manager/azext_network_manager/aaz/latest/network/manager/connect_config/_create.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/network-manager/azext_network_manager/aaz/latest/network/manager/connect_config/_update.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Passing local tests * Add parameter options to connect-config * Increment versio in HISTORT.rst * Add singular option for applies to groups * Fix update.py * fix conflicting options for connect-config * fix conflicting options for connect-config * Fix tests to set connect-config singular options * update version to 3.0.0 in setup.py * update version to 3.0.0 in HISTORY.rst * Fix breaking changes related to network manager paramter * Release version fix --------- Co-authored-by: Sonal Singh (from Dev Box) <sonalsingh@microsoft.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 383c6d9 commit ce3559e

File tree

16 files changed

+1305
-130
lines changed

16 files changed

+1305
-130
lines changed

src/network-manager/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
Release History
44
===============
55

6+
3.0.0
7+
+++++
8+
* Add new parameter connect-capabilities to cmd `az network manager connect-config`
9+
610
2.0.1
711
+++++
812
* Fix the post commit commands for AVNM configuration (All config types)

src/network-manager/azext_network_manager/aaz/latest/network/manager/__cmd_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"network manager",
1616
)
1717
class __CMDGroup(AAZCommandGroup):
18-
"""Manage network-manager with network.
18+
"""Manage Network Manager
1919
"""
2020
pass
2121

src/network-manager/azext_network_manager/aaz/latest/network/manager/connect_config/__cmd_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"network manager connect-config",
1616
)
1717
class __CMDGroup(AAZCommandGroup):
18-
"""Manage connectivity configuration with network.
18+
"""Manage Connectivity Configuration
1919
"""
2020
pass
2121

src/network-manager/azext_network_manager/aaz/latest/network/manager/connect_config/_create.py

Lines changed: 64 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,12 @@
1616
)
1717
class Create(AAZCommand):
1818
"""Create a new network manager connectivity configuration
19-
20-
:example: Create/Update Azure Virtual Network Manager Connectivity Configuration
21-
az network manager connect-config create --configuration-name "myTestConnectivityConfig" --description "Sample Configuration" --applies-to-group group-connectivity="None" is-global=false network-group-id="/subscriptions/subscriptionA/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkManagerGroups/group1" use-hub-gateway=true --connectivity-topology "HubAndSpoke" --delete-existing-peering true --hub resource-id="subscriptions/subscriptionA/resourceGroups/myResourceGroup/providers/Micr osoft.Network/virtualNetworks/myTestConnectivityConfig" resource- type="Microsoft.Network/virtualNetworks" --is-global true --network-manager-name "testNetworkManager" --resource-group "myResourceGroup"
2219
"""
2320

2421
_aaz_info = {
25-
"version": "2022-01-01",
22+
"version": "2024-07-01",
2623
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkmanagers/{}/connectivityconfigurations/{}", "2022-01-01"],
24+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkmanagers/{}/connectivityconfigurations/{}", "2024-07-01"],
2825
]
2926
}
3027

@@ -50,7 +47,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
5047
required=True,
5148
)
5249
_args_schema.network_manager_name = AAZStrArg(
53-
options=["-n", "--name", "--network-manager-name"],
50+
options=["--name", "--network-manager-name", "-n"],
5451
help="The name of the network manager.",
5552
required=True,
5653
)
@@ -67,6 +64,11 @@ def _build_arguments_schema(cls, *args, **kwargs):
6764
arg_group="Properties",
6865
help="Groups for configuration",
6966
)
67+
_args_schema.connect_capabilities = AAZObjectArg(
68+
options=["--connect-capabilities"],
69+
arg_group="Properties",
70+
help="Collection of additional settings to enhance specific topology behaviors of the connectivity configuration resource.",
71+
)
7072
_args_schema.connectivity_topology = AAZStrArg(
7173
options=["--connectivity-topology"],
7274
arg_group="Properties",
@@ -103,13 +105,13 @@ def _build_arguments_schema(cls, *args, **kwargs):
103105
_element = cls._args_schema.applies_to_groups.Element
104106
_element.group_connectivity = AAZStrArg(
105107
options=["group-connectivity"],
106-
help="Group connectivity type. Only required if topology is Hub and Spoke.",
108+
help="Group connectivity type.",
107109
required=True,
108110
enum={"DirectlyConnected": "DirectlyConnected", "None": "None"},
109111
)
110112
_element.is_global = AAZStrArg(
111113
options=["is-global"],
112-
help="Flag if global is supported. Only required if topology is Hub and Spoke.",
114+
help="Flag if global is supported.",
113115
enum={"False": "False", "True": "True"},
114116
)
115117
_element.network_group_id = AAZStrArg(
@@ -119,10 +121,33 @@ def _build_arguments_schema(cls, *args, **kwargs):
119121
)
120122
_element.use_hub_gateway = AAZStrArg(
121123
options=["use-hub-gateway"],
122-
help="Flag if need to use hub gateway. Only required if topology is Hub and Spoke.",
124+
help="Flag if need to use hub gateway.",
123125
enum={"False": "False", "True": "True"},
124126
)
125127

128+
connect_capabilities = cls._args_schema.connect_capabilities
129+
connect_capabilities.connected_group_address_overlap = AAZStrArg(
130+
options=["connected-group-address-overlap"],
131+
help="Behavior to handle overlapped IP address space among members of the connected group of the connectivity configuration.",
132+
required=True,
133+
default="Allowed",
134+
enum={"Allowed": "Allowed", "Disallowed": "Disallowed"},
135+
)
136+
connect_capabilities.connected_group_private_endpoints_scale = AAZStrArg(
137+
options=["connected-group-private-endpoints-scale"],
138+
help="Option indicating the scale of private endpoints allowed in the connected group of the connectivity configuration.",
139+
required=True,
140+
default="Standard",
141+
enum={"HighScale": "HighScale", "Standard": "Standard"},
142+
)
143+
connect_capabilities.peering_enforcement = AAZStrArg(
144+
options=["peering-enforcement"],
145+
help="Option indicating enforcement of peerings created by the connectivity configuration.",
146+
required=True,
147+
default="Unenforced",
148+
enum={"Enforced": "Enforced", "Unenforced": "Unenforced"},
149+
)
150+
126151
hubs = cls._args_schema.hubs
127152
hubs.Element = AAZObjectArg()
128153

@@ -133,7 +158,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
133158
)
134159
_element.resource_type = AAZStrArg(
135160
options=["resource-type"],
136-
help="Resource Type, suggested value(s): 'Microsoft.Network/virtualNetworks'",
161+
help="Resource Type.",
137162
)
138163
return cls._args_schema
139164

@@ -206,7 +231,7 @@ def url_parameters(self):
206231
def query_parameters(self):
207232
parameters = {
208233
**self.serialize_query_param(
209-
"api-version", "2022-01-01",
234+
"api-version", "2024-07-01",
210235
required=True,
211236
),
212237
}
@@ -236,6 +261,7 @@ def content(self):
236261
properties = _builder.get(".properties")
237262
if properties is not None:
238263
properties.set_prop("appliesToGroups", AAZListType, ".applies_to_groups", typ_kwargs={"flags": {"required": True}})
264+
properties.set_prop("connectivityCapabilities", AAZObjectType, ".connect_capabilities")
239265
properties.set_prop("connectivityTopology", AAZStrType, ".connectivity_topology", typ_kwargs={"flags": {"required": True}})
240266
properties.set_prop("deleteExistingPeering", AAZStrType, ".delete_existing_peering")
241267
properties.set_prop("description", AAZStrType, ".description")
@@ -253,6 +279,12 @@ def content(self):
253279
_elements.set_prop("networkGroupId", AAZStrType, ".network_group_id", typ_kwargs={"flags": {"required": True}})
254280
_elements.set_prop("useHubGateway", AAZStrType, ".use_hub_gateway")
255281

282+
connectivity_capabilities = _builder.get(".properties.connectivityCapabilities")
283+
if connectivity_capabilities is not None:
284+
connectivity_capabilities.set_prop("connectedGroupAddressOverlap", AAZStrType, ".connected_group_address_overlap", typ_kwargs={"flags": {"required": True}})
285+
connectivity_capabilities.set_prop("connectedGroupPrivateEndpointsScale", AAZStrType, ".connected_group_private_endpoints_scale", typ_kwargs={"flags": {"required": True}})
286+
connectivity_capabilities.set_prop("peeringEnforcement", AAZStrType, ".peering_enforcement", typ_kwargs={"flags": {"required": True}})
287+
256288
hubs = _builder.get(".properties.hubs")
257289
if hubs is not None:
258290
hubs.set_elements(AAZObjectType, ".")
@@ -307,6 +339,9 @@ def _build_schema_on_200_201(cls):
307339
serialized_name="appliesToGroups",
308340
flags={"required": True},
309341
)
342+
properties.connectivity_capabilities = AAZObjectType(
343+
serialized_name="connectivityCapabilities",
344+
)
310345
properties.connectivity_topology = AAZStrType(
311346
serialized_name="connectivityTopology",
312347
flags={"required": True},
@@ -323,6 +358,10 @@ def _build_schema_on_200_201(cls):
323358
serialized_name="provisioningState",
324359
flags={"read_only": True},
325360
)
361+
properties.resource_guid = AAZStrType(
362+
serialized_name="resourceGuid",
363+
flags={"read_only": True},
364+
)
326365

327366
applies_to_groups = cls._schema_on_200_201.properties.applies_to_groups
328367
applies_to_groups.Element = AAZObjectType()
@@ -343,6 +382,20 @@ def _build_schema_on_200_201(cls):
343382
serialized_name="useHubGateway",
344383
)
345384

385+
connectivity_capabilities = cls._schema_on_200_201.properties.connectivity_capabilities
386+
connectivity_capabilities.connected_group_address_overlap = AAZStrType(
387+
serialized_name="connectedGroupAddressOverlap",
388+
flags={"required": True},
389+
)
390+
connectivity_capabilities.connected_group_private_endpoints_scale = AAZStrType(
391+
serialized_name="connectedGroupPrivateEndpointsScale",
392+
flags={"required": True},
393+
)
394+
connectivity_capabilities.peering_enforcement = AAZStrType(
395+
serialized_name="peeringEnforcement",
396+
flags={"required": True},
397+
)
398+
346399
hubs = cls._schema_on_200_201.properties.hubs
347400
hubs.Element = AAZObjectType()
348401

src/network-manager/azext_network_manager/aaz/latest/network/manager/connect_config/_delete.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,12 @@
1717
)
1818
class Delete(AAZCommand):
1919
"""Delete a network manager connectivity configuration, specified by the resource group, network manager name, and connectivity configuration name
20-
21-
:example: Delete Azure Virtual Network Manager Connectivity Configuration
22-
az network manager connect-config delete --configuration-name "myTestConnectivityConfig" --network-manager-name "testNetworkManager" --resource-group "myResourceGroup"
2320
"""
2421

2522
_aaz_info = {
26-
"version": "2022-01-01",
23+
"version": "2024-07-01",
2724
"resources": [
28-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkmanagers/{}/connectivityconfigurations/{}", "2022-01-01"],
25+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkmanagers/{}/connectivityconfigurations/{}", "2024-07-01"],
2926
]
3027
}
3128

@@ -53,7 +50,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
5350
id_part="child_name_1",
5451
)
5552
_args_schema.network_manager_name = AAZStrArg(
56-
options=["-n", "--name", "--network-manager-name"],
53+
options=["--name", "--network-manager-name", "-n"],
5754
help="The name of the network manager.",
5855
required=True,
5956
id_part="name",
@@ -160,7 +157,7 @@ def query_parameters(self):
160157
"force", self.ctx.args.force,
161158
),
162159
**self.serialize_query_param(
163-
"api-version", "2022-01-01",
160+
"api-version", "2024-07-01",
164161
required=True,
165162
),
166163
}

src/network-manager/azext_network_manager/aaz/latest/network/manager/connect_config/_list.py

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,12 @@
1616
)
1717
class List(AAZCommand):
1818
"""List all the network manager connectivity configuration in a specified network manager.
19-
20-
:example: List Azure Virtual Network Manager Connecitivity Configuration
21-
az network manager connect-config list --network-manager-name "testNetworkManager" --resource-group "myResourceGroup"
2219
"""
2320

2421
_aaz_info = {
25-
"version": "2022-01-01",
22+
"version": "2024-07-01",
2623
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkmanagers/{}/connectivityconfigurations", "2022-01-01"],
24+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkmanagers/{}/connectivityconfigurations", "2024-07-01"],
2825
]
2926
}
3027

@@ -46,7 +43,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
4643

4744
_args_schema = cls._args_schema
4845
_args_schema.network_manager_name = AAZStrArg(
49-
options=["-n", "--name", "--network-manager-name"],
46+
options=["--name", "--network-manager-name", "-n"],
5047
help="The name of the network manager.",
5148
required=True,
5249
)
@@ -139,7 +136,7 @@ def query_parameters(self):
139136
"$top", self.ctx.args.top,
140137
),
141138
**self.serialize_query_param(
142-
"api-version", "2022-01-01",
139+
"api-version", "2024-07-01",
143140
required=True,
144141
),
145142
}
@@ -206,6 +203,9 @@ def _build_schema_on_200(cls):
206203
serialized_name="appliesToGroups",
207204
flags={"required": True},
208205
)
206+
properties.connectivity_capabilities = AAZObjectType(
207+
serialized_name="connectivityCapabilities",
208+
)
209209
properties.connectivity_topology = AAZStrType(
210210
serialized_name="connectivityTopology",
211211
flags={"required": True},
@@ -222,6 +222,10 @@ def _build_schema_on_200(cls):
222222
serialized_name="provisioningState",
223223
flags={"read_only": True},
224224
)
225+
properties.resource_guid = AAZStrType(
226+
serialized_name="resourceGuid",
227+
flags={"read_only": True},
228+
)
225229

226230
applies_to_groups = cls._schema_on_200.value.Element.properties.applies_to_groups
227231
applies_to_groups.Element = AAZObjectType()
@@ -242,6 +246,20 @@ def _build_schema_on_200(cls):
242246
serialized_name="useHubGateway",
243247
)
244248

249+
connectivity_capabilities = cls._schema_on_200.value.Element.properties.connectivity_capabilities
250+
connectivity_capabilities.connected_group_address_overlap = AAZStrType(
251+
serialized_name="connectedGroupAddressOverlap",
252+
flags={"required": True},
253+
)
254+
connectivity_capabilities.connected_group_private_endpoints_scale = AAZStrType(
255+
serialized_name="connectedGroupPrivateEndpointsScale",
256+
flags={"required": True},
257+
)
258+
connectivity_capabilities.peering_enforcement = AAZStrType(
259+
serialized_name="peeringEnforcement",
260+
flags={"required": True},
261+
)
262+
245263
hubs = cls._schema_on_200.value.Element.properties.hubs
246264
hubs.Element = AAZObjectType()
247265

src/network-manager/azext_network_manager/aaz/latest/network/manager/connect_config/_show.py

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,12 @@
1616
)
1717
class Show(AAZCommand):
1818
"""Get a Network Connectivity Configuration, specified by the resource group, network manager name, and connectivity Configuration name
19-
20-
:example: Get Azure Virtual Network Manager Connectivity Configuration
21-
az network manager connect-config show --configuration-name "myTestConnectivityConfig" --network-manager-name "testNetworkManager" --resource-group "myResourceGroup"
2219
"""
2320

2421
_aaz_info = {
25-
"version": "2022-01-01",
22+
"version": "2024-07-01",
2623
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkmanagers/{}/connectivityconfigurations/{}", "2022-01-01"],
24+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkmanagers/{}/connectivityconfigurations/{}", "2024-07-01"],
2825
]
2926
}
3027

@@ -51,7 +48,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
5148
id_part="child_name_1",
5249
)
5350
_args_schema.network_manager_name = AAZStrArg(
54-
options=["-n", "--name", "--network-manager-name"],
51+
options=["--name", "--network-manager-name", "-n"],
5552
help="The name of the network manager.",
5653
required=True,
5754
id_part="name",
@@ -130,7 +127,7 @@ def url_parameters(self):
130127
def query_parameters(self):
131128
parameters = {
132129
**self.serialize_query_param(
133-
"api-version", "2022-01-01",
130+
"api-version", "2024-07-01",
134131
required=True,
135132
),
136133
}
@@ -188,6 +185,9 @@ def _build_schema_on_200(cls):
188185
serialized_name="appliesToGroups",
189186
flags={"required": True},
190187
)
188+
properties.connectivity_capabilities = AAZObjectType(
189+
serialized_name="connectivityCapabilities",
190+
)
191191
properties.connectivity_topology = AAZStrType(
192192
serialized_name="connectivityTopology",
193193
flags={"required": True},
@@ -204,6 +204,10 @@ def _build_schema_on_200(cls):
204204
serialized_name="provisioningState",
205205
flags={"read_only": True},
206206
)
207+
properties.resource_guid = AAZStrType(
208+
serialized_name="resourceGuid",
209+
flags={"read_only": True},
210+
)
207211

208212
applies_to_groups = cls._schema_on_200.properties.applies_to_groups
209213
applies_to_groups.Element = AAZObjectType()
@@ -224,6 +228,20 @@ def _build_schema_on_200(cls):
224228
serialized_name="useHubGateway",
225229
)
226230

231+
connectivity_capabilities = cls._schema_on_200.properties.connectivity_capabilities
232+
connectivity_capabilities.connected_group_address_overlap = AAZStrType(
233+
serialized_name="connectedGroupAddressOverlap",
234+
flags={"required": True},
235+
)
236+
connectivity_capabilities.connected_group_private_endpoints_scale = AAZStrType(
237+
serialized_name="connectedGroupPrivateEndpointsScale",
238+
flags={"required": True},
239+
)
240+
connectivity_capabilities.peering_enforcement = AAZStrType(
241+
serialized_name="peeringEnforcement",
242+
flags={"required": True},
243+
)
244+
227245
hubs = cls._schema_on_200.properties.hubs
228246
hubs.Element = AAZObjectType()
229247

0 commit comments

Comments
 (0)