diff --git a/src/interconnect/HISTORY.rst b/src/interconnect/HISTORY.rst new file mode 100644 index 00000000000..52c1dc2ae85 --- /dev/null +++ b/src/interconnect/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +1.0.0b1 +++++++ +* Add preview support for interconnect group CRUD, node availability queries, and subgroup list/show operations. diff --git a/src/interconnect/README.md b/src/interconnect/README.md new file mode 100644 index 00000000000..96a1bb4c009 --- /dev/null +++ b/src/interconnect/README.md @@ -0,0 +1,62 @@ +# Azure CLI Interconnect Extension # +This is an extension to Azure CLI to manage Interconnect resources. + +## How to use ## +Install the extension: + +``` +az extension add --name interconnect +``` + +### Manage interconnect groups ### + +Create an interconnect group: + +``` +az interconnect-group create --resource-group rg1 --interconnect-group-name test-ig +``` + +Show an interconnect group: + +``` +az interconnect-group show --resource-group rg1 --interconnect-group-name test-ig +``` + +List interconnect groups (in a subscription, or scoped to a resource group): + +``` +az interconnect-group list +az interconnect-group list --resource-group rg1 +``` + +Update an interconnect group: + +``` +az interconnect-group update --resource-group rg1 --interconnect-group-name test-ig +``` + +Delete an interconnect group: + +``` +az interconnect-group delete --resource-group rg1 --interconnect-group-name test-ig +``` + +Get node availability for all subgroups in an interconnect group: + +``` +az interconnect-group get-node-availability --resource-group rg1 --interconnect-group-name test-ig +``` + +### Manage subgroups ### + +List subgroups in an interconnect group: + +``` +az interconnect-group subgroup list --resource-group rg1 --interconnect-group-name test-ig +``` + +Show a subgroup: + +``` +az interconnect-group subgroup show --resource-group rg1 --interconnect-group-name test-ig --subgroup-name subgroup0 +``` diff --git a/src/interconnect/azext_interconnect/__init__.py b/src/interconnect/azext_interconnect/__init__.py new file mode 100644 index 00000000000..47b3746e50d --- /dev/null +++ b/src/interconnect/azext_interconnect/__init__.py @@ -0,0 +1,42 @@ +# -------------------------------------------------------------------------------------------- +# 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 +# -------------------------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader +from azext_interconnect._help import helps # pylint: disable=unused-import + + +class InterconnectCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + custom_command_type = CliCommandType( + operations_tmpl='azext_interconnect.custom#{}') + super().__init__(cli_ctx=cli_ctx, + custom_command_type=custom_command_type) + + def load_command_table(self, args): + from azext_interconnect.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_interconnect._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = InterconnectCommandsLoader diff --git a/src/interconnect/azext_interconnect/_help.py b/src/interconnect/azext_interconnect/_help.py new file mode 100644 index 00000000000..126d5d00714 --- /dev/null +++ b/src/interconnect/azext_interconnect/_help.py @@ -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 diff --git a/src/interconnect/azext_interconnect/_params.py b/src/interconnect/azext_interconnect/_params.py new file mode 100644 index 00000000000..cfcec717c9c --- /dev/null +++ b/src/interconnect/azext_interconnect/_params.py @@ -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 diff --git a/src/interconnect/azext_interconnect/aaz/__init__.py b/src/interconnect/azext_interconnect/aaz/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/interconnect/azext_interconnect/aaz/__init__.py @@ -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 +# -------------------------------------------------------------------------------------------- diff --git a/src/interconnect/azext_interconnect/aaz/latest/__init__.py b/src/interconnect/azext_interconnect/aaz/latest/__init__.py new file mode 100644 index 00000000000..f6acc11aa4e --- /dev/null +++ b/src/interconnect/azext_interconnect/aaz/latest/__init__.py @@ -0,0 +1,10 @@ +# -------------------------------------------------------------------------------------------- +# 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 + diff --git a/src/interconnect/azext_interconnect/aaz/latest/interconnect_group/__cmd_group.py b/src/interconnect/azext_interconnect/aaz/latest/interconnect_group/__cmd_group.py new file mode 100644 index 00000000000..2258715ca90 --- /dev/null +++ b/src/interconnect/azext_interconnect/aaz/latest/interconnect_group/__cmd_group.py @@ -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( + "interconnect-group", +) +class __CMDGroup(AAZCommandGroup): + """Manage Interconnect Group + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/interconnect/azext_interconnect/aaz/latest/interconnect_group/__init__.py b/src/interconnect/azext_interconnect/aaz/latest/interconnect_group/__init__.py new file mode 100644 index 00000000000..32c45884d00 --- /dev/null +++ b/src/interconnect/azext_interconnect/aaz/latest/interconnect_group/__init__.py @@ -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 ._get_node_availability import * +from ._list import * +from ._show import * +from ._update import * diff --git a/src/interconnect/azext_interconnect/aaz/latest/interconnect_group/_create.py b/src/interconnect/azext_interconnect/aaz/latest/interconnect_group/_create.py new file mode 100644 index 00000000000..ba52769ace6 --- /dev/null +++ b/src/interconnect/azext_interconnect/aaz/latest/interconnect_group/_create.py @@ -0,0 +1,347 @@ +# -------------------------------------------------------------------------------------------- +# 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( + "interconnect-group create", +) +class Create(AAZCommand): + """Create an interconnect group. + + :example: Create interconnect group + az network interconnect-group create --resource-group rg1 --interconnect-group-name test-ig + """ + + _aaz_info = { + "version": "2025-07-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/interconnectgroups/{}", "2025-07-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.interconnect_group_name = AAZStrArg( + options=["-n", "--name", "--interconnect-group-name"], + help="The name of the interconnect group.", + required=True, + fmt=AAZStrArgFormat( + pattern="^[^_\\W][\\w._-]{0,79}(?