diff --git a/src/azure-cli/azure/cli/command_modules/network/__init__.py b/src/azure-cli/azure/cli/command_modules/network/__init__.py index a5f528d086c..25339cb5628 100644 --- a/src/azure-cli/azure/cli/command_modules/network/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/network/__init__.py @@ -31,6 +31,17 @@ def __init__(self, cli_ctx=None): def load_command_table(self, args): from azure.cli.command_modules.network.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 diff --git a/src/azure-cli/azure/cli/command_modules/network/_client_factory.py b/src/azure-cli/azure/cli/command_modules/network/_client_factory.py index ab2815183b3..669e0611b50 100644 --- a/src/azure-cli/azure/cli/command_modules/network/_client_factory.py +++ b/src/azure-cli/azure/cli/command_modules/network/_client_factory.py @@ -24,10 +24,6 @@ def cf_app_gateway_waf_policy(cli_ctx, _): return network_client_factory(cli_ctx).web_application_firewall_policies -def cf_application_security_groups(cli_ctx, _): - return network_client_factory(cli_ctx).application_security_groups - - def cf_connection_monitor(cli_ctx, _): return network_client_factory(cli_ctx).connection_monitors diff --git a/src/azure-cli/azure/cli/command_modules/network/_help.py b/src/azure-cli/azure/cli/command_modules/network/_help.py index 5a8c31e02f1..ebd606240df 100644 --- a/src/azure-cli/azure/cli/command_modules/network/_help.py +++ b/src/azure-cli/azure/cli/command_modules/network/_help.py @@ -1787,62 +1787,6 @@ text: az network application-gateway ssl-profile list --gateway-name MyAppGateway -g MyResourceGroup """ -helps['network asg'] = """ -type: group -short-summary: Manage application security groups (ASGs). -long-summary: > - You can configure network security as a natural extension of an application's structure, ASG allows - you to group virtual machines and define network security policies based on those groups. You can specify an - application security group as the source and destination in a NSG security rule. For more information - visit https://docs.microsoft.com/azure/virtual-network/create-network-security-group-preview -""" - -helps['network asg create'] = """ -type: command -short-summary: Create an application security group. -parameters: - - name: --name -n - short-summary: Name of the new application security group resource. -examples: - - name: Create an application security group. - text: az network asg create -g MyResourceGroup -n MyAsg --tags MyWebApp, CostCenter=Marketing -""" - -helps['network asg delete'] = """ -type: command -short-summary: Delete an application security group. -examples: - - name: Delete an application security group. - text: az network asg delete -g MyResourceGroup -n MyAsg -""" - -helps['network asg list'] = """ -type: command -short-summary: List all application security groups in a subscription. -examples: - - name: List all application security groups in a subscription. - text: az network asg list -""" - -helps['network asg show'] = """ -type: command -short-summary: Get details of an application security group. -examples: - - name: Get details of an application security group. - text: az network asg show -g MyResourceGroup -n MyAsg -""" - -helps['network asg update'] = """ -type: command -short-summary: Update an application security group. -long-summary: > - This command can only be used to update the tags for an application security group. - Name and resource group are immutable and cannot be updated. -examples: - - name: Update an application security group with a modified tag value. - text: az network asg update -g MyResourceGroup -n MyAsg --set tags.CostCenter=MyBusinessGroup -""" - helps['network ddos-protection'] = """ type: group short-summary: Manage DDoS Protection Plans. diff --git a/src/azure-cli/azure/cli/command_modules/network/_params.py b/src/azure-cli/azure/cli/command_modules/network/_params.py index 018ad07cdbd..b886dba4e88 100644 --- a/src/azure-cli/azure/cli/command_modules/network/_params.py +++ b/src/azure-cli/azure/cli/command_modules/network/_params.py @@ -630,11 +630,6 @@ def load_arguments(self, _): c.argument('rule_ids', nargs='+', help='List of rules that will be disabled. If provided, --group-name must be provided too.') # region - # region ApplicationSecurityGroups - with self.argument_context('network asg') as c: - c.argument('application_security_group_name', name_arg_type, id_part='name', help='The name of the application security group.') - # endregion - # region DDoS Protection Plans with self.argument_context('network ddos-protection') as c: for dest in ['ddos_plan_name', 'ddos_protection_plan_name']: diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/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/azure-cli/azure/cli/command_modules/network/aaz/latest/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/__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/azure-cli/azure/cli/command_modules/network/aaz/latest/network/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/__cmd_group.py new file mode 100644 index 00000000000..5093d2928ba --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/__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( + "network", +) +class __CMDGroup(AAZCommandGroup): + """Manage Azure Network resources. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/__init__.py new file mode 100644 index 00000000000..5a9d61963d6 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/__init__.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: skip-file +# flake8: noqa + +from .__cmd_group import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/__cmd_group.py new file mode 100644 index 00000000000..2478d5e31b1 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/__cmd_group.py @@ -0,0 +1,25 @@ +# -------------------------------------------------------------------------------------------- +# 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 asg", +) +class __CMDGroup(AAZCommandGroup): + """Manage application security groups (ASGs). + + You can configure network security as a natural extension of an application's structure, ASG allows you to group virtual machines and define network security policies based on those groups. You can specify an application security group as the source and destination in a NSG security rule. For more information, visit https://docs.microsoft.com/azure/virtual-network/create-network-security-group-preview. + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/__init__.py new file mode 100644 index 00000000000..db73033039b --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/__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 ._list import * +from ._show import * +from ._update import * +from ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/_create.py new file mode 100644 index 00000000000..0d3fdefe26a --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/_create.py @@ -0,0 +1,227 @@ +# -------------------------------------------------------------------------------------------- +# 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 asg create", +) +class Create(AAZCommand): + """Create an application security group. + + :example: Create an application security group. + az network asg create -g MyResourceGroup -n MyAsg --tags MyWebApp, CostCenter=Marketing + """ + + _aaz_info = { + "version": "2021-08-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/applicationsecuritygroups/{}", "2021-08-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, 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.name = AAZStrArg( + options=["-n", "--name"], + help="Name of the new application security group resource.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.location = AAZResourceLocationArg( + help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`.", + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + help="Space-separated tags: key[=value] [key[=value] ...]. Use \"\" to clear existing tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + return cls._args_schema + + def _execute_operations(self): + yield self.ApplicationSecurityGroupsCreateOrUpdate(ctx=self.ctx)() + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ApplicationSecurityGroupsCreateOrUpdate(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, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + 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/applicationSecurityGroups/{applicationSecurityGroupName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "applicationSecurityGroupName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-08-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("location", AAZStrType, ".location") + _builder.set_prop("tags", AAZDictType, ".tags") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.id = AAZStrType() + _schema_on_200_201.location = AAZStrType() + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.resource_guid = AAZStrType( + serialized_name="resourceGuid", + flags={"read_only": True}, + ) + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/_delete.py new file mode 100644 index 00000000000..ab2246c40ac --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/_delete.py @@ -0,0 +1,148 @@ +# -------------------------------------------------------------------------------------------- +# 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 asg delete" +) +class Delete(AAZCommand): + """Delete an application security group. + + :example: Delete an application security group. + az network asg delete -g MyResourceGroup -n MyAsg + """ + + _aaz_info = { + "version": "2021-08-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/applicationsecuritygroups/{}", "2021-08-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.name = AAZStrArg( + options=["-n", "--name"], + help="Name of the new application security group resource.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + yield self.ApplicationSecurityGroupsDelete(ctx=self.ctx)() + + class ApplicationSecurityGroupsDelete(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, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + 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/applicationSecurityGroups/{applicationSecurityGroupName}", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "applicationSecurityGroupName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-08-01", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/_list.py new file mode 100644 index 00000000000..dd593223d19 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/_list.py @@ -0,0 +1,296 @@ +# -------------------------------------------------------------------------------------------- +# 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 asg list", +) +class List(AAZCommand): + """List all application security groups. + + :example: List all application security groups in a resource group. + az network asg list -g MyResourceGroup + """ + + _aaz_info = { + "version": "2021-08-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/applicationsecuritygroups", "2021-08-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/applicationsecuritygroups", "2021-08-01"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_paging(self._execute_operations, 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.resource_group = AAZResourceGroupNameArg() + return cls._args_schema + + def _execute_operations(self): + condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) + condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True + if condition_0: + self.ApplicationSecurityGroupsList(ctx=self.ctx)() + if condition_1: + self.ApplicationSecurityGroupsListAll(ctx=self.ctx)() + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) + next_link = self.deserialize_output(self.ctx.vars.instance.next_link) + return result, next_link + + class ApplicationSecurityGroupsList(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 [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @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, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-08-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.etag = AAZStrType( + flags={"read_only": True}, + ) + _element.id = AAZStrType() + _element.location = AAZStrType() + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.resource_guid = AAZStrType( + serialized_name="resourceGuid", + flags={"read_only": True}, + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + class ApplicationSecurityGroupsListAll(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 [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-08-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + flags={"read_only": True}, + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.etag = AAZStrType( + flags={"read_only": True}, + ) + _element.id = AAZStrType() + _element.location = AAZStrType() + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.resource_guid = AAZStrType( + serialized_name="resourceGuid", + flags={"read_only": True}, + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/_show.py new file mode 100644 index 00000000000..234e341bfd4 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/_show.py @@ -0,0 +1,178 @@ +# -------------------------------------------------------------------------------------------- +# 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 asg show", +) +class Show(AAZCommand): + """Get details of an application security group. + + :example: Get details of an application security group. + az network asg show -g MyResourceGroup -n MyAsg + """ + + _aaz_info = { + "version": "2021-08-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/applicationsecuritygroups/{}", "2021-08-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.name = AAZStrArg( + options=["-n", "--name"], + help="Name of the new application security group resource.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.ApplicationSecurityGroupsGet(ctx=self.ctx)() + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ApplicationSecurityGroupsGet(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 [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "applicationSecurityGroupName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-08-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.id = AAZStrType() + _schema_on_200.location = AAZStrType() + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.resource_guid = AAZStrType( + serialized_name="resourceGuid", + flags={"read_only": True}, + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/_update.py new file mode 100644 index 00000000000..6b50d5efc4e --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/_update.py @@ -0,0 +1,369 @@ +# -------------------------------------------------------------------------------------------- +# 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 asg update", +) +class Update(AAZCommand): + """Update an application security group. + + This command can only be used to update the tags for an application security group. Name and resource group are immutable and cannot be updated. + + :example: Update an application security group with a modified tag value. + az network asg update -g MyResourceGroup -n MyAsg --tags CostCenter=MyBusinessGroup + """ + + _aaz_info = { + "version": "2021-08-01", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/applicationsecuritygroups/{}", "2021-08-01"], + ] + } + + AZ_SUPPORT_NO_WAIT = True + + AZ_SUPPORT_GENERIC_UPDATE = True + + def _handler(self, command_args): + super()._handler(command_args) + return self.build_lro_poller(self._execute_operations, 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.name = AAZStrArg( + options=["-n", "--name"], + help="Name of the new application security group resource.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.location = AAZResourceLocationArg( + help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`.", + nullable=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + help="Space-separated tags: key[=value] [key[=value] ...]. Use \"\" to clear existing tags.", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.ApplicationSecurityGroupsGet(ctx=self.ctx)() + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + yield self.ApplicationSecurityGroupsCreateOrUpdate(ctx=self.ctx)() + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ApplicationSecurityGroupsGet(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 [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "applicationSecurityGroupName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-08-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + _build_schema_application_security_group_read(cls._schema_on_200) + + return cls._schema_on_200 + + class ApplicationSecurityGroupsCreateOrUpdate(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, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200, 201]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200_201, + self.on_error, + lro_options={"final-state-via": "azure-async-operation"}, + 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/applicationSecurityGroups/{applicationSecurityGroupName}", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "applicationSecurityGroupName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-08-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + value=self.ctx.vars.instance, + ) + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + _build_schema_application_security_group_read(cls._schema_on_200_201) + + return cls._schema_on_200_201 + + class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance(self.ctx.vars.instance) + + def _update_instance(self, instance): + _instance_value, _builder = self.new_content_builder( + self.ctx.args, + value=instance, + typ=AAZObjectType + ) + _builder.set_prop("location", AAZStrType, ".location") + _builder.set_prop("tags", AAZDictType, ".tags") + + tags = _builder.get(".tags") + if tags is not None: + tags.set_elements(AAZStrType, ".") + + return _instance_value + + class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): + + def __call__(self, *args, **kwargs): + self._update_instance_by_generic( + self.ctx.vars.instance, + self.ctx.generic_update_args + ) + + +_schema_application_security_group_read = None + + +def _build_schema_application_security_group_read(_schema): + global _schema_application_security_group_read + if _schema_application_security_group_read is not None: + _schema.etag = _schema_application_security_group_read.etag + _schema.id = _schema_application_security_group_read.id + _schema.location = _schema_application_security_group_read.location + _schema.name = _schema_application_security_group_read.name + _schema.properties = _schema_application_security_group_read.properties + _schema.tags = _schema_application_security_group_read.tags + _schema.type = _schema_application_security_group_read.type + return + + _schema_application_security_group_read = AAZObjectType() + + application_security_group_read = _schema_application_security_group_read + application_security_group_read.etag = AAZStrType( + flags={"read_only": True}, + ) + application_security_group_read.id = AAZStrType() + application_security_group_read.location = AAZStrType() + application_security_group_read.name = AAZStrType( + flags={"read_only": True}, + ) + application_security_group_read.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + application_security_group_read.tags = AAZDictType() + application_security_group_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_application_security_group_read.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.resource_guid = AAZStrType( + serialized_name="resourceGuid", + flags={"read_only": True}, + ) + + tags = _schema_application_security_group_read.tags + tags.Element = AAZStrType() + + _schema.etag = _schema_application_security_group_read.etag + _schema.id = _schema_application_security_group_read.id + _schema.location = _schema_application_security_group_read.location + _schema.name = _schema_application_security_group_read.name + _schema.properties = _schema_application_security_group_read.properties + _schema.tags = _schema_application_security_group_read.tags + _schema.type = _schema_application_security_group_read.type + + +__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/_wait.py new file mode 100644 index 00000000000..44e140517dd --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/asg/_wait.py @@ -0,0 +1,174 @@ +# -------------------------------------------------------------------------------------------- +# 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 asg wait", +) +class Wait(AAZWaitCommand): + """Place the CLI in a waiting state until a condition is met. + """ + + _aaz_info = { + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/applicationsecuritygroups/{}", "2021-08-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.name = AAZStrArg( + options=["-n", "--name"], + help="Name of the new application security group resource.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.ApplicationSecurityGroupsGet(ctx=self.ctx)() + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class ApplicationSecurityGroupsGet(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 [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "applicationSecurityGroupName", self.ctx.args.name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2021-08-01", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.id = AAZStrType() + _schema_on_200.location = AAZStrType() + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.resource_guid = AAZStrType( + serialized_name="resourceGuid", + flags={"read_only": True}, + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/commands.py b/src/azure-cli/azure/cli/command_modules/network/commands.py index 7de7e3ef530..4d36630f9de 100644 --- a/src/azure-cli/azure/cli/command_modules/network/commands.py +++ b/src/azure-cli/azure/cli/command_modules/network/commands.py @@ -21,7 +21,7 @@ cf_virtual_network_gateways, cf_traffic_manager_mgmt_endpoints, cf_traffic_manager_mgmt_profiles, cf_dns_mgmt_record_sets, cf_dns_mgmt_zones, cf_tm_geographic, cf_security_rules, cf_subnets, cf_usages, cf_service_community, - cf_public_ip_addresses, cf_endpoint_services, cf_application_security_groups, cf_connection_monitor, + cf_public_ip_addresses, cf_endpoint_services, cf_connection_monitor, cf_ddos_protection_plans, cf_public_ip_prefixes, cf_service_endpoint_policies, cf_service_endpoint_policy_definitions, cf_dns_references, cf_private_endpoints, cf_network_profiles, cf_express_route_circuit_connections, cf_express_route_gateways, cf_express_route_connections, @@ -87,11 +87,6 @@ def load_command_table(self, _): client_factory=None ) - network_asg_sdk = CliCommandType( - operations_tmpl='azure.mgmt.network.operations#ApplicationSecurityGroupsOperations.{}', - client_factory=cf_application_security_groups - ) - network_ddos_sdk = CliCommandType( operations_tmpl='azure.mgmt.network.operations#DdosProtectionPlansOperations.{}', client_factory=cf_ddos_protection_plans @@ -706,15 +701,6 @@ def _make_singular(value): # endregion - # region ApplicationSecurityGroups - with self.command_group('network asg', network_asg_sdk, client_factory=cf_application_security_groups, min_api='2017-09-01') as g: - g.custom_command('create', 'create_asg') - g.show_command('show', 'get') - g.command('list', 'list_all') - g.command('delete', 'begin_delete') - g.generic_update_command('update', setter_name='begin_create_or_update', custom_func_name='update_asg') - # endregion - # region DdosProtectionPlans with self.command_group('network ddos-protection', network_ddos_sdk, min_api='2018-02-01') as g: g.custom_command('create', 'create_ddos_plan') diff --git a/src/azure-cli/azure/cli/command_modules/network/custom.py b/src/azure-cli/azure/cli/command_modules/network/custom.py index af84d754c2b..56718983bed 100644 --- a/src/azure-cli/azure/cli/command_modules/network/custom.py +++ b/src/azure-cli/azure/cli/command_modules/network/custom.py @@ -2198,20 +2198,6 @@ def list_waf_exclusion_rule_set(cmd, client, resource_group_name, policy_name): # endregion -# region ApplicationSecurityGroups -def create_asg(cmd, client, resource_group_name, application_security_group_name, location=None, tags=None): - ApplicationSecurityGroup = cmd.get_models('ApplicationSecurityGroup') - asg = ApplicationSecurityGroup(location=location, tags=tags) - return client.begin_create_or_update(resource_group_name, application_security_group_name, asg) - - -def update_asg(instance, tags=None): - if tags is not None: - instance.tags = tags - return instance -# endregion - - # region DdosProtectionPlans def create_ddos_plan(cmd, resource_group_name, ddos_plan_name, location=None, tags=None, vnets=None): from azure.cli.core.commands import LongRunningOperation diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/hybrid_2018_03_01/recordings/test_network_asg.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/hybrid_2018_03_01/recordings/test_network_asg.yaml deleted file mode 100644 index 7a7b2d517e6..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/tests/hybrid_2018_03_01/recordings/test_network_asg.yaml +++ /dev/null @@ -1,723 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - network asg list - Connection: - - keep-alive - User-Agent: - - AZURECLI/2.16.0 azsdk-python-azure-mgmt-network/17.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/applicationSecurityGroups?api-version=2017-10-01 - response: - body: - string: '{"value":[]}' - headers: - cache-control: - - no-cache - content-length: - - '12' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 17 Dec 2020 03:53:10 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - network asg create - Connection: - - keep-alive - ParameterSetName: - - -g -n --tags - User-Agent: - - python/3.7.8 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-resource/10.3.0 Azure-SDK-For-Python AZURECLI/2.16.0 - accept-language: - - en-US - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_network_asg000001?api-version=2018-02-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001","name":"cli_test_network_asg000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-12-17T03:53:08Z"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '384' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 17 Dec 2020 03:53:11 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{"location": "westus", "tags": {"foo": "doo"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - network asg create - Connection: - - keep-alive - Content-Length: - - '46' - Content-Type: - - application/json - ParameterSetName: - - -g -n --tags - User-Agent: - - AZURECLI/2.16.0 azsdk-python-azure-mgmt-network/17.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1?api-version=2017-10-01 - response: - body: - string: "{\r\n \"name\": \"asg1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1\",\r\n - \ \"etag\": \"W/\\\"3ee19b73-5cfb-4d11-8183-41a506b1421e\\\"\",\r\n \"type\": - \"Microsoft.Network/applicationSecurityGroups\",\r\n \"location\": \"westus\",\r\n - \ \"tags\": {\r\n \"foo\": \"doo\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": - \"Updating\"\r\n }\r\n}" - headers: - azure-asyncnotification: - - Enabled - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/2e3eefd2-0ae4-4205-8ec3-9e2e21c8e497?api-version=2017-10-01 - cache-control: - - no-cache - content-length: - - '475' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 17 Dec 2020 03:53:17 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - 9dab4cda-7b2e-40bf-afbb-1825a0ab4ac7 - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - network asg create - Connection: - - keep-alive - ParameterSetName: - - -g -n --tags - User-Agent: - - AZURECLI/2.16.0 azsdk-python-azure-mgmt-network/17.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/2e3eefd2-0ae4-4205-8ec3-9e2e21c8e497?api-version=2017-10-01 - response: - body: - string: "{\r\n \"status\": \"Succeeded\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '29' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 17 Dec 2020 03:53:28 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - a36dc1ba-422a-4689-b7a9-56718da0ae4d - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - network asg create - Connection: - - keep-alive - ParameterSetName: - - -g -n --tags - User-Agent: - - AZURECLI/2.16.0 azsdk-python-azure-mgmt-network/17.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1?api-version=2017-10-01 - response: - body: - string: "{\r\n \"name\": \"asg1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1\",\r\n - \ \"etag\": \"W/\\\"568a03e8-6160-4e1b-938f-60bd38325c4c\\\"\",\r\n \"type\": - \"Microsoft.Network/applicationSecurityGroups\",\r\n \"location\": \"westus\",\r\n - \ \"tags\": {\r\n \"foo\": \"doo\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": - \"Succeeded\"\r\n }\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '476' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 17 Dec 2020 03:53:29 GMT - etag: - - W/"568a03e8-6160-4e1b-938f-60bd38325c4c" - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - f4cf675f-8546-45e4-b3b7-10d93119b253 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - network asg update - Connection: - - keep-alive - ParameterSetName: - - -g -n --tags - User-Agent: - - AZURECLI/2.16.0 azsdk-python-azure-mgmt-network/17.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1?api-version=2017-10-01 - response: - body: - string: "{\r\n \"name\": \"asg1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1\",\r\n - \ \"etag\": \"W/\\\"568a03e8-6160-4e1b-938f-60bd38325c4c\\\"\",\r\n \"type\": - \"Microsoft.Network/applicationSecurityGroups\",\r\n \"location\": \"westus\",\r\n - \ \"tags\": {\r\n \"foo\": \"doo\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": - \"Succeeded\"\r\n }\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '476' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 17 Dec 2020 03:53:30 GMT - etag: - - W/"568a03e8-6160-4e1b-938f-60bd38325c4c" - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - c30a9513-abeb-4f58-bdc1-c9db7556eb21 - status: - code: 200 - message: OK -- request: - body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1", - "location": "westus", "tags": {"foo": "bar"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - network asg update - Connection: - - keep-alive - Content-Length: - - '257' - Content-Type: - - application/json - ParameterSetName: - - -g -n --tags - User-Agent: - - AZURECLI/2.16.0 azsdk-python-azure-mgmt-network/17.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1?api-version=2017-10-01 - response: - body: - string: "{\r\n \"name\": \"asg1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1\",\r\n - \ \"etag\": \"W/\\\"ea5294b6-cc8d-4f8a-9a9c-82b8786b17c5\\\"\",\r\n \"type\": - \"Microsoft.Network/applicationSecurityGroups\",\r\n \"location\": \"westus\",\r\n - \ \"tags\": {\r\n \"foo\": \"bar\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": - \"Succeeded\"\r\n }\r\n}" - headers: - azure-asyncnotification: - - Enabled - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/ecde1471-803c-4c80-8426-a526b86960fa?api-version=2017-10-01 - cache-control: - - no-cache - content-length: - - '476' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 17 Dec 2020 03:53:34 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - 869748d1-e3ba-4ec5-af4d-13755b52da65 - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - network asg update - Connection: - - keep-alive - ParameterSetName: - - -g -n --tags - User-Agent: - - AZURECLI/2.16.0 azsdk-python-azure-mgmt-network/17.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/ecde1471-803c-4c80-8426-a526b86960fa?api-version=2017-10-01 - response: - body: - string: "{\r\n \"status\": \"Succeeded\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '29' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 17 Dec 2020 03:54:04 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - 2dda6670-1aff-49a5-9df3-125455045c97 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - network asg update - Connection: - - keep-alive - ParameterSetName: - - -g -n --tags - User-Agent: - - AZURECLI/2.16.0 azsdk-python-azure-mgmt-network/17.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1?api-version=2017-10-01 - response: - body: - string: "{\r\n \"name\": \"asg1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1\",\r\n - \ \"etag\": \"W/\\\"ea5294b6-cc8d-4f8a-9a9c-82b8786b17c5\\\"\",\r\n \"type\": - \"Microsoft.Network/applicationSecurityGroups\",\r\n \"location\": \"westus\",\r\n - \ \"tags\": {\r\n \"foo\": \"bar\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": - \"Succeeded\"\r\n }\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '476' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 17 Dec 2020 03:54:04 GMT - etag: - - W/"ea5294b6-cc8d-4f8a-9a9c-82b8786b17c5" - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - 1758f80d-951a-49d7-bc2a-e10c15d65b33 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - network asg list - Connection: - - keep-alive - User-Agent: - - AZURECLI/2.16.0 azsdk-python-azure-mgmt-network/17.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/applicationSecurityGroups?api-version=2017-10-01 - response: - body: - string: "{\r\n \"value\": [\r\n {\r\n \"name\": \"asg1\",\r\n \"id\": - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1\",\r\n - \ \"etag\": \"W/\\\"ea5294b6-cc8d-4f8a-9a9c-82b8786b17c5\\\"\",\r\n \"type\": - \"Microsoft.Network/applicationSecurityGroups\",\r\n \"location\": \"westus\",\r\n - \ \"tags\": {\r\n \"foo\": \"bar\"\r\n },\r\n \"properties\": - {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n - \ ]\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '553' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 17 Dec 2020 03:54:05 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - 0025b186-a325-4eca-94a4-8b9d820d3fb7 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - network asg show - Connection: - - keep-alive - ParameterSetName: - - -g -n - User-Agent: - - AZURECLI/2.16.0 azsdk-python-azure-mgmt-network/17.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1?api-version=2017-10-01 - response: - body: - string: "{\r\n \"name\": \"asg1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1\",\r\n - \ \"etag\": \"W/\\\"ea5294b6-cc8d-4f8a-9a9c-82b8786b17c5\\\"\",\r\n \"type\": - \"Microsoft.Network/applicationSecurityGroups\",\r\n \"location\": \"westus\",\r\n - \ \"tags\": {\r\n \"foo\": \"bar\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": - \"Succeeded\"\r\n }\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '476' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 17 Dec 2020 03:54:06 GMT - etag: - - W/"ea5294b6-cc8d-4f8a-9a9c-82b8786b17c5" - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - 627ab8da-a9a3-47e5-9c05-4cd8bf452752 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - network asg delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - -g -n - User-Agent: - - AZURECLI/2.16.0 azsdk-python-azure-mgmt-network/17.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1?api-version=2017-10-01 - response: - body: - string: '' - headers: - azure-asyncnotification: - - Enabled - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/f3c09b81-252a-4573-a30f-8c259c3915df?api-version=2017-10-01 - cache-control: - - no-cache - content-length: - - '0' - date: - - Thu, 17 Dec 2020 03:54:07 GMT - expires: - - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operationResults/f3c09b81-252a-4573-a30f-8c259c3915df?api-version=2017-10-01 - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - 050a0148-c6bc-4d52-93d1-ae940269f72f - x-ms-ratelimit-remaining-subscription-deletes: - - '14998' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - network asg delete - Connection: - - keep-alive - ParameterSetName: - - -g -n - User-Agent: - - AZURECLI/2.16.0 azsdk-python-azure-mgmt-network/17.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/f3c09b81-252a-4573-a30f-8c259c3915df?api-version=2017-10-01 - response: - body: - string: "{\r\n \"status\": \"Succeeded\"\r\n}" - headers: - cache-control: - - no-cache - content-length: - - '29' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 17 Dec 2020 03:54:18 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-arm-service-request-id: - - 14d84b5a-08cb-448b-a1f4-9e4aeefc6203 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - network asg list - Connection: - - keep-alive - User-Agent: - - AZURECLI/2.16.0 azsdk-python-azure-mgmt-network/17.0.0 Python/3.7.8 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/applicationSecurityGroups?api-version=2017-10-01 - response: - body: - string: '{"value":[]}' - headers: - cache-control: - - no-cache - content-length: - - '12' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 17 Dec 2020 03:54:19 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/hybrid_2018_03_01/test_network_commands.py b/src/azure-cli/azure/cli/command_modules/network/tests/hybrid_2018_03_01/test_network_commands.py index c9de5f05064..b12b2100abe 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/hybrid_2018_03_01/test_network_commands.py +++ b/src/azure-cli/azure/cli/command_modules/network/tests/hybrid_2018_03_01/test_network_commands.py @@ -22,32 +22,6 @@ TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) -class NetworkApplicationSecurityGroupScenario(ScenarioTest): - - @ResourceGroupPreparer(name_prefix='cli_test_network_asg') - def test_network_asg(self, resource_group): - - self.kwargs.update({ - 'asg': 'asg1' - }) - - count1 = len(self.cmd('network asg list').get_output_in_json()) - self.cmd('network asg create -g {rg} -n {asg} --tags foo=doo', - checks=self.check('tags.foo', 'doo')) - self.cmd('network asg update -g {rg} -n {asg} --tags foo=bar', - checks=self.check('tags.foo', 'bar')) - count2 = len(self.cmd('network asg list').get_output_in_json()) - self.assertTrue(count2 == count1 + 1) - self.cmd('network asg show -g {rg} -n {asg}', checks=[ - self.check('name', '{asg}'), - self.check('resourceGroup', '{rg}'), - self.check('tags.foo', 'bar') - ]) - self.cmd('network asg delete -g {rg} -n {asg}') - count3 = len(self.cmd('network asg list').get_output_in_json()) - self.assertTrue(count3 == count1) - - class NetworkLoadBalancerWithSku(ScenarioTest): @ResourceGroupPreparer(name_prefix='cli_test_network_lb_sku') diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_asg.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_asg.yaml index 76738c3afd9..7c0fecfec72 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_asg.yaml +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_asg.yaml @@ -11,34 +11,43 @@ interactions: Connection: - keep-alive User-Agent: - - AZURECLI/2.37.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.9.5 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/applicationSecurityGroups?api-version=2021-08-01 response: body: - string: '{"value":[]}' + string: "{\r\n \"value\": [\r\n {\r\n \"name\": \"ethan-asg1\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ethan-rg/providers/Microsoft.Network/applicationSecurityGroups/ethan-asg1\",\r\n + \ \"etag\": \"W/\\\"435c96f2-baf8-4d89-a8c1-f708ecc5f5ef\\\"\",\r\n \"type\": + \"Microsoft.Network/applicationSecurityGroups\",\r\n \"location\": \"eastus2\",\r\n + \ \"tags\": {\r\n \"foo\": \"doo\"\r\n },\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n + \ ]\r\n}" headers: cache-control: - no-cache content-length: - - '12' + - '499' content-type: - application/json; charset=utf-8 date: - - Thu, 26 May 2022 08:22:42 GMT + - Mon, 11 Jul 2022 07:08:24 GMT expires: - '-1' pragma: - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding x-content-type-options: - nosniff + x-ms-arm-service-request-id: + - dad13737-093c-443e-9995-3f3370fbe62b status: code: 200 - message: OK + message: '' - request: body: null headers: @@ -53,12 +62,12 @@ interactions: ParameterSetName: - -g -n --tags User-Agent: - - AZURECLI/2.37.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.9.5 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_network_asg000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001","name":"cli_test_network_asg000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2022-05-26T08:22:41Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001","name":"cli_test_network_asg000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2022-07-11T07:08:21Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -67,7 +76,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 26 May 2022 08:22:43 GMT + - Mon, 11 Jul 2022 07:08:25 GMT expires: - '-1' pragma: @@ -99,13 +108,13 @@ interactions: ParameterSetName: - -g -n --tags User-Agent: - - AZURECLI/2.37.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.9.5 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"asg1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1\",\r\n - \ \"etag\": \"W/\\\"3464d896-8000-4920-b082-32847a797662\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"9d493779-0681-4da0-8d8b-3f5a7afb2f4a\\\"\",\r\n \"type\": \"Microsoft.Network/applicationSecurityGroups\",\r\n \"location\": \"westus\",\r\n \ \"tags\": {\r\n \"foo\": \"doo\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\"\r\n }\r\n}" @@ -113,7 +122,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/ca500e85-2f0e-4f93-80c4-ebdebcdb7dca?api-version=2021-08-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/593f95e5-0eae-4861-bd07-85b3e357566d?api-version=2021-08-01 cache-control: - no-cache content-length: @@ -121,7 +130,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 26 May 2022 08:22:48 GMT + - Mon, 11 Jul 2022 07:08:31 GMT expires: - '-1' pragma: @@ -134,9 +143,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 2c5804fc-d845-4ed7-a0d7-bc4d07643568 + - 13a4103b-b57d-47e0-81e0-4bcc7aedc809 x-ms-ratelimit-remaining-subscription-writes: - - '1169' + - '1199' status: code: 201 message: Created @@ -154,9 +163,9 @@ interactions: ParameterSetName: - -g -n --tags User-Agent: - - AZURECLI/2.37.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.9.5 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/ca500e85-2f0e-4f93-80c4-ebdebcdb7dca?api-version=2021-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/593f95e5-0eae-4861-bd07-85b3e357566d?api-version=2021-08-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -168,7 +177,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 26 May 2022 08:22:59 GMT + - Mon, 11 Jul 2022 07:08:41 GMT expires: - '-1' pragma: @@ -185,7 +194,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 3b5e8673-5553-4053-b09c-efd9a037fafc + - 79d59e05-b82d-436e-be2b-6d5e63b1cc72 status: code: 200 message: OK @@ -203,13 +212,13 @@ interactions: ParameterSetName: - -g -n --tags User-Agent: - - AZURECLI/2.37.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.9.5 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"asg1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1\",\r\n - \ \"etag\": \"W/\\\"7c78cd2b-8250-4507-949d-f7d532755ad9\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"73c68720-8717-4874-8312-5030faf52ac3\\\"\",\r\n \"type\": \"Microsoft.Network/applicationSecurityGroups\",\r\n \"location\": \"westus\",\r\n \ \"tags\": {\r\n \"foo\": \"doo\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" @@ -221,9 +230,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 26 May 2022 08:22:59 GMT + - Mon, 11 Jul 2022 07:08:41 GMT etag: - - W/"7c78cd2b-8250-4507-949d-f7d532755ad9" + - W/"73c68720-8717-4874-8312-5030faf52ac3" expires: - '-1' pragma: @@ -240,7 +249,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 6dfd2434-e647-4a23-8449-2c5b16ba5494 + - 72a7d5a0-1fdb-4282-bbd7-462db95080f3 status: code: 200 message: OK @@ -258,13 +267,55 @@ interactions: ParameterSetName: - -g -n --tags User-Agent: - - AZURECLI/2.37.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.9.5 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_network_asg000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001","name":"cli_test_network_asg000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2022-07-11T07:08:21Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '330' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 11 Jul 2022 07:08:43 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network asg update + Connection: + - keep-alive + ParameterSetName: + - -g -n --tags + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"asg1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1\",\r\n - \ \"etag\": \"W/\\\"7c78cd2b-8250-4507-949d-f7d532755ad9\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"73c68720-8717-4874-8312-5030faf52ac3\\\"\",\r\n \"type\": \"Microsoft.Network/applicationSecurityGroups\",\r\n \"location\": \"westus\",\r\n \ \"tags\": {\r\n \"foo\": \"doo\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" @@ -276,9 +327,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 26 May 2022 08:23:01 GMT + - Mon, 11 Jul 2022 07:08:43 GMT etag: - - W/"7c78cd2b-8250-4507-949d-f7d532755ad9" + - W/"73c68720-8717-4874-8312-5030faf52ac3" expires: - '-1' pragma: @@ -295,13 +346,13 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 8c2ec342-311d-4448-8880-608b3571cb23 + - 7ebe8ac2-5ac9-4ce7-8550-d82eb311f4f2 status: code: 200 message: OK - request: body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1", - "location": "westus", "tags": {"foo": "bar"}}' + "location": "westus", "properties": {}, "tags": {"foo": "bar"}}' headers: Accept: - application/json @@ -312,19 +363,19 @@ interactions: Connection: - keep-alive Content-Length: - - '208' + - '226' Content-Type: - application/json ParameterSetName: - -g -n --tags User-Agent: - - AZURECLI/2.37.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.9.5 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"asg1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1\",\r\n - \ \"etag\": \"W/\\\"333e9a55-8c28-44d4-9528-43ff22edb497\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"3b7f5763-b829-4caf-b8d9-153e5a62e23a\\\"\",\r\n \"type\": \"Microsoft.Network/applicationSecurityGroups\",\r\n \"location\": \"westus\",\r\n \ \"tags\": {\r\n \"foo\": \"bar\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" @@ -332,7 +383,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/c61b436a-9ae7-4d6b-b45a-5e07ecdbc239?api-version=2021-08-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/5258dba2-864a-46e7-b72d-cb3412b32b02?api-version=2021-08-01 cache-control: - no-cache content-length: @@ -340,7 +391,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 26 May 2022 08:23:03 GMT + - Mon, 11 Jul 2022 07:08:47 GMT expires: - '-1' pragma: @@ -357,9 +408,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 73b8e2d0-9a7a-48e1-ad4b-9aec846f28ea + - f7e43944-6987-47a8-8b44-9e793a59387c x-ms-ratelimit-remaining-subscription-writes: - - '1177' + - '1198' status: code: 200 message: OK @@ -377,9 +428,9 @@ interactions: ParameterSetName: - -g -n --tags User-Agent: - - AZURECLI/2.37.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.9.5 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/c61b436a-9ae7-4d6b-b45a-5e07ecdbc239?api-version=2021-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/5258dba2-864a-46e7-b72d-cb3412b32b02?api-version=2021-08-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -391,7 +442,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 26 May 2022 08:23:33 GMT + - Mon, 11 Jul 2022 07:09:17 GMT expires: - '-1' pragma: @@ -408,7 +459,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 007ab6d9-a6a8-4c57-b57a-ce0b04d71234 + - 6606901b-35c0-4509-8cfb-b68cd5240a96 status: code: 200 message: OK @@ -426,13 +477,13 @@ interactions: ParameterSetName: - -g -n --tags User-Agent: - - AZURECLI/2.37.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.9.5 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"asg1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1\",\r\n - \ \"etag\": \"W/\\\"333e9a55-8c28-44d4-9528-43ff22edb497\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"3b7f5763-b829-4caf-b8d9-153e5a62e23a\\\"\",\r\n \"type\": \"Microsoft.Network/applicationSecurityGroups\",\r\n \"location\": \"westus\",\r\n \ \"tags\": {\r\n \"foo\": \"bar\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" @@ -444,9 +495,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 26 May 2022 08:23:33 GMT + - Mon, 11 Jul 2022 07:09:17 GMT etag: - - W/"333e9a55-8c28-44d4-9528-43ff22edb497" + - W/"3b7f5763-b829-4caf-b8d9-153e5a62e23a" expires: - '-1' pragma: @@ -463,7 +514,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 21411413-b467-4262-a184-87dcbbd42dd2 + - 79becbe6-e804-4e7e-8b69-c4584c06bb02 status: code: 200 message: OK @@ -479,44 +530,34 @@ interactions: Connection: - keep-alive User-Agent: - - AZURECLI/2.37.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.9.5 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/applicationSecurityGroups?api-version=2021-08-01 response: body: - string: "{\r\n \"value\": [\r\n {\r\n \"name\": \"asg1\",\r\n \"id\": - \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1\",\r\n - \ \"etag\": \"W/\\\"333e9a55-8c28-44d4-9528-43ff22edb497\\\"\",\r\n \"type\": - \"Microsoft.Network/applicationSecurityGroups\",\r\n \"location\": \"westus\",\r\n - \ \"tags\": {\r\n \"foo\": \"bar\"\r\n },\r\n \"properties\": - {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n - \ ]\r\n}" + string: '{"value":[{"name":"asg1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1","etag":"W/\"3b7f5763-b829-4caf-b8d9-153e5a62e23a\"","type":"Microsoft.Network/applicationSecurityGroups","location":"westus","tags":{"foo":"bar"},"properties":{"provisioningState":"Succeeded"}},{"name":"ethan-asg1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ethan-rg/providers/Microsoft.Network/applicationSecurityGroups/ethan-asg1","etag":"W/\"435c96f2-baf8-4d89-a8c1-f708ecc5f5ef\"","type":"Microsoft.Network/applicationSecurityGroups","location":"eastus2","tags":{"foo":"doo"},"properties":{"provisioningState":"Succeeded"}}]}' headers: cache-control: - no-cache content-length: - - '504' + - '744' content-type: - application/json; charset=utf-8 date: - - Thu, 26 May 2022 08:23:34 GMT + - Mon, 11 Jul 2022 07:09:18 GMT expires: - '-1' pragma: - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked vary: - Accept-Encoding x-content-type-options: - nosniff - x-ms-arm-service-request-id: - - e625d479-76ec-45e4-b17f-20c653a58d6c + x-ms-original-request-ids: + - 2c253012-4ea3-470d-92f8-e29e7478129a + - be6e0e18-d810-4440-a133-eb24e3ee2731 status: code: 200 message: OK @@ -534,13 +575,13 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.37.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.9.5 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"asg1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1\",\r\n - \ \"etag\": \"W/\\\"333e9a55-8c28-44d4-9528-43ff22edb497\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"3b7f5763-b829-4caf-b8d9-153e5a62e23a\\\"\",\r\n \"type\": \"Microsoft.Network/applicationSecurityGroups\",\r\n \"location\": \"westus\",\r\n \ \"tags\": {\r\n \"foo\": \"bar\"\r\n },\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" @@ -552,9 +593,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 26 May 2022 08:23:35 GMT + - Mon, 11 Jul 2022 07:09:19 GMT etag: - - W/"333e9a55-8c28-44d4-9528-43ff22edb497" + - W/"3b7f5763-b829-4caf-b8d9-153e5a62e23a" expires: - '-1' pragma: @@ -571,7 +612,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 8ae4aa8a-e2f2-4a09-aad3-6192d3154dc7 + - f8454842-f494-4ba6-a604-611128b946eb status: code: 200 message: OK @@ -579,7 +620,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -591,7 +632,7 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.37.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.9.5 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_network_asg000001/providers/Microsoft.Network/applicationSecurityGroups/asg1?api-version=2021-08-01 response: @@ -601,17 +642,17 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/73ad3cad-f85c-4bc4-a37b-a54f20e56d78?api-version=2021-08-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/34ee2660-bc17-4870-afff-ab5d21270ff8?api-version=2021-08-01 cache-control: - no-cache content-length: - '0' date: - - Thu, 26 May 2022 08:23:37 GMT + - Mon, 11 Jul 2022 07:09:21 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operationResults/73ad3cad-f85c-4bc4-a37b-a54f20e56d78?api-version=2021-08-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operationResults/34ee2660-bc17-4870-afff-ab5d21270ff8?api-version=2021-08-01 pragma: - no-cache server: @@ -622,9 +663,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 2b99cdaf-3c43-4b8f-849c-e01bfac1bdd1 + - 615e1887-0b50-4953-b689-93368ac5dd23 x-ms-ratelimit-remaining-subscription-deletes: - - '14985' + - '14999' status: code: 202 message: Accepted @@ -642,9 +683,9 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.37.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.9.5 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/73ad3cad-f85c-4bc4-a37b-a54f20e56d78?api-version=2021-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/34ee2660-bc17-4870-afff-ab5d21270ff8?api-version=2021-08-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -656,7 +697,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 26 May 2022 08:23:47 GMT + - Mon, 11 Jul 2022 07:09:31 GMT expires: - '-1' pragma: @@ -673,7 +714,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 0f1b9a0c-bf84-456a-b58e-90982bc97a44 + - a0c106e7-74e9-440e-a4b3-14884605c6ad status: code: 200 message: OK @@ -691,9 +732,9 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.37.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.9.5 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operationResults/73ad3cad-f85c-4bc4-a37b-a54f20e56d78?api-version=2021-08-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operationResults/34ee2660-bc17-4870-afff-ab5d21270ff8?api-version=2021-08-01 response: body: string: '' @@ -701,17 +742,17 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/73ad3cad-f85c-4bc4-a37b-a54f20e56d78?api-version=2021-08-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/34ee2660-bc17-4870-afff-ab5d21270ff8?api-version=2021-08-01 cache-control: - no-cache content-type: - application/json; charset=utf-8 date: - - Thu, 26 May 2022 08:23:48 GMT + - Mon, 11 Jul 2022 07:09:32 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operationResults/73ad3cad-f85c-4bc4-a37b-a54f20e56d78?api-version=2021-08-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operationResults/34ee2660-bc17-4870-afff-ab5d21270ff8?api-version=2021-08-01 pragma: - no-cache server: @@ -722,7 +763,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 2b99cdaf-3c43-4b8f-849c-e01bfac1bdd1 + - 615e1887-0b50-4953-b689-93368ac5dd23 status: code: 204 message: No Content @@ -738,32 +779,45 @@ interactions: Connection: - keep-alive User-Agent: - - AZURECLI/2.37.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.9.5 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/applicationSecurityGroups?api-version=2021-08-01 response: body: - string: '{"value":[]}' + string: "{\r\n \"value\": [\r\n {\r\n \"name\": \"ethan-asg1\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ethan-rg/providers/Microsoft.Network/applicationSecurityGroups/ethan-asg1\",\r\n + \ \"etag\": \"W/\\\"435c96f2-baf8-4d89-a8c1-f708ecc5f5ef\\\"\",\r\n \"type\": + \"Microsoft.Network/applicationSecurityGroups\",\r\n \"location\": \"eastus2\",\r\n + \ \"tags\": {\r\n \"foo\": \"doo\"\r\n },\r\n \"properties\": + {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n + \ ]\r\n}" headers: cache-control: - no-cache content-length: - - '12' + - '499' content-type: - application/json; charset=utf-8 date: - - Thu, 26 May 2022 08:23:49 GMT + - Mon, 11 Jul 2022 07:09:33 GMT expires: - '-1' pragma: - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked vary: - Accept-Encoding x-content-type-options: - nosniff + x-ms-arm-service-request-id: + - 260908f7-8853-48e6-bb2c-7bc3186ad423 status: code: 200 - message: OK + message: '' version: 1