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

add dnc rp cli commands #3433

Merged
merged 10 commits into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from 9 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
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

/src/dms-preview/ @temandr

/src/dnc/ @alegal

/src/express-route-cross-connection/ @kairu-ms @msyyc

/src/application-insights/ @alexeldeib
Expand Down
8 changes: 8 additions & 0 deletions src/dnc/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. :changelog:

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

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

### 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 #####
```
az dnc delegated-subnet-service delete --resource-group "TestRG" --resource-name "delegated1"
```
50 changes: 50 additions & 0 deletions src/dnc/azext_dnc/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# --------------------------------------------------------------------------
# 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
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


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)

def load_command_table(self, args):
from azext_dnc.generated.commands import load_command_table
load_command_table(self, args)
try:
from azext_dnc.manual.commands import load_command_table as load_command_table_manual
load_command_table_manual(self, args)
except ImportError:
pass
return self.command_table

def load_arguments(self, command):
from azext_dnc.generated._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
17 changes: 17 additions & 0 deletions src/dnc/azext_dnc/action.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 Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.action import * # noqa: F403
try:
from .manual.action import * # noqa: F403
except ImportError:
pass
4 changes: 4 additions & 0 deletions src/dnc/azext_dnc/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"azext.isExperimental": true,
"azext.minCliCoreVersion": "2.15.0"
}
17 changes: 17 additions & 0 deletions src/dnc/azext_dnc/custom.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 Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.custom import * # noqa: F403
try:
from .manual.custom import * # noqa: F403
except ImportError:
pass
12 changes: 12 additions & 0 deletions src/dnc/azext_dnc/generated/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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.
# --------------------------------------------------------------------------

__path__ = __import__('pkgutil').extend_path(__path__, __name__)
32 changes: 32 additions & 0 deletions src/dnc/azext_dnc/generated/_client_factory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# --------------------------------------------------------------------------
# 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_dnc_cl(cli_ctx, *_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azext_dnc.vendored_sdks.dnc import DNC
return get_mgmt_service_client(cli_ctx,
DNC)


def cf_controller(cli_ctx, *_):
return cf_dnc_cl(cli_ctx).controller


def cf_delegated_network(cli_ctx, *_):
return cf_dnc_cl(cli_ctx).delegated_network


def cf_orchestrator_instance_service(cli_ctx, *_):
return cf_dnc_cl(cli_ctx).orchestrator_instance_service


def cf_delegated_subnet_service(cli_ctx, *_):
return cf_dnc_cl(cli_ctx).delegated_subnet_service
Loading