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
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
)
_args_schema.enable_high_bandwidth_vpn_gateway = AAZBoolArg(
options=["--enable-high-bandwidth", "--enable-high-bandwidth-vpn-gateway"],
help="To enable high-bandwidth Advanced Connectivity feature for VPN gateway",
help="To enable Advanced Connectivity feature for VPN gateway",
)
_args_schema.enable_private_ip = AAZBoolArg(
options=["--enable-private-ip"],
Expand Down Expand Up @@ -328,6 +328,27 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="Gateway SKU tier.",
enum={"Basic": "Basic", "ErGw1AZ": "ErGw1AZ", "ErGw2AZ": "ErGw2AZ", "ErGw3AZ": "ErGw3AZ", "ErGwScale": "ErGwScale", "HighPerformance": "HighPerformance", "Standard": "Standard", "UltraPerformance": "UltraPerformance", "VpnGw1": "VpnGw1", "VpnGw1AZ": "VpnGw1AZ", "VpnGw2": "VpnGw2", "VpnGw2AZ": "VpnGw2AZ", "VpnGw3": "VpnGw3", "VpnGw3AZ": "VpnGw3AZ", "VpnGw4": "VpnGw4", "VpnGw4AZ": "VpnGw4AZ", "VpnGw5": "VpnGw5", "VpnGw5AZ": "VpnGw5AZ"},
)
_args_schema.virtual_network_gateway_migration_status = AAZObjectArg(
options=["--virtual-network-gateway-migration-status"],
arg_group="Properties",
help="The reference to the VirtualNetworkGatewayMigrationStatus which represents the status of migration.",
)

virtual_network_gateway_migration_status = cls._args_schema.virtual_network_gateway_migration_status
virtual_network_gateway_migration_status.error_message = AAZStrArg(
options=["error-message"],
help="Error if any occurs during migration.",
)
virtual_network_gateway_migration_status.phase = AAZStrArg(
options=["phase"],
help="Represent the current migration phase of gateway.",
enum={"Abort": "Abort", "AbortSucceeded": "AbortSucceeded", "Commit": "Commit", "CommitSucceeded": "CommitSucceeded", "Execute": "Execute", "ExecuteSucceeded": "ExecuteSucceeded", "None": "None", "Prepare": "Prepare", "PrepareSucceeded": "PrepareSucceeded"},
)
virtual_network_gateway_migration_status.state = AAZStrArg(
options=["state"],
help="Represent the current state of gateway migration.",
enum={"Failed": "Failed", "InProgress": "InProgress", "None": "None", "Succeeded": "Succeeded"},
)

# define Arg Group "Root Cert Authentication"

Expand Down Expand Up @@ -579,6 +600,7 @@ def content(self):
properties.set_prop("resiliencyModel", AAZStrType, ".resiliency_model")
properties.set_prop("sku", AAZObjectType)
properties.set_prop("vNetExtendedLocationResourceId", AAZStrType, ".edge_zone_vnet_id")
properties.set_prop("virtualNetworkGatewayMigrationStatus", AAZObjectType, ".virtual_network_gateway_migration_status")
properties.set_prop("vpnClientConfiguration", AAZObjectType)
properties.set_prop("vpnGatewayGeneration", AAZStrType, ".vpn_gateway_generation")
properties.set_prop("vpnType", AAZStrType, ".vpn_type")
Expand Down Expand Up @@ -672,6 +694,12 @@ def content(self):
sku.set_prop("name", AAZStrType, ".sku")
sku.set_prop("tier", AAZStrType, ".sku_tier")

virtual_network_gateway_migration_status = _builder.get(".properties.virtualNetworkGatewayMigrationStatus")
if virtual_network_gateway_migration_status is not None:
virtual_network_gateway_migration_status.set_prop("errorMessage", AAZStrType, ".error_message")
virtual_network_gateway_migration_status.set_prop("phase", AAZStrType, ".phase")
virtual_network_gateway_migration_status.set_prop("state", AAZStrType, ".state")

