Skip to content

Commit

Permalink
[Nginx] Add NGINX CLI (Azure#5305)
Browse files Browse the repository at this point in the history
* [Nginx] Add NGINX cli

* Update

* Add missing queryparam api-version;Write tests for deployment create,update,show,list

* commit recordings;add apiversion query param to cert actions;add tests for certificates

* delete recordings

* make cert tests work

* add config apiversion query params;add config tests; test recording

* fix conflict in owners

* fix github owners conflict; remove deprecated test

* add new line

* add new line

* make lint changes;add fresh test recordings

* add az nginx to service names

* Update src/nginx/setup.py

Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com>

* Update src/nginx/azext_nginx/azext_metadata.json

Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com>

* Remove policy.json test generated file

* edit src/nginx/azext_nginx/_help.py as not required

* remove cmds in params.py

* Add help

* not experimental

* fix linter issues

* fix linter white space issues

* fix linter white space issues

* Add link for sku

* Update src/nginx/azext_nginx/azext_metadata.json

Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com>

* help cmds from aaz models;new test recording

* Remove paramter info

* Remove policy generated file

* Update src/nginx/azext_nginx/aaz/latest/nginx/deployment/configuration/_create.py

Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com>

* Update src/nginx/azext_nginx/aaz/latest/nginx/deployment/configuration/_update.py

Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com>

* Update src/nginx/azext_nginx/aaz/latest/nginx/deployment/_update.py

Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com>

* Use shorthand syntax expression

* Give meaningful update examples

Co-authored-by: George Ngugi <georgengugi@microsoft.com>
Co-authored-by: george-ngugi <99010422+george-ngugi@users.noreply.github.com>
Co-authored-by: kai ru <69238381+kairu-ms@users.noreply.github.com>
  • Loading branch information
4 people authored Sep 27, 2022
1 parent 6f45ef4 commit f947976
Show file tree
Hide file tree
Showing 43 changed files with 10,376 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,6 @@

/src/fleet/ @pdaru

/src/traffic-collector/ @rmodh @japani @kukulkarni1
/src/traffic-collector/ @rmodh @japani @kukulkarni1

/src/nginx/ @liftr-nginx
8 changes: 8 additions & 0 deletions src/nginx/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. :changelog:
Release History
===============

0.1.0
++++++
* Initial release.
5 changes: 5 additions & 0 deletions src/nginx/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Microsoft Azure CLI 'nginx' Extension
==========================================

This package is for the 'nginx' extension.
i.e. 'az nginx'
41 changes: 41 additions & 0 deletions src/nginx/azext_nginx/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader

from azext_nginx._help import helps # pylint: disable=unused-import


class NginxCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
nginx_custom = CliCommandType(
operations_tmpl='azext_nginx.custom#{}')
super(NginxCommandsLoader, self).__init__(cli_ctx=cli_ctx,
custom_command_type=nginx_custom)

def load_command_table(self, args):
from azext_nginx.commands import load_command_table
from azure.cli.core.aaz import load_aaz_command_table
try:
from . import aaz
except ImportError:
aaz = None
if aaz:
load_aaz_command_table(
loader=self,
aaz_pkg_name=aaz.__name__,
args=args
)
load_command_table(self, args)
return self.command_table

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


COMMAND_LOADER_CLS = NginxCommandsLoader
11 changes: 11 additions & 0 deletions src/nginx/azext_nginx/_help.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# --------------------------------------------------------------------------------------------
# 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 aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: disable=line-too-long
# pylint: disable=too-many-lines

from knack.help_files import helps # pylint: disable=unused-import
11 changes: 11 additions & 0 deletions src/nginx/azext_nginx/_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# pylint: disable=line-too-long

from knack.arguments import CLIArgumentType


def load_arguments(self, _): # pylint: disable=unused-argument
pass
6 changes: 6 additions & 0 deletions src/nginx/azext_nginx/aaz/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# --------------------------------------------------------------------------------------------
# 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 aaz-dev-tools
# --------------------------------------------------------------------------------------------
6 changes: 6 additions & 0 deletions src/nginx/azext_nginx/aaz/latest/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# --------------------------------------------------------------------------------------------
# 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 aaz-dev-tools
# --------------------------------------------------------------------------------------------
23 changes: 23 additions & 0 deletions src/nginx/azext_nginx/aaz/latest/nginx/__cmd_group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# --------------------------------------------------------------------------------------------
# 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 aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from azure.cli.core.aaz import *


@register_command_group(
"nginx",
)
class __CMDGroup(AAZCommandGroup):
"""Manage NGINX deployment resources
"""
pass


__all__ = ["__CMDGroup"]
11 changes: 11 additions & 0 deletions src/nginx/azext_nginx/aaz/latest/nginx/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# --------------------------------------------------------------------------------------------
# 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 aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from .__cmd_group import *
23 changes: 23 additions & 0 deletions src/nginx/azext_nginx/aaz/latest/nginx/deployment/__cmd_group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# --------------------------------------------------------------------------------------------
# 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 aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from azure.cli.core.aaz import *


@register_command_group(
"nginx deployment",
)
class __CMDGroup(AAZCommandGroup):
"""Manage NGINX deployment resources
"""
pass


__all__ = ["__CMDGroup"]
17 changes: 17 additions & 0 deletions src/nginx/azext_nginx/aaz/latest/nginx/deployment/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# --------------------------------------------------------------------------------------------
# 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 aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from .__cmd_group import *
from ._create import *
from ._delete import *
from ._list import *
from ._show import *
from ._update import *
from ._wait import *
Loading

0 comments on commit f947976

Please sign in to comment.