Skip to content

Commit c3680ca

Browse files
nafizhaider32nafizhaider
andauthored
Uplift NetworkFabric Changes with bugfix and 7.1 CLI (#8487)
* updated network fabric extension to reflect version 2024-02-15-preview * updates based on code review * version updated to 7.0.0 * fix linting * new api changes * Update for bugfix with 7.1 CLI * fixing lint issue * aligning with new api short description * reverting version change --------- Co-authored-by: nafizhaider <nafizhaider@microsoft.com>
1 parent 07f9bb6 commit c3680ca

8 files changed

Lines changed: 1534 additions & 47 deletions

File tree

src/managednetworkfabric/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+
7.1.0
7+
++++++
8+
* Bug fix: expose the 'update-admin-state' command for the 'interface' resource that was removed from the CLI by invalid post-processing logic.
9+
610
7.0.0
711
++++++
812
* This version requires a minimum of 2.66 Azure core CLI. See release notes for more details: https://github.com/MicrosoftDocs/azure-docs-cli/blob/main/docs-ref-conceptual/release-notes-azure-cli.md

src/managednetworkfabric/azext_managednetworkfabric/aaz/latest/networkfabric/device/_update.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
7878
_args_schema.host_name = AAZStrArg(
7979
options=["--host-name"],
8080
arg_group="Properties",
81-
help="The Host Name of the device. All Network Device names should follow the format `<Fabric Name>-<Rack Type>-<Device Type>`. Example: AustinNF-AR-CE1.",
81+
help="The host name of the device.",
8282
fmt=AAZStrArgFormat(
8383
min_length=1,
8484
),

src/managednetworkfabric/azext_managednetworkfabric/aaz/latest/networkfabric/interface/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
from ._delete import *
1313
from ._list import *
1414
from ._show import *
15+
from ._update_admin_state import *
1516
from ._wait import *

src/managednetworkfabric/azext_managednetworkfabric/tests/latest/config.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static_route_conf="{ipv4Routes:[{prefix:'10.18.128.0/24',nextHop:['10.18.32.8']}
170170
updated_static_route_conf="{ipv4Routes:[{prefix:'10.18.128.0/24',nextHop:['10.18.32.8']}]}"
171171
bgp_conf="{defaultRouteOriginate:'True',allowAS:2,allowASOverride:'Enable',peerASN:65055,ipv4ListenRangePrefixes:['10.18.32.0/28'],ipv4NeighborAddress:[{address:'10.18.32.8'}]}"
172172
updated_bgp_conf="{defaultRouteOriginate:'True',allowAS:2,allowASOverride:'Enable',peerASN:65055,ipv4ListenRangePrefixes:['10.18.32.0/28'],ipv4NeighborAddress:[{address:'10.18.32.8'}]}"
173-
import_route_policy="null"
173+
import_route_policy="{importIpv4RoutePolicyId:'/subscriptions//resourceGroups/100GFABNFRG-eus/providers/Microsoft.ManagedNetworkFabric/routePolicies/nfa-tool-ts-cli-4-2-routePolicy',importIpv6RoutePolicyId:'/subscriptions//resourceGroups/100GFABNFRG-eus/providers/Microsoft.ManagedNetworkFabric/routePolicies/nfa-tool-ts-cli-4-2-routePolicy'}"
174174
export_route_policy="null"
175175

176176
[EXTERNAL_NETWORK]
@@ -183,8 +183,8 @@ updateResourceGroup="tfranklandVLab"
183183
s1_peering_option="OptionB"
184184
s2_peering_option="OptionA"
185185
nni_Id="/subscriptions//resourcegroups/Fab3LabNF-5-1/providers/microsoft.managednetworkfabric/networkfabrics/nffab3-5-1/networkToNetworkInterconnects/nffab3-5-1-nni-acl-rcf"
186-
import_route_policy="null"
187-
export_route_policy="null"
186+
import_route_policy="{importIpv4RoutePolicyId:'/subscriptions//resourceGroups/100GFABNFRG-eus/providers/Microsoft.ManagedNetworkFabric/routePolicies/nfa-tool-ts-cli-4-2-routePolicy',importIpv6RoutePolicyId:'/subscriptions//resourceGroups/100GFABNFRG-eus/providers/Microsoft.ManagedNetworkFabric/routePolicies/nfa-tool-ts-cli-4-2-routePolicy'}"
187+
export_route_policy="{exportIpv4RoutePolicyId:'/subscriptions//resourceGroups/100GFABNFRG-eus/providers/Microsoft.ManagedNetworkFabric/routePolicies/nfa-tool-ts-cli-4-2-routePolicy',exportIpv6RoutePolicyId:'/subscriptions//resourceGroups/100GFABNFRG-eus/providers/Microsoft.ManagedNetworkFabric/routePolicies/nfa-tool-ts-cli-4-2-routePolicy'}"
188188
option_b_properties="{routeTargets:{exportIpv4RouteTargets:['65046:10039'],exportIpv6RouteTargets:['65046:10039'],importIpv4RouteTargets:['65046:10039'],importIpv6RouteTargets:['65046:10039']}}"
189189
updated_option_b_properties="{routeTargets:{exportIpv4RouteTargets:['65046:10039'],exportIpv6RouteTargets:['65046:10039'],importIpv4RouteTargets:['65046:10039'],importIpv6RouteTargets:['65541:12601']}}"
190190
option_a_properties="{peerASN:65048,vlanId:2091,mtu:1500,primaryIpv4Prefix:'10.18.35.0/24',primaryIpv6Prefix:'fda0:d59c:da02:23::/127',secondaryIpv4Prefix:'10.18.36.0/24',secondaryIpv6Prefix:'fda0:d59c:da02:24::/127'}"

src/managednetworkfabric/azext_managednetworkfabric/tests/latest/recordings/test_GA_accesscontrollists_scenario1.yaml

Lines changed: 100 additions & 42 deletions
Large diffs are not rendered by default.

src/managednetworkfabric/azext_managednetworkfabric/tests/latest/recordings/test_GA_interface_enable_disable_scenario1.yaml

Lines changed: 1354 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
#
5+
# --------------------------------------------------------------------------------------------
6+
# pylint: disable=too-few-public-methods,unnecessary-pass,unused-argument
7+
8+
"""
9+
Interface tests scenarios
10+
"""
11+
12+
from azure.cli.testsdk import ScenarioTest
13+
14+
from .config import CONFIG
15+
16+
17+
def setup_scenario1(test):
18+
"""Env setup_scenario1"""
19+
pass
20+
21+
22+
def cleanup_scenario1(test):
23+
"""Env cleanup_scenario1"""
24+
pass
25+
26+
27+
def call_scenario1(test):
28+
"""# Testcase: scenario1"""
29+
setup_scenario1(test)
30+
step_update_admin_state_Enable(test, checks=[])
31+
step_update_admin_state_Disable(test, checks=[])
32+
cleanup_scenario1(test)
33+
34+
35+
def step_update_admin_state_Enable(test, checks=None):
36+
"""interface Update admin state operation"""
37+
if checks is None:
38+
checks = []
39+
test.cmd(
40+
"az networkfabric interface update-admin-state --resource-group {rg} --resource-name {name} --state {state_Enable} --device {device_name}"
41+
)
42+
43+
44+
def step_update_admin_state_Disable(test, checks=None):
45+
"""interface Update admin state operation"""
46+
if checks is None:
47+
checks = []
48+
test.cmd(
49+
"az networkfabric interface update-admin-state --resource-group {rg} --resource-name {name} --state {state_Disable} --device {device_name}"
50+
)
51+
52+
53+
class GA_interfaceEnableDisableScenarioTest1(ScenarioTest):
54+
"""Interface Scenario test"""
55+
56+
def __init__(self, *args, **kwargs):
57+
super().__init__(*args, **kwargs)
58+
self.kwargs.update(
59+
{
60+
"rg": CONFIG.get("NETWORK_INTERFACE", "resource_group"),
61+
"name": CONFIG.get("NETWORK_INTERFACE", "name"),
62+
"device_name": CONFIG.get("NETWORK_INTERFACE", "device_name"),
63+
"state_Enable": CONFIG.get("NETWORK_INTERFACE", "state_Enable"),
64+
"state_Disable": CONFIG.get("NETWORK_INTERFACE", "state_Disable"),
65+
}
66+
)
67+
68+
def test_GA_interface_enable_disable_scenario1(self):
69+
"""test scenario for Interface CRUD operations"""
70+
call_scenario1(self)

src/managednetworkfabric/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
# HISTORY.rst entry.
13-
VERSION = '7.0.0'
13+
VERSION = '7.1.0'
1414

1515
# The full list of classifiers is available at
1616
# https://pypi.python.org/pypi?%3Aaction=list_classifiers

0 commit comments

Comments
 (0)