vpn_client_configuration = _builder.get(".properties.vpnClientConfiguration")
if vpn_client_configuration is not None:
vpn_client_configuration.set_prop("aadAudience", AAZStrType, ".aad_audience")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="Minimum scale units for auto-scale configuration.",
nullable=True,
)
_args_schema.enable_high_bandwidth_vpn_gateway = AAZBoolArg(
options=["--enable-high-bandwidth", "--enable-high-bandwidth-vpn-gateway"],
help="To enable Advanced Connectivity feature for VPN gateway",
nullable=True,
)
_args_schema.enable_private_ip = AAZBoolArg(
options=["--enable-private-ip"],
help="Whether private IP needs to be enabled on this gateway for connections or not.",
Expand Down Expand Up @@ -217,6 +222,12 @@ def _build_arguments_schema(cls, *args, **kwargs):
nullable=True,
enum={"Basic": "Basic", "ErGw1AZ": "ErGw1AZ", "ErGw2AZ": "ErGw2AZ", "ErGw3AZ": "ErGw3AZ", "ErGwScale": "ErGwScale", "HighPerformance": "HighPerformance", "Standard": "Standard", "UltraPerformance": "UltraPerformance", "VpnGw1": "VpnGw1", "VpnGw1AZ": "VpnGw1AZ", "VpnGw2": "VpnGw2", "VpnGw2AZ": "VpnGw2AZ", "VpnGw3": "VpnGw3", "VpnGw3AZ": "VpnGw3AZ", "VpnGw4": "VpnGw4", "VpnGw4AZ": "VpnGw4AZ", "VpnGw5": "VpnGw5", "VpnGw5AZ": "VpnGw5AZ"},
)
_args_schema.virtual_network_gateway_migration_status = AAZObjectArg(
options=["--virtual-network-gateway-migration-status"],
arg_group="Properties",
help="The reference to the VirtualNetworkGatewayMigrationStatus which represents the status of migration.",
nullable=True,
)

ip_configurations = cls._args_schema.ip_configurations
ip_configurations.Element = AAZObjectArg(
Expand Down Expand Up @@ -247,6 +258,25 @@ def _build_arguments_schema(cls, *args, **kwargs):
nullable=True,
)

virtual_network_gateway_migration_status = cls._args_schema.virtual_network_gateway_migration_status
virtual_network_gateway_migration_status.error_message = AAZStrArg(
options=["error-message"],
help="Error if any occurs during migration.",
nullable=True,
)
virtual_network_gateway_migration_status.phase = AAZStrArg(
options=["phase"],
help="Represent the current migration phase of gateway.",
nullable=True,
enum={"Abort": "Abort", "AbortSucceeded": "AbortSucceeded", "Commit": "Commit", "CommitSucceeded": "CommitSucceeded", "Execute": "Execute", "ExecuteSucceeded": "ExecuteSucceeded", "None": "None", "Prepare": "Prepare", "PrepareSucceeded": "PrepareSucceeded"},
)
virtual_network_gateway_migration_status.state = AAZStrArg(
options=["state"],
help="Represent the current state of gateway migration.",
nullable=True,
enum={"Failed": "Failed", "InProgress": "InProgress", "None": "None", "Succeeded": "Succeeded"},
)

# define Arg Group "Root Cert Authentication"

