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
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@

/src/storage-mover/ @calvinhzy

/src/traffic-controller/ @jaishals
/src/alb/ @jaishals

/src/managedccfs/ @msftsettiy

Expand Down
2 changes: 1 addition & 1 deletion src/traffic-controller/HISTORY.rst → src/alb/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Release History

0.1.0
++++++
* Initial release.
* Initial release for ALB extension.
13 changes: 13 additions & 0 deletions src/alb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Azure CLI ALB Extension #
This is an extension to Azure CLI to manage Application Gateway for Containers resources.

## How to use ##
First, install the extension:
```
az extension add --name alb
```

Then, call it as you would any other az command:
```
az network alb -h
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
# --------------------------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader
from azext_traffic_controller._help import helps # pylint: disable=unused-import
from azext_alb._help import helps # pylint: disable=unused-import


class TrafficControllerCommandsLoader(AzCommandsLoader):

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

def load_command_table(self, args):
from azext_traffic_controller.commands import load_command_table
from azext_alb.commands import load_command_table
from azure.cli.core.aaz import load_aaz_command_table
try:
from . import aaz
Expand All @@ -35,7 +35,7 @@ def load_command_table(self, args):
return self.command_table

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


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@


@register_command_group(
"service-networking",
is_preview=True,
"network",
)
class __CMDGroup(AAZCommandGroup):
"""Manage Service Networking Resources
"""Manage Azure Network resources.
"""
pass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@


@register_command_group(
"service-networking traffic-controller",
is_preview=True,
"network alb",
)
class __CMDGroup(AAZCommandGroup):
"""Manage and Configure Azure Traffic Controller Resource
"""Manage and Configure Application Gateway for Containers
"""
pass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,19 @@


@register_command(
"service-networking traffic-controller create",
is_preview=True,
"network alb create",
)
class Create(AAZCommand):
"""Create a Traffic Controller
"""Create an Application Gateway for Containers resource

:example: Create a Traffic Controller
az service-networking traffic-controller create -g testRG -n testTC
:example: Create an Application Gateway for Containers resource
az network alb create -g test-rg -n test-alb
"""

_aaz_info = {
"version": "2022-10-01-preview",
"version": "2023-05-01-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.servicenetworking/trafficcontrollers/{}", "2022-10-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.servicenetworking/trafficcontrollers/{}", "2023-05-01-preview"],
]
}

Expand All @@ -49,9 +48,9 @@ def _build_arguments_schema(cls, *args, **kwargs):
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
_args_schema.traffic_controller_name = AAZStrArg(
options=["-n", "--name", "--traffic-controller-name"],
help="Name of the Traffic Controller",
_args_schema.name = AAZStrArg(
options=["-n", "--name"],
help="Name of the resource",
required=True,
fmt=AAZStrArgFormat(
pattern="[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+",
Expand Down Expand Up @@ -150,7 +149,7 @@ def url_parameters(self):
required=True,
),
**self.serialize_url_param(
"trafficControllerName", self.ctx.args.traffic_controller_name,
"trafficControllerName", self.ctx.args.name,
required=True,
),
}
Expand All @@ -160,7 +159,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-10-01-preview",
"api-version", "2023-05-01-preview",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,20 @@


@register_command(
"service-networking traffic-controller delete",
is_preview=True,
"network alb delete",
confirmation="Are you sure you want to perform this operation?",
)
class Delete(AAZCommand):
"""Delete a Traffic Controller
"""Delete an Application Gateway for Containers resource

:example: Delete a Traffic Controller Resource
az service-networking traffic-controller delete -g testRG -n testTC
:example: Delete an Application Gateway for Containers resource
az network alb delete -g test-rg -n test-alb
"""

_aaz_info = {
"version": "2022-10-01-preview",
"version": "2023-05-01-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.servicenetworking/trafficcontrollers/{}", "2022-10-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.servicenetworking/trafficcontrollers/{}", "2023-05-01-preview"],
]
}

Expand All @@ -50,9 +49,9 @@ def _build_arguments_schema(cls, *args, **kwargs):
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
_args_schema.traffic_controller_name = AAZStrArg(
options=["-n", "--name", "--traffic-controller-name"],
help="Name of the Traffic Controller",
_args_schema.name = AAZStrArg(
options=["-n", "--name"],
help="Name of the resource",
required=True,
id_part="name",
fmt=AAZStrArgFormat(
Expand Down Expand Up @@ -137,7 +136,7 @@ def url_parameters(self):
required=True,
),
**self.serialize_url_param(
"trafficControllerName", self.ctx.args.traffic_controller_name,
"trafficControllerName", self.ctx.args.name,
required=True,
),
}
Expand All @@ -147,7 +146,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-10-01-preview",
"api-version", "2023-05-01-preview",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,23 @@


@register_command(
"service-networking traffic-controller list",
is_preview=True,
"network alb list",
)
class List(AAZCommand):
"""List Traffic Controllers
"""List Application Gateway for Containers resource

:example: List Traffic Controllers in resource group
az service-networking traffic-controller list -g testRG
:example: List Application Gateway for Containers in resource group
az network alb list -g test-rg

:example: List all Traffic Controllers in a subscription
az service-networking traffic-controller list
:example: List all Application Gateway for Containers in subscription
az network alb list
"""

_aaz_info = {
"version": "2022-10-01-preview",
"version": "2023-05-01-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/providers/microsoft.servicenetworking/trafficcontrollers", "2022-10-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.servicenetworking/trafficcontrollers", "2022-10-01-preview"],
["mgmt-plane", "/subscriptions/{}/providers/microsoft.servicenetworking/trafficcontrollers", "2023-05-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.servicenetworking/trafficcontrollers", "2023-05-01-preview"],
]
}

Expand Down Expand Up @@ -118,7 +117,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-10-01-preview",
"api-version", "2023-05-01-preview",
required=True,
),
}
Expand Down Expand Up @@ -274,7 +273,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-10-01-preview",
"api-version", "2023-05-01-preview",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,19 @@


@register_command(
"service-networking traffic-controller show",
is_preview=True,
"network alb show",
)
class Show(AAZCommand):
"""Get a Traffic Controller
"""Get an Application Gateway for Containers resource

:example: Get the details of a Traffic Controller
az service-networking traffic-controller show -g testRG -n testTC
:example: Get the details of an Application Gateway for Containers resource
az network alb show -g test-rg -n test-alb
"""

_aaz_info = {
"version": "2022-10-01-preview",
"version": "2023-05-01-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.servicenetworking/trafficcontrollers/{}", "2022-10-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.servicenetworking/trafficcontrollers/{}", "2023-05-01-preview"],
]
}

Expand All @@ -48,9 +47,9 @@ def _build_arguments_schema(cls, *args, **kwargs):
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
_args_schema.traffic_controller_name = AAZStrArg(
options=["-n", "--name", "--traffic-controller-name"],
help="Name of the Traffic Controller",
_args_schema.name = AAZStrArg(
options=["-n", "--name"],
help="Name of the resource",
required=True,
id_part="name",
fmt=AAZStrArgFormat(
Expand Down Expand Up @@ -114,7 +113,7 @@ def url_parameters(self):
required=True,
),
**self.serialize_url_param(
"trafficControllerName", self.ctx.args.traffic_controller_name,
"trafficControllerName", self.ctx.args.name,
required=True,
),
}
Expand All @@ -124,7 +123,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-10-01-preview",
"api-version", "2023-05-01-preview",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,21 @@


@register_command(
"service-networking traffic-controller update",
is_preview=True,
"network alb update",
)
class Update(AAZCommand):
"""Update a Traffic Controller
"""Update an Application Gateway for Containers resource

This command can only be used to update the tags for a traffic controller. Name and resource group are immutable and cannot be updated
This command can only be used to update the tags for the resource. Name and resource group are immutable and cannot be updated

:example: Update the tags of a traffic controller
az service-networking traffic-controller update -g testRG -n testTC --set tags.CostCenter=testBusinessGroup
:example: Update the tags of the resource
az network alb update -g test-rg -n test-alb --set tags.CostCenter=testBusinessGroup
"""

_aaz_info = {
"version": "2022-10-01-preview",
"version": "2023-05-01-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.servicenetworking/trafficcontrollers/{}", "2022-10-01-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.servicenetworking/trafficcontrollers/{}", "2023-05-01-preview"],
]
}

Expand All @@ -53,9 +52,9 @@ def _build_arguments_schema(cls, *args, **kwargs):
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
)
_args_schema.traffic_controller_name = AAZStrArg(
options=["-n", "--name", "--traffic-controller-name"],
help="Name of the Traffic Controller",
_args_schema.name = AAZStrArg(
options=["-n", "--name"],
help="Name of the resource",
required=True,
id_part="name",
fmt=AAZStrArgFormat(
Expand Down Expand Up @@ -147,7 +146,7 @@ def url_parameters(self):
required=True,
),
**self.serialize_url_param(
"trafficControllerName", self.ctx.args.traffic_controller_name,
"trafficControllerName", self.ctx.args.name,
required=True,
),
}
Expand All @@ -157,7 +156,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-10-01-preview",
"api-version", "2023-05-01-preview",
required=True,
),
}
Expand Down Expand Up @@ -246,7 +245,7 @@ def url_parameters(self):
required=True,
),
**self.serialize_url_param(
"trafficControllerName", self.ctx.args.traffic_controller_name,
"trafficControllerName", self.ctx.args.name,
required=True,
),
}
Expand All @@ -256,7 +255,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2022-10-01-preview",
"api-version", "2023-05-01-preview",
required=True,
),
}
Expand Down
Loading