Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions src/dnc/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

0.2.0
++++++
* Add optional "purpose" parameter for controller creation

0.1.3
++++++
* Correct bug with delegate subnet
Expand Down
81 changes: 6 additions & 75 deletions src/dnc/README.md
Original file line number Diff line number Diff line change
@@ -1,83 +1,14 @@
# Azure CLI dnc Extension #
This is the extension for dnc
# Azure CLI Dnc Extension #
This is an extension to Azure CLI to manage DNC resources.

## How to use ##

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

### Included Features ###
#### dnc controller ####
##### Create #####
```
az dnc controller create --location "eastus2euap" --resource-group "TestRG" --resource-name "testcontroller"
```
##### Patch #####
```
az dnc controller patch --tags key="value" --resource-group "TestRG" --resource-name "testcontroller"
```
##### Show-detail #####
```
az dnc controller show-detail --resource-group "TestRG" --resource-name "testcontroller"
```
##### Delete #####
```
az dnc controller delete --resource-group "TestRG" --resource-name "testcontroller"
```
#### dnc delegated-network ####
##### List #####
```
az dnc delegated-network list --resource-group "testRG"
```
#### dnc orchestrator-instance-service ####
##### Create #####
```
az dnc orchestrator-instance-service create --type "SystemAssigned" --location "eastus2euap" \
--api-server-endpoint "https://testk8s.cloudapp.net" --cluster-root-ca "ddsadsad344mfdsfdl" \
--id "/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/resourceGroups/TestRG/providers/Microsoft.DelegatedNetwork/controller/testcontroller" \
--orchestrator-app-id "546192d7-503f-477a-9cfe-4efc3ee2b6e1" \
--orchestrator-tenant-id "da6192d7-503f-477a-9cfe-4efc3ee2b6c3" \
--private-link-resource-id "/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/resourceGroups/TestRG/providers/Microsoft.Network/privateLinkServices/plresource1" \
--resource-group "TestRG" --resource-name "testk8s1"
```
##### List #####
```
az dnc orchestrator-instance-service list --resource-group "testRG"
```
##### Patch #####
```
az dnc orchestrator-instance-service patch --tags key="value" --resource-group "TestRG" --resource-name "testk8s1"
```
##### Show-detail #####
```
az dnc orchestrator-instance-service show-detail --resource-group "TestRG" --resource-name "testk8s1"
```
##### Delete #####
```
az dnc orchestrator-instance-service delete --resource-group "TestRG" --resource-name "k8stest1"
```
#### dnc delegated-subnet-service ####
##### Put-detail #####
```
az dnc delegated-subnet-service put-detail --location "eastus2euap" \
--id "/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/resourceGroups/TestRG/providers/Microsoft.DelegatedNetwork/controller/dnctestcontroller" \
--subnet-details-id "/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/resourceGroups/TestRG/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet" \
--resource-group "TestRG" --resource-name "delegated1"
```
##### Patch-detail #####
```
az dnc delegated-subnet-service patch-detail --tags key="value" --resource-group "TestRG" --resource-name "delegated1"
```
##### List #####
```
az dnc delegated-subnet-service list --resource-group "testRG"
```
##### Show-detail #####
```
az dnc delegated-subnet-service show-detail --resource-group "TestRG" --resource-name "delegated1"
```
##### Delete #####
## Included Features ##
```
az dnc delegated-subnet-service delete --resource-group "TestRG" --resource-name "delegated1"
az dnc --help
```
54 changes: 23 additions & 31 deletions src/dnc/azext_dnc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,50 +1,42 @@
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# 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.
# --------------------------------------------------------------------------
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader
from azext_dnc.generated._help import helps # pylint: disable=unused-import
try:
from azext_dnc.manual._help import helps # pylint: disable=reimported
except ImportError:
pass
from azext_dnc._help import helps # pylint: disable=unused-import


class DNCCommandsLoader(AzCommandsLoader):
class DncCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from azext_dnc.generated._client_factory import cf_dnc_cl
dnc_custom = CliCommandType(
operations_tmpl='azext_dnc.custom#{}',
client_factory=cf_dnc_cl)
parent = super(DNCCommandsLoader, self)
parent.__init__(cli_ctx=cli_ctx, custom_command_type=dnc_custom)
custom_command_type = CliCommandType(
operations_tmpl='azext_dnc.custom#{}')
super().__init__(cli_ctx=cli_ctx,
custom_command_type=custom_command_type)

def load_command_table(self, args):
from azext_dnc.generated.commands import load_command_table
load_command_table(self, args)
from azext_dnc.commands import load_command_table
from azure.cli.core.aaz import load_aaz_command_table
try:
from azext_dnc.manual.commands import load_command_table as load_command_table_manual
load_command_table_manual(self, args)
from . import aaz
except ImportError:
pass
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_dnc.generated._params import load_arguments
from azext_dnc._params import load_arguments
load_arguments(self, command)
try:
from azext_dnc.manual._params import load_arguments as load_arguments_manual
load_arguments_manual(self, command)
except ImportError:
pass


COMMAND_LOADER_CLS = DNCCommandsLoader
COMMAND_LOADER_CLS = DncCommandsLoader
11 changes: 5 additions & 6 deletions src/dnc/azext_dnc/manual/_help.py → src/dnc/azext_dnc/_help.py
Original file line number Diff line number Diff line change
@@ -1,12 +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=too-many-lines

from knack.help_files import helps
# pylint: disable=line-too-long
# pylint: disable=too-many-lines

helps['dnc'] = """
type: group
short-summary: Manage Delegated Network
"""
from knack.help_files import helps # pylint: disable=unused-import
13 changes: 13 additions & 0 deletions src/dnc/azext_dnc/_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# --------------------------------------------------------------------------------------------
# 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=too-many-lines
# pylint: disable=too-many-statements


def load_arguments(self, _): # pylint: disable=unused-argument
pass
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# 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 ._dnc import DNC
__all__ = ['DNC']
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# 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.
# --------------------------------------------------------------------------
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------
24 changes: 24 additions & 0 deletions src/dnc/azext_dnc/aaz/latest/dnc/__cmd_group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# --------------------------------------------------------------------------------------------
# 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(
"dnc",
is_preview=True,
)
class __CMDGroup(AAZCommandGroup):
"""Manage Delegated Network.
"""
pass


__all__ = ["__CMDGroup"]
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# coding=utf-8
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

VERSION = "1.0.0b1"
# pylint: skip-file
# flake8: noqa

from .__cmd_group import *
24 changes: 24 additions & 0 deletions src/dnc/azext_dnc/aaz/latest/dnc/controller/__cmd_group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# --------------------------------------------------------------------------------------------
# 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(
"dnc controller",
is_preview=True,
)
class __CMDGroup(AAZCommandGroup):
"""Manage controller with dnc.
"""
pass


__all__ = ["__CMDGroup"]
15 changes: 15 additions & 0 deletions src/dnc/azext_dnc/aaz/latest/dnc/controller/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# --------------------------------------------------------------------------------------------
# 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 ._show import *
from ._wait import *
Loading