_args_schema = cls._args_schema
Expand Down Expand Up @@ -695,12 +725,14 @@ def _update_instance(self, instance):
properties.set_prop("bgpSettings", AAZObjectType)
properties.set_prop("customRoutes", AAZObjectType)
properties.set_prop("enableBgp", AAZBoolType, ".enable_bgp")
properties.set_prop("enableHighBandwidthVpnGateway", AAZBoolType, ".enable_high_bandwidth_vpn_gateway")
properties.set_prop("enablePrivateIpAddress", AAZBoolType, ".enable_private_ip")
properties.set_prop("gatewayDefaultSite", AAZObjectType)
properties.set_prop("gatewayType", AAZStrType, ".gateway_type")
properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations")
properties.set_prop("resiliencyModel", AAZStrType, ".resiliency_model")
properties.set_prop("sku", AAZObjectType)
properties.set_prop("virtualNetworkGatewayMigrationStatus", AAZObjectType, ".virtual_network_gateway_migration_status")
properties.set_prop("vpnClientConfiguration", AAZObjectType)
properties.set_prop("vpnType", AAZStrType, ".vpn_type")

Expand Down Expand Up @@ -755,6 +787,12 @@ def _update_instance(self, instance):
sku.set_prop("name", AAZStrType, ".sku")
sku.set_prop("tier", AAZStrType, ".sku_tier")

virtual_network_gateway_migration_status = _builder.get(".properties.virtualNetworkGatewayMigrationStatus")
if virtual_network_gateway_migration_status is not None:
virtual_network_gateway_migration_status.set_prop("errorMessage", AAZStrType, ".error_message")
virtual_network_gateway_migration_status.set_prop("phase", AAZStrType, ".phase")
virtual_network_gateway_migration_status.set_prop("state", AAZStrType, ".state")

vpn_client_configuration = _builder.get(".properties.vpnClientConfiguration")
if vpn_client_configuration is not None:
vpn_client_configuration.set_prop("aadAudience", AAZStrType, ".aad_audience")
Expand Down
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(
"network vnet-gateway migration",
)
class __CMDGroup(AAZCommandGroup):
"""Migrate vpn gateway from basic IP CSES to Standard IP based VMSS deployment.
"""
pass


__all__ = ["__CMDGroup"]
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 ._abort import *
from ._commit import *
from ._execute import *
from ._prepare import *
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# --------------------------------------------------------------------------------------------
# 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(
"network vnet-gateway migration abort",
)
class Abort(AAZCommand):
"""Trigger abort migration for the virtual network gateway.

:example: Abort a gateway migration
az network vnet-gateway migration abort -g group -n gateway
"""

_aaz_info = {
"version": "2024-07-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/abortmigration", "2024-07-01"],
]
}

AZ_SUPPORT_NO_WAIT = True

def _handler(self, command_args):
super()._handler(command_args)
return self.build_lro_poller(self._execute_operations, None)

_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.resource_group = AAZResourceGroupNameArg(
required=True,
)
_args_schema.vnet_gateway_name = AAZStrArg(
options=["-n", "--gateway-name", "--vnet-gateway-name"],
help="The name of the gateway.",
required=True,
id_part="name",
)
return cls._args_schema

def _execute_operations(self):
self.pre_operations()
yield self.VirtualNetworkGatewaysInvokeAbortMigration(ctx=self.ctx)()
self.post_operations()

@register_callback
def pre_operations(self):
pass

@register_callback
def post_operations(self):
pass

class VirtualNetworkGatewaysInvokeAbortMigration(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"

def __call__(self, *args, **kwargs):
request = self.make_request()
session = self.client.send_request(request=request, stream=False, **kwargs)
if session.http_response.status_code in [202]:
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
None,
self.on_error,
lro_options={"final-state-via": "location"},
path_format_arguments=self.url_parameters,
)

return self.on_error(session.http_response)

@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/abortMigration",
**self.url_parameters
)

@property
def method(self):
return "POST"

@property
def error_format(self):
return "ODataV4Format"

@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
),
**self.serialize_url_param(
"virtualNetworkGatewayName", self.ctx.args.vnet_gateway_name,
required=True,
),
}
return parameters

@property
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-07-01",
required=True,
),
}
return parameters


class _AbortHelper:
"""Helper class for Abort"""


__all__ = ["Abort"]
Loading