Skip to content

Commit

Permalink
[Network Manager] Init network manager extension (Azure#3946)
Browse files Browse the repository at this point in the history
network manager extension
  • Loading branch information
00Kai0 authored Oct 15, 2021
1 parent 7c23852 commit 076f5b3
Show file tree
Hide file tree
Showing 82 changed files with 24,765 additions and 0 deletions.
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

0 comments on commit 076f5b3

Please sign in to comment.