Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Network Manager] Init network manager extension #3946

Merged
merged 30 commits into from
Oct 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
da51267
start to add tests for network manager
kairu-ms Jul 21, 2021
6e1b8c8
add tests
kairu-ms Jul 21, 2021
931c291
update location definition
kairu-ms Jul 22, 2021
ce2f081
update location definition
kairu-ms Jul 22, 2021
3efe513
add nm basic crud test
00Kai0 Aug 25, 2021
677856d
regen vendor sdk
00Kai0 Aug 30, 2021
4bde178
add test for group, adminconfig, userconfig
00Kai0 Aug 30, 2021
fdfaafe
complete command set
00Kai0 Sep 3, 2021
9b83993
regen sdk
00Kai0 Sep 6, 2021
49e9b2b
sort client_factory
00Kai0 Sep 22, 2021
18b2563
remove unused command and fix testcase
00Kai0 Sep 23, 2021
96af50b
fix datetime string in systemdata
00Kai0 Sep 29, 2021
f3d34bc
test plan
00Kai0 Sep 29, 2021
cdeca48
test admin-rule
00Kai0 Oct 8, 2021
0b94a11
test user rule collection
00Kai0 Oct 8, 2021
669a93a
test user rule
00Kai0 Oct 8, 2021
3889e39
test connection configuration
00Kai0 Oct 9, 2021
323f4f0
test other list options
00Kai0 Oct 11, 2021
2b517d1
fix
00Kai0 Oct 11, 2021
3e2701c
fix
00Kai0 Oct 11, 2021
e1935e8
fix
00Kai0 Oct 11, 2021
c4e067d
Merge remote-tracking branch 'origin/main' into feature-network-manag…
00Kai0 Oct 11, 2021
f580a67
fix
00Kai0 Oct 11, 2021
58ae053
fix
00Kai0 Oct 12, 2021
ed48b4b
enable test for effect-vent list-by-network-manager
00Kai0 Oct 13, 2021
e853d8f
change operation names
00Kai0 Oct 14, 2021
bafd7b2
fix
00Kai0 Oct 14, 2021
0a65053
fix
00Kai0 Oct 14, 2021
bc97df3
Merge remote-tracking branch 'origin/main' into feature-network-manag…
00Kai0 Oct 14, 2021
1e041b9
fix
00Kai0 Oct 14, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@

/src/netappfiles-preview/ @b-lefr

/src/network-manager/ @kairu-ms @jsntcy

/src/healthcareapis/ @fengzhou-msft @iviark

/src/healthbot/ @guy-microsoft
Expand Down
8 changes: 8 additions & 0 deletions src/network-manager/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. :changelog:

Release History
===============

0.1.0
++++++
* Initial release.
13 changes: 13 additions & 0 deletions src/network-manager/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Azure CLI network Extension #
This is the extension for network

### How to use ###
Install this extension using the below CLI command
```
az extension add --name network-manager
```

Then, call it as you would any other az command:
```
az network manager -h
```
37 changes: 37 additions & 0 deletions src/network-manager/azext_network_manager/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader
import azext_network_manager._help


class NetworkManagementClientCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from azext_network_manager._client_factory import cf_network_cl
network_custom = CliCommandType(
operations_tmpl='azext_network_manager.custom#{}',
client_factory=cf_network_cl)
super(NetworkManagementClientCommandsLoader, self).__init__(
cli_ctx=cli_ctx,
custom_command_type=network_custom)

def load_command_table(self, args):
from azext_network_manager.commands import load_command_table
load_command_table(self, args)
return self.command_table

def load_arguments(self, command):
from azext_network_manager._params import load_arguments
load_arguments(self, command)


COMMAND_LOADER_CLS = NetworkManagementClientCommandsLoader
83 changes: 83 additions & 0 deletions src/network-manager/azext_network_manager/_client_factory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------


def cf_network_cl(cli_ctx, *_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azext_network_manager.vendored_sdks import NetworkManagementClient
return get_mgmt_service_client(cli_ctx, NetworkManagementClient)


def cf_activeconnectivityconfiguration(cli_ctx, *_):
return cf_network_cl(cli_ctx).active_connectivity_configurations


def cf_activesecurityadminrule(cli_ctx, *_):
return cf_network_cl(cli_ctx).active_security_admin_rules


def cf_activesecurityuserrule(cli_ctx, *_):
return cf_network_cl(cli_ctx).active_security_user_rules


def cf_adminrulecollection(cli_ctx, *_):
return cf_network_cl(cli_ctx).admin_rule_collections


def cf_adminrule(cli_ctx, *_):
return cf_network_cl(cli_ctx).admin_rules


def cf_connectivityconfiguration(cli_ctx, *_):
return cf_network_cl(cli_ctx).connectivity_configurations


def cf_effectiveconnectivityconfiguration(cli_ctx, *_):
return cf_network_cl(cli_ctx).effective_connectivity_configurations


def cf_effectivevirtualnetwork(cli_ctx, *_):
return cf_network_cl(cli_ctx).effective_virtual_networks


def cf_networkgroup(cli_ctx, *_):
return cf_network_cl(cli_ctx).network_groups


def cf_networkmanagercommit(cli_ctx, *_):
return cf_network_cl(cli_ctx).network_manager_commits


def cf_networkmanagerdeploymentstatus(cli_ctx, *_):
return cf_network_cl(cli_ctx).network_manager_deployment_status


def cf_effectivesecurityadminrule(cli_ctx, *_):
return cf_network_cl(cli_ctx).network_manager_effective_security_admin_rules


def cf_networkmanager(cli_ctx, *_):
return cf_network_cl(cli_ctx).network_managers


def cf_securityadminconfiguration(cli_ctx, *_):
return cf_network_cl(cli_ctx).security_admin_configurations


def cf_securityuserconfiguration(cli_ctx, *_):
return cf_network_cl(cli_ctx).security_user_configurations


def cf_userrulecollection(cli_ctx, *_):
return cf_network_cl(cli_ctx).user_rule_collections


def cf_userrule(cli_ctx, *_):
return cf_network_cl(cli_ctx).user_rules
Loading