From 66752bc6acb88c336d224a2aa4a384e165b77542 Mon Sep 17 00:00:00 2001 From: Nikhil Saxena Date: Mon, 17 Oct 2022 01:30:18 +0530 Subject: [PATCH 01/12] Added commands for nsp --- src/nsp/HISTORY.rst | 8 + src/nsp/README.md | 5 + src/nsp/azext_nsp/__init__.py | 42 ++ src/nsp/azext_nsp/_help.py | 11 + src/nsp/azext_nsp/_params.py | 13 + src/nsp/azext_nsp/aaz/__init__.py | 6 + src/nsp/azext_nsp/aaz/latest/__init__.py | 6 + .../aaz/latest/network/__cmd_group.py | 23 + .../azext_nsp/aaz/latest/network/__init__.py | 11 + .../latest/network/perimeter/__cmd_group.py | 23 + .../aaz/latest/network/perimeter/__init__.py | 15 + .../aaz/latest/network/perimeter/_create.py | 209 +++++++ .../aaz/latest/network/perimeter/_delete.py | 122 +++++ .../aaz/latest/network/perimeter/_list.py | 305 +++++++++++ .../aaz/latest/network/perimeter/_show.py | 170 ++++++ .../perimeter/association/__cmd_group.py | 23 + .../network/perimeter/association/__init__.py | 17 + .../network/perimeter/association/_create.py | 298 ++++++++++ .../network/perimeter/association/_delete.py | 156 ++++++ .../network/perimeter/association/_list.py | 222 ++++++++ .../network/perimeter/association/_show.py | 206 +++++++ .../network/perimeter/association/_update.py | 446 +++++++++++++++ .../network/perimeter/association/_wait.py | 205 +++++++ .../onboarded_resources/__cmd_group.py | 23 + .../perimeter/onboarded_resources/__init__.py | 12 + .../perimeter/onboarded_resources/_list.py | 178 ++++++ .../network/perimeter/profile/__cmd_group.py | 23 + .../network/perimeter/profile/__init__.py | 15 + .../network/perimeter/profile/_create.py | 215 ++++++++ .../network/perimeter/profile/_delete.py | 132 +++++ .../latest/network/perimeter/profile/_list.py | 192 +++++++ .../latest/network/perimeter/profile/_show.py | 176 ++++++ .../profile/access_rule/__cmd_group.py | 23 + .../perimeter/profile/access_rule/__init__.py | 16 + .../perimeter/profile/access_rule/_create.py | 348 ++++++++++++ .../perimeter/profile/access_rule/_delete.py | 142 +++++ .../perimeter/profile/access_rule/_list.py | 237 ++++++++ .../perimeter/profile/access_rule/_show.py | 222 ++++++++ .../perimeter/profile/access_rule/_update.py | 509 ++++++++++++++++++ src/nsp/azext_nsp/azext_metadata.json | 4 + src/nsp/azext_nsp/commands.py | 15 + src/nsp/azext_nsp/custom.py | 14 + src/nsp/azext_nsp/tests/__init__.py | 6 + src/nsp/azext_nsp/tests/latest/__init__.py | 6 + src/nsp/azext_nsp/tests/latest/test_nsp.py | 13 + src/nsp/setup.cfg | 1 + src/nsp/setup.py | 49 ++ 47 files changed, 5113 insertions(+) create mode 100644 src/nsp/HISTORY.rst create mode 100644 src/nsp/README.md create mode 100644 src/nsp/azext_nsp/__init__.py create mode 100644 src/nsp/azext_nsp/_help.py create mode 100644 src/nsp/azext_nsp/_params.py create mode 100644 src/nsp/azext_nsp/aaz/__init__.py create mode 100644 src/nsp/azext_nsp/aaz/latest/__init__.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/__cmd_group.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/__init__.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/__cmd_group.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/__init__.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/_create.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/_delete.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/_list.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/_show.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/association/__cmd_group.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/association/__init__.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_create.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_delete.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_list.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_show.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_update.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_wait.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/onboarded_resources/__cmd_group.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/onboarded_resources/__init__.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/onboarded_resources/_list.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/__cmd_group.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/__init__.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_create.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_delete.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_list.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_show.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/__cmd_group.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/__init__.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_create.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_delete.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_list.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_show.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_update.py create mode 100644 src/nsp/azext_nsp/azext_metadata.json create mode 100644 src/nsp/azext_nsp/commands.py create mode 100644 src/nsp/azext_nsp/custom.py create mode 100644 src/nsp/azext_nsp/tests/__init__.py create mode 100644 src/nsp/azext_nsp/tests/latest/__init__.py create mode 100644 src/nsp/azext_nsp/tests/latest/test_nsp.py create mode 100644 src/nsp/setup.cfg create mode 100644 src/nsp/setup.py diff --git a/src/nsp/HISTORY.rst b/src/nsp/HISTORY.rst new file mode 100644 index 00000000000..8c34bccfff8 --- /dev/null +++ b/src/nsp/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. \ No newline at end of file diff --git a/src/nsp/README.md b/src/nsp/README.md new file mode 100644 index 00000000000..7d36df9d3e0 --- /dev/null +++ b/src/nsp/README.md @@ -0,0 +1,5 @@ +# Azure CLI Nsp Extension # +This is an extension to Azure CLI to manage Nsp resources. + +## How to use ## +Please add commands usage here. \ No newline at end of file diff --git a/src/nsp/azext_nsp/__init__.py b/src/nsp/azext_nsp/__init__.py new file mode 100644 index 00000000000..c6bc81fda4c --- /dev/null +++ b/src/nsp/azext_nsp/__init__.py @@ -0,0 +1,42 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader +from azext_nsp._help import helps # pylint: disable=unused-import + + +class NspCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + custom_command_type = CliCommandType( + operations_tmpl='azext_nsp.custom#{}') + super().__init__(cli_ctx=cli_ctx, + custom_command_type=custom_command_type) + + def load_command_table(self, args): + from azext_nsp.commands import load_command_table + from azure.cli.core.aaz import load_aaz_command_table + try: + from . import aaz + except ImportError: + aaz = None + if aaz: + load_aaz_command_table( + loader=self, + aaz_pkg_name=aaz.__name__, + args=args + ) + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from azext_nsp._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = NspCommandsLoader diff --git a/src/nsp/azext_nsp/_help.py b/src/nsp/azext_nsp/_help.py new file mode 100644 index 00000000000..126d5d00714 --- /dev/null +++ b/src/nsp/azext_nsp/_help.py @@ -0,0 +1,11 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +# pylint: disable=too-many-lines + +from knack.help_files import helps # pylint: disable=unused-import diff --git a/src/nsp/azext_nsp/_params.py b/src/nsp/azext_nsp/_params.py new file mode 100644 index 00000000000..cfcec717c9c --- /dev/null +++ b/src/nsp/azext_nsp/_params.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + + +def load_arguments(self, _): # pylint: disable=unused-argument + pass diff --git a/src/nsp/azext_nsp/aaz/__init__.py b/src/nsp/azext_nsp/aaz/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/nsp/azext_nsp/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/nsp/azext_nsp/aaz/latest/__init__.py b/src/nsp/azext_nsp/aaz/latest/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/nsp/azext_nsp/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/nsp/azext_nsp/aaz/latest/network/__cmd_group.py b/src/nsp/azext_nsp/aaz/latest/network/__cmd_group.py new file mode 100644 index 00000000000..5093d2928ba --- /dev/null +++ b/src/nsp/azext_nsp/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/nsp/azext_nsp/aaz/latest/network/__init__.py b/src/nsp/azext_nsp/aaz/latest/network/__init__.py new file mode 100644 index 00000000000..5a9d61963d6 --- /dev/null +++ b/src/nsp/azext_nsp/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/nsp/azext_nsp/aaz/latest/network/perimeter/__cmd_group.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/__cmd_group.py new file mode 100644 index 00000000000..d6ba9595326 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/__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 perimeter", +) +class __CMDGroup(AAZCommandGroup): + """Manage Network Security Perimeters + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/__init__.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/__init__.py new file mode 100644 index 00000000000..efc3964e3fb --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/__init__.py @@ -0,0 +1,15 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/_create.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/_create.py new file mode 100644 index 00000000000..78482a91340 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/_create.py @@ -0,0 +1,209 @@ +# -------------------------------------------------------------------------------------------- +# 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 perimeter create", +) +class Create(AAZCommand): + """Creates or updates a Network Security Perimeter. + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}", "2021-02-01-preview"], + ] + } + + 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.perimeter_name = AAZStrArg( + options=["-n", "--name", "--perimeter-name"], + help="The name of the network security perimeter.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="The location in which NSP is created.", + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + return cls._args_schema + + def _execute_operations(self): + self.NetworkSecurityPerimetersCreateOrUpdate(ctx=self.ctx)() + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NetworkSecurityPerimetersCreateOrUpdate(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, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}", + **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( + "networkSecurityPerimeterName", self.ctx.args.perimeter_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-02-01-preview", + 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("name", AAZStrType, ".perimeter_name") + _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.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.location = AAZStrType() + _schema_on_200_201.name = AAZStrType() + _schema_on_200_201.properties = AAZObjectType() + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.perimeter_guid = AAZStrType( + serialized_name="perimeterGuid", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + 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/nsp/azext_nsp/aaz/latest/network/perimeter/_delete.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/_delete.py new file mode 100644 index 00000000000..a7364fd47c6 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/_delete.py @@ -0,0 +1,122 @@ +# -------------------------------------------------------------------------------------------- +# 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 perimeter delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Deletes a network security perimeter. + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}", "2021-02-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return 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.perimeter_name = AAZStrArg( + options=["-n", "--name", "--perimeter-name"], + help="The name of the network security perimeter.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.NetworkSecurityPerimetersDelete(ctx=self.ctx)() + + class NetworkSecurityPerimetersDelete(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) + if session.http_response.status_code in [204]: + return self.on_204(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}", + **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( + "networkSecurityPerimeterName", self.ctx.args.perimeter_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-02-01-preview", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +__all__ = ["Delete"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/_list.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/_list.py new file mode 100644 index 00000000000..e5c1040ed2b --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/_list.py @@ -0,0 +1,305 @@ +# -------------------------------------------------------------------------------------------- +# 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 perimeter list", +) +class List(AAZCommand): + """List all network security perimeters in a subscription. + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/networksecurityperimeters", "2021-02-01-preview"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters", "2021-02-01-preview"], + ] + } + + 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() + _args_schema.skip_token = AAZStrArg( + options=["--skip-token"], + help="SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls.", + ) + _args_schema.top = AAZIntArg( + options=["--top"], + help="An optional query parameter which specifies the maximum number of records to be returned by the server.", + fmt=AAZIntArgFormat( + maximum=20, + minimum=1, + ), + ) + 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.NetworkSecurityPerimetersList(ctx=self.ctx)() + if condition_1: + self.NetworkSecurityPerimetersListBySubscription(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 NetworkSecurityPerimetersList(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/networkSecurityPerimeters", + **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( + "$skipToken", self.ctx.args.skip_token, + ), + **self.serialize_query_param( + "$top", self.ctx.args.top, + ), + **self.serialize_query_param( + "api-version", "2021-02-01-preview", + 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", + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType() + _element.name = AAZStrType() + _element.properties = AAZObjectType() + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.perimeter_guid = AAZStrType( + serialized_name="perimeterGuid", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + class NetworkSecurityPerimetersListBySubscription(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/networkSecurityPerimeters", + **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( + "$skipToken", self.ctx.args.skip_token, + ), + **self.serialize_query_param( + "$top", self.ctx.args.top, + ), + **self.serialize_query_param( + "api-version", "2021-02-01-preview", + 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", + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType() + _element.name = AAZStrType() + _element.properties = AAZObjectType() + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.perimeter_guid = AAZStrType( + serialized_name="perimeterGuid", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + 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/nsp/azext_nsp/aaz/latest/network/perimeter/_show.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/_show.py new file mode 100644 index 00000000000..d8d6488e776 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/_show.py @@ -0,0 +1,170 @@ +# -------------------------------------------------------------------------------------------- +# 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 perimeter show", +) +class Show(AAZCommand): + """Gets the specified network security perimeter by the name. + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}", "2021-02-01-preview"], + ] + } + + 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.perimeter_name = AAZStrArg( + options=["-n", "--name", "--perimeter-name"], + help="The name of the network security perimeter.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.NetworkSecurityPerimetersGet(ctx=self.ctx)() + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NetworkSecurityPerimetersGet(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/networkSecurityPerimeters/{networkSecurityPerimeterName}", + **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( + "networkSecurityPerimeterName", self.ctx.args.perimeter_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-02-01-preview", + 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.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType() + _schema_on_200.name = AAZStrType() + _schema_on_200.properties = AAZObjectType() + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.perimeter_guid = AAZStrType( + serialized_name="perimeterGuid", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +__all__ = ["Show"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/__cmd_group.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/__cmd_group.py new file mode 100644 index 00000000000..e59b2d6a4f1 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/__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 perimeter association", +) +class __CMDGroup(AAZCommandGroup): + """Manage NSP Associations + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/__init__.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/__init__.py new file mode 100644 index 00000000000..db73033039b --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/__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/nsp/azext_nsp/aaz/latest/network/perimeter/association/_create.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_create.py new file mode 100644 index 00000000000..13e58cb93d6 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_create.py @@ -0,0 +1,298 @@ +# -------------------------------------------------------------------------------------------- +# 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 perimeter association create", +) +class Create(AAZCommand): + """Creates or updates a NSP resource association. + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/resourceassociations/{}", "2021-02-01-preview"], + ] + } + + 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.association_name = AAZStrArg( + options=["-n", "--name", "--association-name"], + help="The name of the NSP association.", + required=True, + id_part="child_name_1", + ) + _args_schema.perimeter_name = AAZStrArg( + options=["--perimeter-name"], + help="The name of the network security perimeter.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="Resource location.", + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.access_mode = AAZStrArg( + options=["--access-mode"], + arg_group="Properties", + help="Access mode on the association.", + enum={"Audit": "Audit", "Enforced": "Enforced", "Learning": "Learning"}, + ) + _args_schema.private_link_resource = AAZObjectArg( + options=["--private-link-resource"], + arg_group="Properties", + help="The PaaS resource to be associated.", + ) + cls._build_args_sub_resource_create(_args_schema.private_link_resource) + _args_schema.profile = AAZObjectArg( + options=["--profile"], + arg_group="Properties", + help="Profile id to which the PaaS resource is associated.", + ) + cls._build_args_sub_resource_create(_args_schema.profile) + return cls._args_schema + + _args_sub_resource_create = None + + @classmethod + def _build_args_sub_resource_create(cls, _schema): + if cls._args_sub_resource_create is not None: + _schema.id = cls._args_sub_resource_create.id + return + + cls._args_sub_resource_create = AAZObjectArg() + + sub_resource_create = cls._args_sub_resource_create + sub_resource_create.id = AAZStrArg( + options=["id"], + help="Resource ID.", + ) + + _schema.id = cls._args_sub_resource_create.id + + def _execute_operations(self): + self.NspAssociationsCreateOrUpdate(ctx=self.ctx)() + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NspAssociationsCreateOrUpdate(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, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/resourceAssociations/{associationName}", + **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( + "associationName", self.ctx.args.association_name, + required=True, + ), + **self.serialize_url_param( + "networkSecurityPerimeterName", self.ctx.args.perimeter_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-02-01-preview", + 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("name", AAZStrType, ".association_name") + _builder.set_prop("properties", AAZObjectType) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("accessMode", AAZStrType, ".access_mode") + _build_schema_sub_resource_create(properties.set_prop("privateLinkResource", AAZObjectType, ".private_link_resource")) + _build_schema_sub_resource_create(properties.set_prop("profile", AAZObjectType, ".profile")) + + 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.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.location = AAZStrType() + _schema_on_200_201.name = AAZStrType() + _schema_on_200_201.properties = AAZObjectType() + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.access_mode = AAZStrType( + serialized_name="accessMode", + ) + properties.has_provisioning_issues = AAZStrType( + serialized_name="hasProvisioningIssues", + flags={"read_only": True}, + ) + properties.private_link_resource = AAZObjectType( + serialized_name="privateLinkResource", + ) + _build_schema_sub_resource_read(properties.private_link_resource) + properties.profile = AAZObjectType() + _build_schema_sub_resource_read(properties.profile) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +def _build_schema_sub_resource_create(_builder): + if _builder is None: + return + _builder.set_prop("id", AAZStrType, ".id") + + +_schema_sub_resource_read = None + + +def _build_schema_sub_resource_read(_schema): + global _schema_sub_resource_read + if _schema_sub_resource_read is not None: + _schema.id = _schema_sub_resource_read.id + return + + _schema_sub_resource_read = AAZObjectType() + + sub_resource_read = _schema_sub_resource_read + sub_resource_read.id = AAZStrType() + + _schema.id = _schema_sub_resource_read.id + + +__all__ = ["Create"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_delete.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_delete.py new file mode 100644 index 00000000000..aa9a30122be --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_delete.py @@ -0,0 +1,156 @@ +# -------------------------------------------------------------------------------------------- +# 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 perimeter association delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Deletes an NSP association resource. + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/resourceassociations/{}", "2021-02-01-preview"], + ] + } + + 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.association_name = AAZStrArg( + options=["-n", "--name", "--association-name"], + help="The name of the NSP association.", + required=True, + id_part="child_name_1", + ) + _args_schema.perimeter_name = AAZStrArg( + options=["--perimeter-name"], + help="The name of the network security perimeter.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + yield self.NspAssociationsDelete(ctx=self.ctx)() + + class NspAssociationsDelete(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": "azure-async-operation"}, + 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": "azure-async-operation"}, + 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": "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/networkSecurityPerimeters/{networkSecurityPerimeterName}/resourceAssociations/{associationName}", + **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( + "associationName", self.ctx.args.association_name, + required=True, + ), + **self.serialize_url_param( + "networkSecurityPerimeterName", self.ctx.args.perimeter_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-02-01-preview", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +__all__ = ["Delete"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_list.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_list.py new file mode 100644 index 00000000000..ac3368b6b5d --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_list.py @@ -0,0 +1,222 @@ +# -------------------------------------------------------------------------------------------- +# 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 perimeter association list", +) +class List(AAZCommand): + """Lists the NSP resource associations. + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/resourceassociations", "2021-02-01-preview"], + ] + } + + 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.perimeter_name = AAZStrArg( + options=["--perimeter-name"], + help="The name of the network security perimeter.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.skip_token = AAZStrArg( + options=["--skip-token"], + help="SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls.", + ) + _args_schema.top = AAZIntArg( + options=["--top"], + help="An optional query parameter which specifies the maximum number of records to be returned by the server.", + fmt=AAZIntArgFormat( + maximum=20, + minimum=1, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.NspAssociationsList(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 NspAssociationsList(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/networkSecurityPerimeters/{networkSecurityPerimeterName}/resourceAssociations", + **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( + "networkSecurityPerimeterName", self.ctx.args.perimeter_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( + "$skipToken", self.ctx.args.skip_token, + ), + **self.serialize_query_param( + "$top", self.ctx.args.top, + ), + **self.serialize_query_param( + "api-version", "2021-02-01-preview", + 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", + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType() + _element.name = AAZStrType() + _element.properties = AAZObjectType() + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.access_mode = AAZStrType( + serialized_name="accessMode", + ) + properties.has_provisioning_issues = AAZStrType( + serialized_name="hasProvisioningIssues", + flags={"read_only": True}, + ) + properties.private_link_resource = AAZObjectType( + serialized_name="privateLinkResource", + ) + _build_schema_sub_resource_read(properties.private_link_resource) + properties.profile = AAZObjectType() + _build_schema_sub_resource_read(properties.profile) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +_schema_sub_resource_read = None + + +def _build_schema_sub_resource_read(_schema): + global _schema_sub_resource_read + if _schema_sub_resource_read is not None: + _schema.id = _schema_sub_resource_read.id + return + + _schema_sub_resource_read = AAZObjectType() + + sub_resource_read = _schema_sub_resource_read + sub_resource_read.id = AAZStrType() + + _schema.id = _schema_sub_resource_read.id + + +__all__ = ["List"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_show.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_show.py new file mode 100644 index 00000000000..e6a8218bdf3 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_show.py @@ -0,0 +1,206 @@ +# -------------------------------------------------------------------------------------------- +# 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 perimeter association show", +) +class Show(AAZCommand): + """Gets the specified NSP association by name. + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/resourceassociations/{}", "2021-02-01-preview"], + ] + } + + 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.association_name = AAZStrArg( + options=["-n", "--name", "--association-name"], + help="The name of the NSP association.", + required=True, + id_part="child_name_1", + ) + _args_schema.perimeter_name = AAZStrArg( + options=["--perimeter-name"], + help="The name of the network security perimeter.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.NspAssociationsGet(ctx=self.ctx)() + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NspAssociationsGet(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/networkSecurityPerimeters/{networkSecurityPerimeterName}/resourceAssociations/{associationName}", + **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( + "associationName", self.ctx.args.association_name, + required=True, + ), + **self.serialize_url_param( + "networkSecurityPerimeterName", self.ctx.args.perimeter_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-02-01-preview", + 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.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType() + _schema_on_200.name = AAZStrType() + _schema_on_200.properties = AAZObjectType() + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.access_mode = AAZStrType( + serialized_name="accessMode", + ) + properties.has_provisioning_issues = AAZStrType( + serialized_name="hasProvisioningIssues", + flags={"read_only": True}, + ) + properties.private_link_resource = AAZObjectType( + serialized_name="privateLinkResource", + ) + _build_schema_sub_resource_read(properties.private_link_resource) + properties.profile = AAZObjectType() + _build_schema_sub_resource_read(properties.profile) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +_schema_sub_resource_read = None + + +def _build_schema_sub_resource_read(_schema): + global _schema_sub_resource_read + if _schema_sub_resource_read is not None: + _schema.id = _schema_sub_resource_read.id + return + + _schema_sub_resource_read = AAZObjectType() + + sub_resource_read = _schema_sub_resource_read + sub_resource_read.id = AAZStrType() + + _schema.id = _schema_sub_resource_read.id + + +__all__ = ["Show"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_update.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_update.py new file mode 100644 index 00000000000..2c076027087 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_update.py @@ -0,0 +1,446 @@ +# -------------------------------------------------------------------------------------------- +# 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 perimeter association update", +) +class Update(AAZCommand): + """Creates or updates a NSP resource association. + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/resourceassociations/{}", "2021-02-01-preview"], + ] + } + + AZ_SUPPORT_GENERIC_UPDATE = True + + 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.association_name = AAZStrArg( + options=["-n", "--name", "--association-name"], + help="The name of the NSP association.", + required=True, + id_part="child_name_1", + ) + _args_schema.perimeter_name = AAZStrArg( + options=["--perimeter-name"], + help="The name of the network security perimeter.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="Resource location.", + nullable=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.access_mode = AAZStrArg( + options=["--access-mode"], + arg_group="Properties", + help="Access mode on the association.", + nullable=True, + enum={"Audit": "Audit", "Enforced": "Enforced", "Learning": "Learning"}, + ) + _args_schema.private_link_resource = AAZObjectArg( + options=["--private-link-resource"], + arg_group="Properties", + help="The PaaS resource to be associated.", + nullable=True, + ) + cls._build_args_sub_resource_update(_args_schema.private_link_resource) + _args_schema.profile = AAZObjectArg( + options=["--profile"], + arg_group="Properties", + help="Profile id to which the PaaS resource is associated.", + nullable=True, + ) + cls._build_args_sub_resource_update(_args_schema.profile) + return cls._args_schema + + _args_sub_resource_update = None + + @classmethod + def _build_args_sub_resource_update(cls, _schema): + if cls._args_sub_resource_update is not None: + _schema.id = cls._args_sub_resource_update.id + return + + cls._args_sub_resource_update = AAZObjectArg( + nullable=True, + ) + + sub_resource_update = cls._args_sub_resource_update + sub_resource_update.id = AAZStrArg( + options=["id"], + help="Resource ID.", + nullable=True, + ) + + _schema.id = cls._args_sub_resource_update.id + + def _execute_operations(self): + self.NspAssociationsGet(ctx=self.ctx)() + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.NspAssociationsCreateOrUpdate(ctx=self.ctx)() + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NspAssociationsGet(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/networkSecurityPerimeters/{networkSecurityPerimeterName}/resourceAssociations/{associationName}", + **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( + "associationName", self.ctx.args.association_name, + required=True, + ), + **self.serialize_url_param( + "networkSecurityPerimeterName", self.ctx.args.perimeter_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-02-01-preview", + 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_nsp_association_read(cls._schema_on_200) + + return cls._schema_on_200 + + class NspAssociationsCreateOrUpdate(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, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/resourceAssociations/{associationName}", + **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( + "associationName", self.ctx.args.association_name, + required=True, + ), + **self.serialize_url_param( + "networkSecurityPerimeterName", self.ctx.args.perimeter_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-02-01-preview", + 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_nsp_association_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("name", AAZStrType, ".association_name") + _builder.set_prop("properties", AAZObjectType) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("accessMode", AAZStrType, ".access_mode") + _build_schema_sub_resource_update(properties.set_prop("privateLinkResource", AAZObjectType, ".private_link_resource")) + _build_schema_sub_resource_update(properties.set_prop("profile", AAZObjectType, ".profile")) + + 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 + ) + + +def _build_schema_sub_resource_update(_builder): + if _builder is None: + return + _builder.set_prop("id", AAZStrType, ".id") + + +_schema_nsp_association_read = None + + +def _build_schema_nsp_association_read(_schema): + global _schema_nsp_association_read + if _schema_nsp_association_read is not None: + _schema.id = _schema_nsp_association_read.id + _schema.location = _schema_nsp_association_read.location + _schema.name = _schema_nsp_association_read.name + _schema.properties = _schema_nsp_association_read.properties + _schema.tags = _schema_nsp_association_read.tags + _schema.type = _schema_nsp_association_read.type + return + + _schema_nsp_association_read = AAZObjectType() + + nsp_association_read = _schema_nsp_association_read + nsp_association_read.id = AAZStrType( + flags={"read_only": True}, + ) + nsp_association_read.location = AAZStrType() + nsp_association_read.name = AAZStrType() + nsp_association_read.properties = AAZObjectType() + nsp_association_read.tags = AAZDictType() + nsp_association_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_nsp_association_read.properties + properties.access_mode = AAZStrType( + serialized_name="accessMode", + ) + properties.has_provisioning_issues = AAZStrType( + serialized_name="hasProvisioningIssues", + flags={"read_only": True}, + ) + properties.private_link_resource = AAZObjectType( + serialized_name="privateLinkResource", + ) + _build_schema_sub_resource_read(properties.private_link_resource) + properties.profile = AAZObjectType() + _build_schema_sub_resource_read(properties.profile) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + tags = _schema_nsp_association_read.tags + tags.Element = AAZStrType() + + _schema.id = _schema_nsp_association_read.id + _schema.location = _schema_nsp_association_read.location + _schema.name = _schema_nsp_association_read.name + _schema.properties = _schema_nsp_association_read.properties + _schema.tags = _schema_nsp_association_read.tags + _schema.type = _schema_nsp_association_read.type + + +_schema_sub_resource_read = None + + +def _build_schema_sub_resource_read(_schema): + global _schema_sub_resource_read + if _schema_sub_resource_read is not None: + _schema.id = _schema_sub_resource_read.id + return + + _schema_sub_resource_read = AAZObjectType() + + sub_resource_read = _schema_sub_resource_read + sub_resource_read.id = AAZStrType() + + _schema.id = _schema_sub_resource_read.id + + +__all__ = ["Update"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_wait.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_wait.py new file mode 100644 index 00000000000..d613ec12b7b --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_wait.py @@ -0,0 +1,205 @@ +# -------------------------------------------------------------------------------------------- +# 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 perimeter association 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/networksecurityperimeters/{}/resourceassociations/{}", "2021-02-01-preview"], + ] + } + + 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.association_name = AAZStrArg( + options=["-n", "--name", "--association-name"], + help="The name of the NSP association.", + required=True, + id_part="child_name_1", + ) + _args_schema.perimeter_name = AAZStrArg( + options=["--perimeter-name"], + help="The name of the network security perimeter.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.NspAssociationsGet(ctx=self.ctx)() + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class NspAssociationsGet(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/networkSecurityPerimeters/{networkSecurityPerimeterName}/resourceAssociations/{associationName}", + **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( + "associationName", self.ctx.args.association_name, + required=True, + ), + **self.serialize_url_param( + "networkSecurityPerimeterName", self.ctx.args.perimeter_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-02-01-preview", + 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.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType() + _schema_on_200.name = AAZStrType() + _schema_on_200.properties = AAZObjectType() + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.access_mode = AAZStrType( + serialized_name="accessMode", + ) + properties.has_provisioning_issues = AAZStrType( + serialized_name="hasProvisioningIssues", + flags={"read_only": True}, + ) + properties.private_link_resource = AAZObjectType( + serialized_name="privateLinkResource", + ) + _build_schema_sub_resource_read(properties.private_link_resource) + properties.profile = AAZObjectType() + _build_schema_sub_resource_read(properties.profile) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +_schema_sub_resource_read = None + + +def _build_schema_sub_resource_read(_schema): + global _schema_sub_resource_read + if _schema_sub_resource_read is not None: + _schema.id = _schema_sub_resource_read.id + return + + _schema_sub_resource_read = AAZObjectType() + + sub_resource_read = _schema_sub_resource_read + sub_resource_read.id = AAZStrType() + + _schema.id = _schema_sub_resource_read.id + + +__all__ = ["Wait"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/onboarded_resources/__cmd_group.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/onboarded_resources/__cmd_group.py new file mode 100644 index 00000000000..f0bac8a9c10 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/onboarded_resources/__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 perimeter onboarded-resources", +) +class __CMDGroup(AAZCommandGroup): + """Manage resources onboarded to NSP + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/onboarded_resources/__init__.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/onboarded_resources/__init__.py new file mode 100644 index 00000000000..d63ae5a6fc9 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/onboarded_resources/__init__.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# 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 ._list import * diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/onboarded_resources/_list.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/onboarded_resources/_list.py new file mode 100644 index 00000000000..5ca4224099a --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/onboarded_resources/_list.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 perimeter onboarded-resources list", +) +class List(AAZCommand): + """Gets the list of resources that are onboarded with NSP. These resources can be associated with a network security perimeter. + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/locations/{}/perimeterassociableresourcetypes", "2021-02-01-preview"], + ] + } + + 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.location = AAZResourceLocationArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.PerimeterAssociableResourceTypesList(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 PerimeterAssociableResourceTypesList(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/locations/{location}/perimeterAssociableResourceTypes", + **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( + "location", self.ctx.args.location, + 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-02-01-preview", + 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", + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType() + _element.name = AAZStrType() + _element.properties = AAZObjectType() + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.display_name = AAZStrType( + serialized_name="displayName", + flags={"read_only": True}, + ) + properties.public_dns_zones = AAZListType( + serialized_name="publicDnsZones", + flags={"read_only": True}, + ) + properties.resource_type = AAZStrType( + serialized_name="resourceType", + flags={"read_only": True}, + ) + + public_dns_zones = cls._schema_on_200.value.Element.properties.public_dns_zones + public_dns_zones.Element = AAZStrType( + 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/nsp/azext_nsp/aaz/latest/network/perimeter/profile/__cmd_group.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/__cmd_group.py new file mode 100644 index 00000000000..00ed54a28fd --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/__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 perimeter profile", +) +class __CMDGroup(AAZCommandGroup): + """Manage Network Profiles under an NSP + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/__init__.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/__init__.py new file mode 100644 index 00000000000..efc3964e3fb --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/__init__.py @@ -0,0 +1,15 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._list import * +from ._show import * diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_create.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_create.py new file mode 100644 index 00000000000..fe8c6bf0fe5 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_create.py @@ -0,0 +1,215 @@ +# -------------------------------------------------------------------------------------------- +# 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 perimeter profile create", +) +class Create(AAZCommand): + """Creates or updates a network profile. + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/profiles/{}", "2021-02-01-preview"], + ] + } + + 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.perimeter_name = AAZStrArg( + options=["--perimeter-name"], + help="The name of the network security perimeter.", + required=True, + id_part="name", + ) + _args_schema.profile_name = AAZStrArg( + options=["-n", "--name", "--profile-name"], + help="The name of the NSP profile.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="Resource location.", + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + return cls._args_schema + + def _execute_operations(self): + self.NspProfilesCreateOrUpdate(ctx=self.ctx)() + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NspProfilesCreateOrUpdate(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, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/profiles/{profileName}", + **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( + "networkSecurityPerimeterName", self.ctx.args.perimeter_name, + required=True, + ), + **self.serialize_url_param( + "profileName", self.ctx.args.profile_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-02-01-preview", + 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("name", AAZStrType, ".profile_name") + _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.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.location = AAZStrType() + _schema_on_200_201.name = AAZStrType() + _schema_on_200_201.properties = AAZObjectType() + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.access_rules_version = AAZStrType( + serialized_name="accessRulesVersion", + 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/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_delete.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_delete.py new file mode 100644 index 00000000000..a93cd631619 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_delete.py @@ -0,0 +1,132 @@ +# -------------------------------------------------------------------------------------------- +# 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 perimeter profile delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Deletes an NSP profile. + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/profiles/{}", "2021-02-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return 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.perimeter_name = AAZStrArg( + options=["--perimeter-name"], + help="The name of the network security perimeter.", + required=True, + id_part="name", + ) + _args_schema.profile_name = AAZStrArg( + options=["-n", "--name", "--profile-name"], + help="The name of the NSP profile.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.NspProfilesDelete(ctx=self.ctx)() + + class NspProfilesDelete(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) + if session.http_response.status_code in [204]: + return self.on_204(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/profiles/{profileName}", + **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( + "networkSecurityPerimeterName", self.ctx.args.perimeter_name, + required=True, + ), + **self.serialize_url_param( + "profileName", self.ctx.args.profile_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-02-01-preview", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +__all__ = ["Delete"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_list.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_list.py new file mode 100644 index 00000000000..f875a66b6d9 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_list.py @@ -0,0 +1,192 @@ +# -------------------------------------------------------------------------------------------- +# 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 perimeter profile list", +) +class List(AAZCommand): + """Lists the NSP profiles in the specified network security perimeter. + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/profiles", "2021-02-01-preview"], + ] + } + + 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.perimeter_name = AAZStrArg( + options=["--perimeter-name"], + help="The name of the network security perimeter.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.skip_token = AAZStrArg( + options=["--skip-token"], + help="SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls.", + ) + _args_schema.top = AAZIntArg( + options=["--top"], + help="An optional query parameter which specifies the maximum number of records to be returned by the server.", + fmt=AAZIntArgFormat( + maximum=20, + minimum=1, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.NspProfilesList(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 NspProfilesList(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/networkSecurityPerimeters/{networkSecurityPerimeterName}/profiles", + **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( + "networkSecurityPerimeterName", self.ctx.args.perimeter_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( + "$skipToken", self.ctx.args.skip_token, + ), + **self.serialize_query_param( + "$top", self.ctx.args.top, + ), + **self.serialize_query_param( + "api-version", "2021-02-01-preview", + 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", + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType() + _element.name = AAZStrType() + _element.properties = AAZObjectType() + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.access_rules_version = AAZStrType( + serialized_name="accessRulesVersion", + 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/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_show.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_show.py new file mode 100644 index 00000000000..508a20e71b6 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_show.py @@ -0,0 +1,176 @@ +# -------------------------------------------------------------------------------------------- +# 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 perimeter profile show", +) +class Show(AAZCommand): + """Gets the specified NSP profile. + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/profiles/{}", "2021-02-01-preview"], + ] + } + + 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.perimeter_name = AAZStrArg( + options=["--perimeter-name"], + help="The name of the network security perimeter.", + required=True, + id_part="name", + ) + _args_schema.profile_name = AAZStrArg( + options=["-n", "--name", "--profile-name"], + help="The name of the NSP profile.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.NspProfilesGet(ctx=self.ctx)() + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NspProfilesGet(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/networkSecurityPerimeters/{networkSecurityPerimeterName}/profiles/{profileName}", + **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( + "networkSecurityPerimeterName", self.ctx.args.perimeter_name, + required=True, + ), + **self.serialize_url_param( + "profileName", self.ctx.args.profile_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-02-01-preview", + 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.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType() + _schema_on_200.name = AAZStrType() + _schema_on_200.properties = AAZObjectType() + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.access_rules_version = AAZStrType( + serialized_name="accessRulesVersion", + flags={"read_only": True}, + ) + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +__all__ = ["Show"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/__cmd_group.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/__cmd_group.py new file mode 100644 index 00000000000..c3baa473d0e --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/__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 perimeter profile access-rule", +) +class __CMDGroup(AAZCommandGroup): + """Manage Access Rules of a Profile inside an NSP + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/__init__.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/__init__.py new file mode 100644 index 00000000000..c401f439385 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/__init__.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------------------------- +# 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 * diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_create.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_create.py new file mode 100644 index 00000000000..fe677b7e437 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_create.py @@ -0,0 +1,348 @@ +# -------------------------------------------------------------------------------------------- +# 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 perimeter profile access-rule create", +) +class Create(AAZCommand): + """Creates or updates a network access rule. + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/profiles/{}/accessrules/{}", "2021-02-01-preview"], + ] + } + + 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.access_rule_name = AAZStrArg( + options=["-n", "--name", "--access-rule-name"], + help="The name of the NSP access rule.", + required=True, + id_part="child_name_2", + ) + _args_schema.perimeter_name = AAZStrArg( + options=["--perimeter-name"], + help="The name of the network security perimeter.", + required=True, + id_part="name", + ) + _args_schema.profile_name = AAZStrArg( + options=["--profile-name"], + help="The name of the NSP profile.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="Resource location.", + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg() + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.address_prefixes = AAZListArg( + options=["--address-prefixes"], + arg_group="Properties", + help="Inbound address prefixes (IPv4/IPv6)", + ) + _args_schema.direction = AAZStrArg( + options=["--direction"], + arg_group="Properties", + help="Direction that specifies whether the access rules is inbound/outbound.", + enum={"Inbound": "Inbound", "Outbound": "Outbound"}, + ) + _args_schema.fqdn = AAZListArg( + options=["--fqdn"], + arg_group="Properties", + help="Outbound rules fully qualified domain name format.", + ) + _args_schema.nsp = AAZListArg( + options=["--nsp"], + arg_group="Properties", + help="Inbound rule specified by the perimeter id.", + ) + _args_schema.subscriptions = AAZListArg( + options=["--subscriptions"], + arg_group="Properties", + help="Subscription id in the ARM id format.", + ) + + address_prefixes = cls._args_schema.address_prefixes + address_prefixes.Element = AAZStrArg() + + fqdn = cls._args_schema.fqdn + fqdn.Element = AAZStrArg() + + nsp = cls._args_schema.nsp + nsp.Element = AAZObjectArg() + + _element = cls._args_schema.nsp.Element + _element.id = AAZStrArg( + options=["id"], + help="NSP id in the ARM id format.", + ) + + subscriptions = cls._args_schema.subscriptions + subscriptions.Element = AAZObjectArg() + + _element = cls._args_schema.subscriptions.Element + _element.id = AAZStrArg( + options=["id"], + help="Subscription ID in the ARM ID fromat.", + ) + return cls._args_schema + + def _execute_operations(self): + self.NspAccessRulesCreateOrUpdate(ctx=self.ctx)() + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NspAccessRulesCreateOrUpdate(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, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/profiles/{profileName}/accessRules/{accessRuleName}", + **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( + "accessRuleName", self.ctx.args.access_rule_name, + required=True, + ), + **self.serialize_url_param( + "networkSecurityPerimeterName", self.ctx.args.perimeter_name, + required=True, + ), + **self.serialize_url_param( + "profileName", self.ctx.args.profile_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-02-01-preview", + 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("name", AAZStrType, ".access_rule_name") + _builder.set_prop("properties", AAZObjectType) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("addressPrefixes", AAZListType, ".address_prefixes") + properties.set_prop("direction", AAZStrType, ".direction") + properties.set_prop("fullyQualifiedDomainNames", AAZListType, ".fqdn") + properties.set_prop("networkSecurityPerimeters", AAZListType, ".nsp") + properties.set_prop("subscriptions", AAZListType, ".subscriptions") + + address_prefixes = _builder.get(".properties.addressPrefixes") + if address_prefixes is not None: + address_prefixes.set_elements(AAZStrType, ".") + + fully_qualified_domain_names = _builder.get(".properties.fullyQualifiedDomainNames") + if fully_qualified_domain_names is not None: + fully_qualified_domain_names.set_elements(AAZStrType, ".") + + network_security_perimeters = _builder.get(".properties.networkSecurityPerimeters") + if network_security_perimeters is not None: + network_security_perimeters.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.networkSecurityPerimeters[]") + if _elements is not None: + _elements.set_prop("id", AAZStrType, ".id") + + subscriptions = _builder.get(".properties.subscriptions") + if subscriptions is not None: + subscriptions.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.subscriptions[]") + if _elements is not None: + _elements.set_prop("id", AAZStrType, ".id") + + 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.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.location = AAZStrType() + _schema_on_200_201.name = AAZStrType() + _schema_on_200_201.properties = AAZObjectType() + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.address_prefixes = AAZListType( + serialized_name="addressPrefixes", + ) + properties.direction = AAZStrType() + properties.fully_qualified_domain_names = AAZListType( + serialized_name="fullyQualifiedDomainNames", + ) + properties.network_security_perimeters = AAZListType( + serialized_name="networkSecurityPerimeters", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.subscriptions = AAZListType() + + address_prefixes = cls._schema_on_200_201.properties.address_prefixes + address_prefixes.Element = AAZStrType() + + fully_qualified_domain_names = cls._schema_on_200_201.properties.fully_qualified_domain_names + fully_qualified_domain_names.Element = AAZStrType() + + network_security_perimeters = cls._schema_on_200_201.properties.network_security_perimeters + network_security_perimeters.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.network_security_perimeters.Element + _element.id = AAZStrType() + _element.location = AAZStrType( + flags={"read_only": True}, + ) + _element.perimeter_guid = AAZStrType( + serialized_name="perimeterGuid", + flags={"read_only": True}, + ) + + subscriptions = cls._schema_on_200_201.properties.subscriptions + subscriptions.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.subscriptions.Element + _element.id = AAZStrType() + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() + + return cls._schema_on_200_201 + + +__all__ = ["Create"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_delete.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_delete.py new file mode 100644 index 00000000000..7aa27a964fb --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_delete.py @@ -0,0 +1,142 @@ +# -------------------------------------------------------------------------------------------- +# 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 perimeter profile access-rule delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Deletes an NSP access rule. + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/profiles/{}/accessrules/{}", "2021-02-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return 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.access_rule_name = AAZStrArg( + options=["-n", "--name", "--access-rule-name"], + help="The name of the NSP access rule.", + required=True, + id_part="child_name_2", + ) + _args_schema.perimeter_name = AAZStrArg( + options=["--perimeter-name"], + help="The name of the network security perimeter.", + required=True, + id_part="name", + ) + _args_schema.profile_name = AAZStrArg( + options=["--profile-name"], + help="The name of the NSP profile.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.NspAccessRulesDelete(ctx=self.ctx)() + + class NspAccessRulesDelete(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) + if session.http_response.status_code in [204]: + return self.on_204(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/profiles/{profileName}/accessRules/{accessRuleName}", + **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( + "accessRuleName", self.ctx.args.access_rule_name, + required=True, + ), + **self.serialize_url_param( + "networkSecurityPerimeterName", self.ctx.args.perimeter_name, + required=True, + ), + **self.serialize_url_param( + "profileName", self.ctx.args.profile_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-02-01-preview", + required=True, + ), + } + return parameters + + def on_200(self, session): + pass + + def on_204(self, session): + pass + + +__all__ = ["Delete"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_list.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_list.py new file mode 100644 index 00000000000..af151cbbbd9 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_list.py @@ -0,0 +1,237 @@ +# -------------------------------------------------------------------------------------------- +# 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 perimeter profile access-rule list", +) +class List(AAZCommand): + """Lists the NSP access rules in the specified NSP profile. + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/profiles/{}/accessrules", "2021-02-01-preview"], + ] + } + + 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.perimeter_name = AAZStrArg( + options=["--perimeter-name"], + help="The name of the network security perimeter.", + required=True, + ) + _args_schema.profile_name = AAZStrArg( + options=["--profile-name"], + help="The name of the NSP profile.", + required=True, + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.skip_token = AAZStrArg( + options=["--skip-token"], + help="SkipToken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls.", + ) + _args_schema.top = AAZIntArg( + options=["--top"], + help="An optional query parameter which specifies the maximum number of records to be returned by the server.", + fmt=AAZIntArgFormat( + maximum=20, + minimum=1, + ), + ) + return cls._args_schema + + def _execute_operations(self): + self.NspAccessRulesList(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 NspAccessRulesList(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/networkSecurityPerimeters/{networkSecurityPerimeterName}/profiles/{profileName}/accessRules", + **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( + "networkSecurityPerimeterName", self.ctx.args.perimeter_name, + required=True, + ), + **self.serialize_url_param( + "profileName", self.ctx.args.profile_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( + "$skipToken", self.ctx.args.skip_token, + ), + **self.serialize_query_param( + "$top", self.ctx.args.top, + ), + **self.serialize_query_param( + "api-version", "2021-02-01-preview", + 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", + ) + _schema_on_200.value = AAZListType() + + value = cls._schema_on_200.value + value.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.location = AAZStrType() + _element.name = AAZStrType() + _element.properties = AAZObjectType() + _element.tags = AAZDictType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.address_prefixes = AAZListType( + serialized_name="addressPrefixes", + ) + properties.direction = AAZStrType() + properties.fully_qualified_domain_names = AAZListType( + serialized_name="fullyQualifiedDomainNames", + ) + properties.network_security_perimeters = AAZListType( + serialized_name="networkSecurityPerimeters", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.subscriptions = AAZListType() + + address_prefixes = cls._schema_on_200.value.Element.properties.address_prefixes + address_prefixes.Element = AAZStrType() + + fully_qualified_domain_names = cls._schema_on_200.value.Element.properties.fully_qualified_domain_names + fully_qualified_domain_names.Element = AAZStrType() + + network_security_perimeters = cls._schema_on_200.value.Element.properties.network_security_perimeters + network_security_perimeters.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.network_security_perimeters.Element + _element.id = AAZStrType() + _element.location = AAZStrType( + flags={"read_only": True}, + ) + _element.perimeter_guid = AAZStrType( + serialized_name="perimeterGuid", + flags={"read_only": True}, + ) + + subscriptions = cls._schema_on_200.value.Element.properties.subscriptions + subscriptions.Element = AAZObjectType() + + _element = cls._schema_on_200.value.Element.properties.subscriptions.Element + _element.id = AAZStrType() + + tags = cls._schema_on_200.value.Element.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +__all__ = ["List"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_show.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_show.py new file mode 100644 index 00000000000..736412d9227 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_show.py @@ -0,0 +1,222 @@ +# -------------------------------------------------------------------------------------------- +# 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 perimeter profile access-rule show", +) +class Show(AAZCommand): + """Gets the specified NSP access rule by name. + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/profiles/{}/accessrules/{}", "2021-02-01-preview"], + ] + } + + 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.access_rule_name = AAZStrArg( + options=["-n", "--name", "--access-rule-name"], + help="The name of the NSP access rule.", + required=True, + id_part="child_name_2", + ) + _args_schema.perimeter_name = AAZStrArg( + options=["--perimeter-name"], + help="The name of the network security perimeter.", + required=True, + id_part="name", + ) + _args_schema.profile_name = AAZStrArg( + options=["--profile-name"], + help="The name of the NSP profile.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.NspAccessRulesGet(ctx=self.ctx)() + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NspAccessRulesGet(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/networkSecurityPerimeters/{networkSecurityPerimeterName}/profiles/{profileName}/accessRules/{accessRuleName}", + **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( + "accessRuleName", self.ctx.args.access_rule_name, + required=True, + ), + **self.serialize_url_param( + "networkSecurityPerimeterName", self.ctx.args.perimeter_name, + required=True, + ), + **self.serialize_url_param( + "profileName", self.ctx.args.profile_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-02-01-preview", + 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.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.location = AAZStrType() + _schema_on_200.name = AAZStrType() + _schema_on_200.properties = AAZObjectType() + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.address_prefixes = AAZListType( + serialized_name="addressPrefixes", + ) + properties.direction = AAZStrType() + properties.fully_qualified_domain_names = AAZListType( + serialized_name="fullyQualifiedDomainNames", + ) + properties.network_security_perimeters = AAZListType( + serialized_name="networkSecurityPerimeters", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.subscriptions = AAZListType() + + address_prefixes = cls._schema_on_200.properties.address_prefixes + address_prefixes.Element = AAZStrType() + + fully_qualified_domain_names = cls._schema_on_200.properties.fully_qualified_domain_names + fully_qualified_domain_names.Element = AAZStrType() + + network_security_perimeters = cls._schema_on_200.properties.network_security_perimeters + network_security_perimeters.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.network_security_perimeters.Element + _element.id = AAZStrType() + _element.location = AAZStrType( + flags={"read_only": True}, + ) + _element.perimeter_guid = AAZStrType( + serialized_name="perimeterGuid", + flags={"read_only": True}, + ) + + subscriptions = cls._schema_on_200.properties.subscriptions + subscriptions.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.subscriptions.Element + _element.id = AAZStrType() + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() + + return cls._schema_on_200 + + +__all__ = ["Show"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_update.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_update.py new file mode 100644 index 00000000000..8a7ac0af985 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_update.py @@ -0,0 +1,509 @@ +# -------------------------------------------------------------------------------------------- +# 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 perimeter profile access-rule update", +) +class Update(AAZCommand): + """Creates or updates a network access rule. + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/profiles/{}/accessrules/{}", "2021-02-01-preview"], + ] + } + + AZ_SUPPORT_GENERIC_UPDATE = True + + 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.access_rule_name = AAZStrArg( + options=["-n", "--name", "--access-rule-name"], + help="The name of the NSP access rule.", + required=True, + id_part="child_name_2", + ) + _args_schema.perimeter_name = AAZStrArg( + options=["--perimeter-name"], + help="The name of the network security perimeter.", + required=True, + id_part="name", + ) + _args_schema.profile_name = AAZStrArg( + options=["--profile-name"], + help="The name of the NSP profile.", + required=True, + id_part="child_name_1", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.location = AAZResourceLocationArg( + arg_group="Parameters", + help="Resource location.", + nullable=True, + fmt=AAZResourceLocationArgFormat( + resource_group_arg="resource_group", + ), + ) + _args_schema.tags = AAZDictArg( + options=["--tags"], + arg_group="Parameters", + help="Resource tags.", + nullable=True, + ) + + tags = cls._args_schema.tags + tags.Element = AAZStrArg( + nullable=True, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.address_prefixes = AAZListArg( + options=["--address-prefixes"], + arg_group="Properties", + help="Inbound address prefixes (IPv4/IPv6)", + nullable=True, + ) + _args_schema.direction = AAZStrArg( + options=["--direction"], + arg_group="Properties", + help="Direction that specifies whether the access rules is inbound/outbound.", + nullable=True, + enum={"Inbound": "Inbound", "Outbound": "Outbound"}, + ) + _args_schema.fqdn = AAZListArg( + options=["--fqdn"], + arg_group="Properties", + help="Outbound rules fully qualified domain name format.", + nullable=True, + ) + _args_schema.nsp = AAZListArg( + options=["--nsp"], + arg_group="Properties", + help="Inbound rule specified by the perimeter id.", + nullable=True, + ) + _args_schema.subscriptions = AAZListArg( + options=["--subscriptions"], + arg_group="Properties", + help="Subscription id in the ARM id format.", + nullable=True, + ) + + address_prefixes = cls._args_schema.address_prefixes + address_prefixes.Element = AAZStrArg( + nullable=True, + ) + + fqdn = cls._args_schema.fqdn + fqdn.Element = AAZStrArg( + nullable=True, + ) + + nsp = cls._args_schema.nsp + nsp.Element = AAZObjectArg( + nullable=True, + ) + + _element = cls._args_schema.nsp.Element + _element.id = AAZStrArg( + options=["id"], + help="NSP id in the ARM id format.", + nullable=True, + ) + + subscriptions = cls._args_schema.subscriptions + subscriptions.Element = AAZObjectArg( + nullable=True, + ) + + _element = cls._args_schema.subscriptions.Element + _element.id = AAZStrArg( + options=["id"], + help="Subscription ID in the ARM ID fromat.", + nullable=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.NspAccessRulesGet(ctx=self.ctx)() + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.NspAccessRulesCreateOrUpdate(ctx=self.ctx)() + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NspAccessRulesGet(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/networkSecurityPerimeters/{networkSecurityPerimeterName}/profiles/{profileName}/accessRules/{accessRuleName}", + **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( + "accessRuleName", self.ctx.args.access_rule_name, + required=True, + ), + **self.serialize_url_param( + "networkSecurityPerimeterName", self.ctx.args.perimeter_name, + required=True, + ), + **self.serialize_url_param( + "profileName", self.ctx.args.profile_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-02-01-preview", + 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_nsp_access_rule_read(cls._schema_on_200) + + return cls._schema_on_200 + + class NspAccessRulesCreateOrUpdate(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, 201]: + return self.on_200_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/profiles/{profileName}/accessRules/{accessRuleName}", + **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( + "accessRuleName", self.ctx.args.access_rule_name, + required=True, + ), + **self.serialize_url_param( + "networkSecurityPerimeterName", self.ctx.args.perimeter_name, + required=True, + ), + **self.serialize_url_param( + "profileName", self.ctx.args.profile_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-02-01-preview", + 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_nsp_access_rule_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("name", AAZStrType, ".access_rule_name") + _builder.set_prop("properties", AAZObjectType) + _builder.set_prop("tags", AAZDictType, ".tags") + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("addressPrefixes", AAZListType, ".address_prefixes") + properties.set_prop("direction", AAZStrType, ".direction") + properties.set_prop("fullyQualifiedDomainNames", AAZListType, ".fqdn") + properties.set_prop("networkSecurityPerimeters", AAZListType, ".nsp") + properties.set_prop("subscriptions", AAZListType, ".subscriptions") + + address_prefixes = _builder.get(".properties.addressPrefixes") + if address_prefixes is not None: + address_prefixes.set_elements(AAZStrType, ".") + + fully_qualified_domain_names = _builder.get(".properties.fullyQualifiedDomainNames") + if fully_qualified_domain_names is not None: + fully_qualified_domain_names.set_elements(AAZStrType, ".") + + network_security_perimeters = _builder.get(".properties.networkSecurityPerimeters") + if network_security_perimeters is not None: + network_security_perimeters.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.networkSecurityPerimeters[]") + if _elements is not None: + _elements.set_prop("id", AAZStrType, ".id") + + subscriptions = _builder.get(".properties.subscriptions") + if subscriptions is not None: + subscriptions.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".properties.subscriptions[]") + if _elements is not None: + _elements.set_prop("id", AAZStrType, ".id") + + 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_nsp_access_rule_read = None + + +def _build_schema_nsp_access_rule_read(_schema): + global _schema_nsp_access_rule_read + if _schema_nsp_access_rule_read is not None: + _schema.id = _schema_nsp_access_rule_read.id + _schema.location = _schema_nsp_access_rule_read.location + _schema.name = _schema_nsp_access_rule_read.name + _schema.properties = _schema_nsp_access_rule_read.properties + _schema.tags = _schema_nsp_access_rule_read.tags + _schema.type = _schema_nsp_access_rule_read.type + return + + _schema_nsp_access_rule_read = AAZObjectType() + + nsp_access_rule_read = _schema_nsp_access_rule_read + nsp_access_rule_read.id = AAZStrType( + flags={"read_only": True}, + ) + nsp_access_rule_read.location = AAZStrType() + nsp_access_rule_read.name = AAZStrType() + nsp_access_rule_read.properties = AAZObjectType() + nsp_access_rule_read.tags = AAZDictType() + nsp_access_rule_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_nsp_access_rule_read.properties + properties.address_prefixes = AAZListType( + serialized_name="addressPrefixes", + ) + properties.direction = AAZStrType() + properties.fully_qualified_domain_names = AAZListType( + serialized_name="fullyQualifiedDomainNames", + ) + properties.network_security_perimeters = AAZListType( + serialized_name="networkSecurityPerimeters", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.subscriptions = AAZListType() + + address_prefixes = _schema_nsp_access_rule_read.properties.address_prefixes + address_prefixes.Element = AAZStrType() + + fully_qualified_domain_names = _schema_nsp_access_rule_read.properties.fully_qualified_domain_names + fully_qualified_domain_names.Element = AAZStrType() + + network_security_perimeters = _schema_nsp_access_rule_read.properties.network_security_perimeters + network_security_perimeters.Element = AAZObjectType() + + _element = _schema_nsp_access_rule_read.properties.network_security_perimeters.Element + _element.id = AAZStrType() + _element.location = AAZStrType( + flags={"read_only": True}, + ) + _element.perimeter_guid = AAZStrType( + serialized_name="perimeterGuid", + flags={"read_only": True}, + ) + + subscriptions = _schema_nsp_access_rule_read.properties.subscriptions + subscriptions.Element = AAZObjectType() + + _element = _schema_nsp_access_rule_read.properties.subscriptions.Element + _element.id = AAZStrType() + + tags = _schema_nsp_access_rule_read.tags + tags.Element = AAZStrType() + + _schema.id = _schema_nsp_access_rule_read.id + _schema.location = _schema_nsp_access_rule_read.location + _schema.name = _schema_nsp_access_rule_read.name + _schema.properties = _schema_nsp_access_rule_read.properties + _schema.tags = _schema_nsp_access_rule_read.tags + _schema.type = _schema_nsp_access_rule_read.type + + +__all__ = ["Update"] diff --git a/src/nsp/azext_nsp/azext_metadata.json b/src/nsp/azext_nsp/azext_metadata.json new file mode 100644 index 00000000000..ade6d0c3e08 --- /dev/null +++ b/src/nsp/azext_nsp/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.38.0" +} \ No newline at end of file diff --git a/src/nsp/azext_nsp/commands.py b/src/nsp/azext_nsp/commands.py new file mode 100644 index 00000000000..b0d842e4993 --- /dev/null +++ b/src/nsp/azext_nsp/commands.py @@ -0,0 +1,15 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +# from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): # pylint: disable=unused-argument + pass diff --git a/src/nsp/azext_nsp/custom.py b/src/nsp/azext_nsp/custom.py new file mode 100644 index 00000000000..86df1e48ef5 --- /dev/null +++ b/src/nsp/azext_nsp/custom.py @@ -0,0 +1,14 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from knack.log import get_logger + + +logger = get_logger(__name__) diff --git a/src/nsp/azext_nsp/tests/__init__.py b/src/nsp/azext_nsp/tests/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/nsp/azext_nsp/tests/__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/nsp/azext_nsp/tests/latest/__init__.py b/src/nsp/azext_nsp/tests/latest/__init__.py new file mode 100644 index 00000000000..5757aea3175 --- /dev/null +++ b/src/nsp/azext_nsp/tests/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/nsp/azext_nsp/tests/latest/test_nsp.py b/src/nsp/azext_nsp/tests/latest/test_nsp.py new file mode 100644 index 00000000000..e78ad361324 --- /dev/null +++ b/src/nsp/azext_nsp/tests/latest/test_nsp.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +from azure.cli.testsdk import * + + +class NspScenario(ScenarioTest): + # TODO: add tests here + pass diff --git a/src/nsp/setup.cfg b/src/nsp/setup.cfg new file mode 100644 index 00000000000..2fdd96e5d39 --- /dev/null +++ b/src/nsp/setup.cfg @@ -0,0 +1 @@ +#setup.cfg \ No newline at end of file diff --git a/src/nsp/setup.py b/src/nsp/setup.py new file mode 100644 index 00000000000..ce54b526922 --- /dev/null +++ b/src/nsp/setup.py @@ -0,0 +1,49 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +from codecs import open +from setuptools import setup, find_packages + + +# HISTORY.rst entry. +VERSION = '0.1.0' + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'License :: OSI Approved :: MIT License', +] + +DEPENDENCIES = [] + +with open('README.md', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='nsp', + version=VERSION, + description='Microsoft Azure Command-Line Tools Nsp Extension.', + long_description=README + '\n\n' + HISTORY, + license='MIT', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/tree/main/src/nsp', + classifiers=CLASSIFIERS, + packages=find_packages(exclude=["tests"]), + package_data={'azext_nsp': ['azext_metadata.json']}, + install_requires=DEPENDENCIES +) From ffba599c7b0b40d36f9c1bb963f1a20a7ba02495 Mon Sep 17 00:00:00 2001 From: Nikhil Saxena Date: Mon, 17 Oct 2022 23:33:20 +0530 Subject: [PATCH 02/12] added tests for all commands --- .../test_create_storage_account.yaml | 44 + .../recordings/test_nsp_accessrule_crud.yaml | 567 ++++++++++ .../test_nsp_accessrule_inbound.yaml | 485 +++++++++ .../recordings/test_nsp_association_crud.yaml | 965 ++++++++++++++++++ .../latest/recordings/test_nsp_crud.yaml | 282 +++++ .../recordings/test_nsp_profile_crud.yaml | 284 ++++++ src/nsp/azext_nsp/tests/latest/test_nsp.py | 135 ++- 7 files changed, 2760 insertions(+), 2 deletions(-) create mode 100644 src/nsp/azext_nsp/tests/latest/recordings/test_create_storage_account.yaml create mode 100644 src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml create mode 100644 src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml create mode 100644 src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml create mode 100644 src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml create mode 100644 src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_create_storage_account.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_create_storage_account.yaml new file mode 100644 index 00000000000..80b1b5d260e --- /dev/null +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_create_storage_account.yaml @@ -0,0 +1,44 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - group show + Connection: + - keep-alive + ParameterSetName: + - -n + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2022-10-16T20:36:06Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '310' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 16 Oct 2022 20:36: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 +version: 1 diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml new file mode 100644 index 00000000000..7097df6285c --- /dev/null +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml @@ -0,0 +1,567 @@ +interactions: +- request: + body: '{"location": "eastus2euap", "name": "TestNetworkSecurityPerimeter"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter create + Connection: + - keep-alive + Content-Length: + - '67' + Content-Type: + - application/json + ParameterSetName: + - --name -l --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"27983ebb-9283-4d7f-a510-8dc9f778be91","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '427' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:00:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile create + Connection: + - keep-alive + ParameterSetName: + - --name --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_crud000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:00:48Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '343' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:00:59 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": "eastus2euap", "name": "TestNspProfile"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile create + Connection: + - keep-alive + Content-Length: + - '53' + Content-Type: + - application/json + ParameterSetName: + - --name --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspProfile","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile","type":"Microsoft.Network/networkSecurityPerimeters/profiles","properties":{"accessRulesVersion":"0","diagnosticSettingsVersion":"0"},"location":"eastus2euap"}' + headers: + cache-control: + - no-cache + content-length: + - '396' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:01 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile access-rule create + Connection: + - keep-alive + ParameterSetName: + - --name --profile-name --perimeter-name --resource-group --fqdn --direction + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_crud000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:00:48Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '343' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:02 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": "eastus2euap", "name": "TestNspAccessRule", "properties": + {"direction": "Outbound", "fullyQualifiedDomainNames": ["www.abc.com", "www.google.com"]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile access-rule create + Connection: + - keep-alive + Content-Length: + - '161' + Content-Type: + - application/json + ParameterSetName: + - --name --profile-name --perimeter-name --resource-group --fqdn --direction + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspAccessRule","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule","type":"Microsoft.Network/networkSecurityPerimeters/profiles/accessRules","properties":{"provisioningState":"Succeeded","direction":"Outbound","addressPrefixes":[],"fullyQualifiedDomainNames":["www.abc.com","www.google.com"],"subscriptions":[],"networkSecurityPerimeters":[]}}' + headers: + cache-control: + - no-cache + content-length: + - '546' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:05 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile access-rule show + Connection: + - keep-alive + ParameterSetName: + - --name --profile-name --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspAccessRule","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule","type":"Microsoft.Network/networkSecurityPerimeters/profiles/accessRules","properties":{"provisioningState":"Succeeded","direction":"Outbound","addressPrefixes":[],"fullyQualifiedDomainNames":["www.abc.com","www.google.com"],"subscriptions":[],"networkSecurityPerimeters":[]}}' + headers: + cache-control: + - no-cache + content-length: + - '546' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:07 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + 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 perimeter profile access-rule update + Connection: + - keep-alive + ParameterSetName: + - --name --profile-name --perimeter-name --resource-group --fqdn --direction + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_crud000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:00:48Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '343' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:07 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 perimeter profile access-rule update + Connection: + - keep-alive + ParameterSetName: + - --name --profile-name --perimeter-name --resource-group --fqdn --direction + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspAccessRule","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule","type":"Microsoft.Network/networkSecurityPerimeters/profiles/accessRules","properties":{"provisioningState":"Succeeded","direction":"Outbound","addressPrefixes":[],"fullyQualifiedDomainNames":["www.abc.com","www.google.com"],"subscriptions":[],"networkSecurityPerimeters":[]}}' + headers: + cache-control: + - no-cache + content-length: + - '546' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:09 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2euap", "name": "TestNspAccessRule", "properties": + {"addressPrefixes": [], "direction": "Outbound", "fullyQualifiedDomainNames": + ["www.abc.com"], "networkSecurityPerimeters": [], "subscriptions": []}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile access-rule update + Connection: + - keep-alive + Content-Length: + - '220' + Content-Type: + - application/json + ParameterSetName: + - --name --profile-name --perimeter-name --resource-group --fqdn --direction + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspAccessRule","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule","type":"Microsoft.Network/networkSecurityPerimeters/profiles/accessRules","properties":{"provisioningState":"Succeeded","direction":"Outbound","addressPrefixes":[],"fullyQualifiedDomainNames":["www.abc.com"],"subscriptions":[],"networkSecurityPerimeters":[]}}' + headers: + cache-control: + - no-cache + content-length: + - '529' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:13 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile access-rule show + Connection: + - keep-alive + ParameterSetName: + - --name --profile-name --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspAccessRule","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule","type":"Microsoft.Network/networkSecurityPerimeters/profiles/accessRules","properties":{"provisioningState":"Succeeded","direction":"Outbound","addressPrefixes":[],"fullyQualifiedDomainNames":["www.abc.com"],"subscriptions":[],"networkSecurityPerimeters":[]}}' + headers: + cache-control: + - no-cache + content-length: + - '529' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:15 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + 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 perimeter profile access-rule list + Connection: + - keep-alive + ParameterSetName: + - --perimeter-name --profile-name --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules?api-version=2021-02-01-preview + response: + body: + string: '{"nextLink":"","value":[{"name":"TestNspAccessRule","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule","type":"Microsoft.Network/networkSecurityPerimeters/profiles/accessRules","properties":{"provisioningState":"Succeeded","direction":"Outbound","addressPrefixes":[],"fullyQualifiedDomainNames":["www.abc.com"],"subscriptions":[],"networkSecurityPerimeters":[]}}]}' + headers: + cache-control: + - no-cache + content-length: + - '555' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:17 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile access-rule delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --name --perimeter-name --profile-name --resource-group --yes + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule?api-version=2021-02-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 17 Oct 2022 18:01:20 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml new file mode 100644 index 00000000000..301fe2db32b --- /dev/null +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml @@ -0,0 +1,485 @@ +interactions: +- request: + body: '{"location": "eastus2euap", "name": "TestNetworkSecurityPerimeter"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter create + Connection: + - keep-alive + Content-Length: + - '67' + Content-Type: + - application/json + ParameterSetName: + - --name -l --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"68bbb51d-615a-497f-8a27-daa6a05735b9","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '430' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:03 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile create + Connection: + - keep-alive + ParameterSetName: + - --name --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:00:48Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '349' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:03 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": "eastus2euap", "name": "TestNspProfile"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile create + Connection: + - keep-alive + Content-Length: + - '53' + Content-Type: + - application/json + ParameterSetName: + - --name --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspProfile","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile","type":"Microsoft.Network/networkSecurityPerimeters/profiles","properties":{"accessRulesVersion":"0","diagnosticSettingsVersion":"0"},"location":"eastus2euap"}' + headers: + cache-control: + - no-cache + content-length: + - '399' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:08 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile access-rule create + Connection: + - keep-alive + ParameterSetName: + - --name --profile-name --perimeter-name --resource-group --address-prefixes + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:00:48Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '349' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:08 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": "eastus2euap", "name": "TestNspAccessRule_ip", "properties": + {"addressPrefixes": ["10.10.0.0/16"]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile access-rule create + Connection: + - keep-alive + Content-Length: + - '112' + Content-Type: + - application/json + ParameterSetName: + - --name --profile-name --perimeter-name --resource-group --address-prefixes + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_ip?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspAccessRule_ip","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_ip","type":"Microsoft.Network/networkSecurityPerimeters/profiles/accessRules","properties":{"provisioningState":"Succeeded","direction":"Inbound","addressPrefixes":["10.10.0.0/16"],"fullyQualifiedDomainNames":[],"subscriptions":[],"networkSecurityPerimeters":[]}}' + headers: + cache-control: + - no-cache + content-length: + - '538' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:10 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile access-rule create + Connection: + - keep-alive + ParameterSetName: + - --name --profile-name --perimeter-name --resource-group --subscriptions + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:00:48Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '349' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01: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: '{"location": "eastus2euap", "name": "TestNspAccessRule_subscription", "properties": + {"subscriptions": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000"}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile access-rule create + Connection: + - keep-alive + Content-Length: + - '167' + Content-Type: + - application/json + ParameterSetName: + - --name --profile-name --perimeter-name --resource-group --subscriptions + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_subscription?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspAccessRule_subscription","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_subscription","type":"Microsoft.Network/networkSecurityPerimeters/profiles/accessRules","properties":{"provisioningState":"Succeeded","direction":"Inbound","addressPrefixes":[],"fullyQualifiedDomainNames":[],"subscriptions":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000"}],"networkSecurityPerimeters":[]}}' + headers: + cache-control: + - no-cache + content-length: + - '604' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:12 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2euap", "name": "nsp_for_rule"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter create + Connection: + - keep-alive + Content-Length: + - '51' + Content-Type: + - application/json + ParameterSetName: + - --name -l --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule?api-version=2021-02-01-preview + response: + body: + string: '{"name":"nsp_for_rule","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"3a60f81e-183a-4a7c-9264-2b3b6a780cb1","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '398' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:24 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile access-rule create + Connection: + - keep-alive + ParameterSetName: + - --name --profile-name --perimeter-name --resource-group --nsp + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:00:48Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '349' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:24 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": "eastus2euap", "name": "TestNspAccessRule_nsp", "properties": + {"networkSecurityPerimeters": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule"}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile access-rule create + Connection: + - keep-alive + Content-Length: + - '286' + Content-Type: + - application/json + ParameterSetName: + - --name --profile-name --perimeter-name --resource-group --nsp + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_nsp?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspAccessRule_nsp","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_nsp","type":"Microsoft.Network/networkSecurityPerimeters/profiles/accessRules","properties":{"provisioningState":"Succeeded","direction":"Inbound","addressPrefixes":[],"fullyQualifiedDomainNames":[],"subscriptions":[],"networkSecurityPerimeters":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","perimeterGuid":"3a60f81e-183a-4a7c-9264-2b3b6a780cb1","location":"eastus2euap"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '782' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:25 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +version: 1 diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml new file mode 100644 index 00000000000..82b361936e9 --- /dev/null +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml @@ -0,0 +1,965 @@ +interactions: +- request: + body: '{"location": "eastus2euap", "name": "TestNetworkSecurityPerimeter"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter create + Connection: + - keep-alive + Content-Length: + - '67' + Content-Type: + - application/json + ParameterSetName: + - --name -l --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"93c5d42e-4958-49f9-b50c-d1b4904a4e18","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '428' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:02 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile create + Connection: + - keep-alive + ParameterSetName: + - --name --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:00:48Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '345' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:02 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": "eastus2euap", "name": "TestNspProfile"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile create + Connection: + - keep-alive + Content-Length: + - '53' + Content-Type: + - application/json + ParameterSetName: + - --name --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspProfile","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile","type":"Microsoft.Network/networkSecurityPerimeters/profiles","properties":{"accessRulesVersion":"0","diagnosticSettingsVersion":"0"},"location":"eastus2euap"}' + headers: + cache-control: + - no-cache + content-length: + - '397' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:04 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - keyvault create + Connection: + - keep-alive + ParameterSetName: + - --name -l --resource-group + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2021-06-01-preview + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.KeyVault/vaults/kvnspclitest5'' + under resource group ''test_nsp_association_crud000001'' was not found. For + more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '242' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:05 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - keyvault create + Connection: + - keep-alive + ParameterSetName: + - --name -l --resource-group + User-Agent: + - python/3.10.5 (Windows-10-10.0.22621-SP0) AZURECLI/2.38.0 + method: GET + uri: https://graph.microsoft.com/v1.0/me + response: + body: + string: '{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users/$entity","businessPhones":[],"displayName":"Nikhil + Saxena","givenName":"Nikhil","jobTitle":"SOFTWARE ENGINEER","mail":"nikhilsaxena@microsoft.com","mobilePhone":null,"officeLocation":"BENGALURU + LUXOR-MIRPL/Mobile","preferredLanguage":null,"surname":"Saxena","userPrincipalName":"nikhilsaxena@microsoft.com","id":"d50cfdce-f74f-4b75-9ea4-dd65c07770fd"}' + headers: + cache-control: + - no-cache + content-length: + - '419' + content-type: + - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:05 GMT + odata-version: + - '4.0' + request-id: + - 9dbff22d-6e49-424e-8f15-35736b9d7d79 + strict-transport-security: + - max-age=31536000 + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-ms-ags-diagnostic: + - '{"ServerInfo":{"DataCenter":"South India","Slice":"E","Ring":"2","ScaleUnit":"000","RoleInstance":"MA1PEPF00002721"}}' + x-ms-resource-unit: + - '1' + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2euap", "properties": {"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "sku": {"family": "A", "name": "standard"}, "accessPolicies": [{"tenantId": + "72f988bf-86f1-41af-91ab-2d7cd011db47", "objectId": "d50cfdce-f74f-4b75-9ea4-dd65c07770fd", + "permissions": {"keys": ["all"], "secrets": ["all"], "certificates": ["all"], + "storage": ["all"]}}], "softDeleteRetentionInDays": 90, "networkAcls": {"bypass": + "AzureServices", "defaultAction": "Allow"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - keyvault create + Connection: + - keep-alive + Content-Length: + - '467' + Content-Type: + - application/json + ParameterSetName: + - --name -l --resource-group + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2021-06-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.KeyVault/vaults","location":"eastus2euap","tags":{},"systemData":{"createdBy":"nikhilsaxena@microsoft.com","createdByType":"User","createdAt":"2022-10-17T18:01:11.692Z","lastModifiedBy":"nikhilsaxena@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-10-17T18:01:11.692Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"d50cfdce-f74f-4b75-9ea4-dd65c07770fd","permissions":{"keys":["all"],"secrets":["all"],"certificates":["all"],"storage":["all"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"softDeleteRetentionInDays":90,"vaultUri":"https://kvnspclitest5.vault.azure.net","provisioningState":"RegisteringDns","publicNetworkAccess":"Enabled"}}' + headers: + cache-control: + - no-cache + content-length: + - '1005' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:14 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-keyvault-service-version: + - 1.5.534.0 + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - keyvault create + Connection: + - keep-alive + ParameterSetName: + - --name -l --resource-group + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2021-06-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.KeyVault/vaults","location":"eastus2euap","tags":{},"systemData":{"createdBy":"nikhilsaxena@microsoft.com","createdByType":"User","createdAt":"2022-10-17T18:01:11.692Z","lastModifiedBy":"nikhilsaxena@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-10-17T18:01:11.692Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"d50cfdce-f74f-4b75-9ea4-dd65c07770fd","permissions":{"keys":["all"],"secrets":["all"],"certificates":["all"],"storage":["all"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"softDeleteRetentionInDays":90,"vaultUri":"https://kvnspclitest5.vault.azure.net/","provisioningState":"Succeeded","publicNetworkAccess":"Enabled"}}' + headers: + cache-control: + - no-cache + content-length: + - '1001' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:46 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-keyvault-service-version: + - 1.5.534.0 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter association create + Connection: + - keep-alive + ParameterSetName: + - --name --perimeter-name --resource-group --access-mode --private-link-resource + --profile + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:00:48Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '345' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:46 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": "eastus2euap", "name": "TestNspAssociation", "properties": + {"accessMode": "Learning", "privateLinkResource": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"}, + "profile": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter association create + Connection: + - keep-alive + Content-Length: + - '510' + Content-Type: + - application/json + ParameterSetName: + - --name --perimeter-name --resource-group --access-mode --private-link-resource + --profile + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Learning","provisioningState":"Accepted","hasProvisioningIssues":"no"}}' + headers: + cache-control: + - no-cache + content-length: + - '836' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:54 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter association show + Connection: + - keep-alive + ParameterSetName: + - --name --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Learning","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' + headers: + cache-control: + - no-cache + content-length: + - '837' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:56 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + 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 perimeter association update + Connection: + - keep-alive + ParameterSetName: + - --name --perimeter-name --resource-group --access-mode --private-link-resource + --profile + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:00:48Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '345' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:56 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 perimeter association update + Connection: + - keep-alive + ParameterSetName: + - --name --perimeter-name --resource-group --access-mode --private-link-resource + --profile + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Learning","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' + headers: + cache-control: + - no-cache + content-length: + - '837' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2euap", "name": "TestNspAssociation", "properties": + {"accessMode": "Enforced", "privateLinkResource": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"}, + "profile": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter association update + Connection: + - keep-alive + Content-Length: + - '510' + Content-Type: + - application/json + ParameterSetName: + - --name --perimeter-name --resource-group --access-mode --private-link-resource + --profile + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Enforced","provisioningState":"Accepted","hasProvisioningIssues":"no"}}' + headers: + cache-control: + - no-cache + content-length: + - '836' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter association show + Connection: + - keep-alive + ParameterSetName: + - --name --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Enforced","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' + headers: + cache-control: + - no-cache + content-length: + - '837' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:02:01 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + 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 perimeter association list + Connection: + - keep-alive + ParameterSetName: + - --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations?api-version=2021-02-01-preview + response: + body: + string: '{"nextLink":"","value":[{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Enforced","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '863' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:02:04 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter association delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --name --perimeter-name --resource-group --yes + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + date: + - Mon, 17 Oct 2022 18:02:06 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter association show + Connection: + - keep-alive + ParameterSetName: + - --name --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview + response: + body: + string: '{"error":{"message":"Resource [/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation] + does not exist or has been deleted","code":"NotFound"}}' + headers: + cache-control: + - no-cache + content-length: + - '309' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:02:08 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - keyvault delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --name --resource-group --no-wait + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2021-06-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 17 Oct 2022 18:02:20 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-keyvault-service-version: + - 1.5.534.0 + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - keyvault purge + Connection: + - keep-alive + ParameterSetName: + - --name -l --no-wait + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/deletedVaults/kvnspclitest5?api-version=2021-06-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/deletedVaults/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.KeyVault/deletedVaults","properties":{"vaultId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5","location":"eastus2euap","tags":{},"deletionDate":"2022-10-17T18:02:11Z","scheduledPurgeDate":"2023-01-15T18:02:11Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '497' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:02:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-keyvault-service-version: + - 1.5.534.0 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - keyvault purge + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --name -l --no-wait + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/deletedVaults/kvnspclitest5/purge?api-version=2021-06-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 17 Oct 2022 18:02:23 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/operationResults/VVR8MDYzODAxNjI2NTQ0MzE5MjgwNnxDNjBCMTc1NkFFRDQ0MDdEQjAyNUMwQkIxOEQ5OUIzNQ?api-version=2021-06-01-preview + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-keyvault-service-version: + - 1.5.534.0 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +version: 1 diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml new file mode 100644 index 00000000000..7ad41d4a864 --- /dev/null +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml @@ -0,0 +1,282 @@ +interactions: +- request: + body: '{"location": "eastus2euap", "name": "TestNetworkSecurityPerimeter"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter create + Connection: + - keep-alive + Content-Length: + - '67' + Content-Type: + - application/json + ParameterSetName: + - --name -l --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"8fe0221d-e556-4883-bef6-808ce00e1378","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '416' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:00:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter show + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"8fe0221d-e556-4883-bef6-808ce00e1378","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '416' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:00 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + 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 perimeter list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters?api-version=2021-02-01-preview + response: + body: + string: '{"nextLink":"","value":[{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"8fe0221d-e556-4883-bef6-808ce00e1378","provisioningState":"Succeeded"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '442' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:02 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --name --yes + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 17 Oct 2022 18:01:10 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter onboarded-resources list + Connection: + - keep-alive + ParameterSetName: + - -l + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/perimeterAssociableResourceTypes?api-version=2021-02-01-preview + response: + body: + string: '{"type":"","nextLink":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/perimeterAssociableResourceTypes?api-version=2021-02-01-preview&firstIndex=10&pageSize=10","value":[{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.Sql.servers","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.Sql.servers","properties":{"providerNamespace":"Microsoft.Sql","resourceType":"servers","displayName":"Microsoft.Sql/servers","apiVersion":"2021-02-01-preview","publicDnsZones":["database.windows.net"]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.Storage.storageAccounts","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.Storage.storageAccounts","properties":{"providerNamespace":"Microsoft.Storage","resourceType":"storageAccounts","displayName":"Microsoft.Storage/storageAccounts","apiVersion":"2021-09-01","publicDnsZones":["blob.core.windows.net","table.core.windows.net","queue.core.windows.net","file.core.windows.net","web.core.windows.net","dfs.core.windows.net"]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.EventHub.namespaces","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.EventHub.namespaces","properties":{"providerNamespace":"Microsoft.EventHub","resourceType":"namespaces","displayName":"Microsoft.EventHub/namespaces","apiVersion":"2022-01-01-preview","publicDnsZones":["servicebus.windows.net"]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.CognitiveServices.accounts","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.CognitiveServices.accounts","properties":{"providerNamespace":"Microsoft.CognitiveServices","resourceType":"accounts","displayName":"Microsoft.CognitiveServices/accounts","apiVersion":"2021-10-01","publicDnsZones":["cognitiveservices.azure.com"]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.Search.searchServices","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.Search.searchServices","properties":{"providerNamespace":"Microsoft.Search","resourceType":"searchServices","displayName":"Microsoft.Search/searchServices","apiVersion":"2021-06-06-Preview","publicDnsZones":["search.windows.net"]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.Purview.accounts","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.Purview.accounts","properties":{"providerNamespace":"Microsoft.Purview","resourceType":"accounts","displayName":"Microsoft.Purview/accounts","apiVersion":"2022-02-01-preview","publicDnsZones":["purview.azure.com"]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.ContainerService.managedClusters","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.ContainerService.managedClusters","properties":{"providerNamespace":"Microsoft.ContainerService","resourceType":"managedClusters","displayName":"Microsoft.ContainerService/managedClusters","apiVersion":"2022-03-01","publicDnsZones":["azmk8s.io"]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.KeyVault.vaults","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.KeyVault.vaults","properties":{"providerNamespace":"Microsoft.KeyVault","resourceType":"vaults","displayName":"Microsoft.KeyVault/vaults","apiVersion":"2022-02-01-preview","publicDnsZones":["vault.azure.net","vaultcore.azure.net"]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.OperationalInsights.workspaces","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.OperationalInsights.workspaces","properties":{"providerNamespace":"Microsoft.OperationalInsights","resourceType":"workspaces","displayName":"Microsoft.OperationalInsights/workspaces","apiVersion":"2021-10-01","publicDnsZones":["monitor.azure.com","oms.opinsights.azure.com","ods.opinsights.azure.com","agentsvc.azure-automation.net","blob.core.windows.net"]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.Insights.dataCollectionEndpoints","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.Insights.dataCollectionEndpoints","properties":{"providerNamespace":"Microsoft.Insights","resourceType":"dataCollectionEndpoints","displayName":"Microsoft.Insights/dataCollectionEndpoints","apiVersion":"2021-10-01","publicDnsZones":["monitor.azure.com"]}}]}' + headers: + cache-control: + - no-cache + content-length: + - '4959' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:11 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + 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 perimeter onboarded-resources list + Connection: + - keep-alive + ParameterSetName: + - -l + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/perimeterAssociableResourceTypes?api-version=2021-02-01-preview&firstIndex=10&pageSize=10 + response: + body: + string: '{"type":"","nextLink":"","value":[{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.ServiceBus.namespaces","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.ServiceBus.namespaces","properties":{"providerNamespace":"Microsoft.ServiceBus","resourceType":"namespaces","displayName":"Microsoft.ServiceBus/namespaces","apiVersion":"2022-01-01-preview","publicDnsZones":["servicebus.windows.net"]}}]}' + headers: + cache-control: + - no-cache + content-length: + - '482' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:12 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml new file mode 100644 index 00000000000..402f31f2bcf --- /dev/null +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml @@ -0,0 +1,284 @@ +interactions: +- request: + body: '{"location": "eastus2euap", "name": "TestNetworkSecurityPerimeter"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter create + Connection: + - keep-alive + Content-Length: + - '67' + Content-Type: + - application/json + ParameterSetName: + - --name -l --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"610676ee-39b0-4eaa-9583-e2e9b9f75a2a","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '424' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:38 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile create + Connection: + - keep-alive + ParameterSetName: + - --name --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_profile_crud000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001","name":"test_nsp_profile_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:01:28Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '337' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:38 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": "eastus2euap", "name": "TestNspProfile"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile create + Connection: + - keep-alive + Content-Length: + - '53' + Content-Type: + - application/json + ParameterSetName: + - --name --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspProfile","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile","type":"Microsoft.Network/networkSecurityPerimeters/profiles","properties":{"accessRulesVersion":"0","diagnosticSettingsVersion":"0"},"location":"eastus2euap"}' + headers: + cache-control: + - no-cache + content-length: + - '393' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:38 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile show + Connection: + - keep-alive + ParameterSetName: + - --name --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspProfile","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile","type":"Microsoft.Network/networkSecurityPerimeters/profiles","properties":{"accessRulesVersion":"0","diagnosticSettingsVersion":"0"},"location":"eastus2euap"}' + headers: + cache-control: + - no-cache + content-length: + - '393' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:42 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + 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 perimeter profile list + Connection: + - keep-alive + ParameterSetName: + - --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles?api-version=2021-02-01-preview + response: + body: + string: '{"nextLink":"","value":[{"name":"TestNspProfile","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile","type":"Microsoft.Network/networkSecurityPerimeters/profiles","properties":{"accessRulesVersion":"0","diagnosticSettingsVersion":"0"},"location":"eastus2euap"}]}' + headers: + cache-control: + - no-cache + content-length: + - '419' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 17 Oct 2022 18:01:42 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --name --perimeter-name --resource-group --yes + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile?api-version=2021-02-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 17 Oct 2022 18:01:44 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/src/nsp/azext_nsp/tests/latest/test_nsp.py b/src/nsp/azext_nsp/tests/latest/test_nsp.py index e78ad361324..6bf82a0df65 100644 --- a/src/nsp/azext_nsp/tests/latest/test_nsp.py +++ b/src/nsp/azext_nsp/tests/latest/test_nsp.py @@ -9,5 +9,136 @@ class NspScenario(ScenarioTest): - # TODO: add tests here - pass + + @ResourceGroupPreparer(name_prefix='test_nsp_crud', location='eastus2euap') + def test_nsp_crud(self, resource_group): + self.kwargs.update({ + 'name': 'TestNetworkSecurityPerimeter' + }) + + self.cmd('network perimeter create --name {name} -l eastus2euap --resource-group {rg}') + + self.cmd('network perimeter show --resource-group {rg} --name {name}', checks=[ + self.check('name', '{name}') + ]) + + self.cmd('network perimeter list --resource-group {rg}') + + self.cmd('network perimeter delete -g {rg} --name {name} --yes') + + self.cmd('network perimeter onboarded-resources list -l eastus2euap') + + @ResourceGroupPreparer(name_prefix='test_nsp_profile_crud', location='eastus2euap') + def test_nsp_profile_crud(self, resource_group): + self.kwargs.update({ + 'nsp_name': 'TestNetworkSecurityPerimeter', + 'profile_name': 'TestNspProfile' + }) + + self.cmd('network perimeter create --name {nsp_name} -l eastus2euap --resource-group {rg}') + self.cmd('network perimeter profile create --name {profile_name} --perimeter-name {nsp_name} --resource-group {rg}') + + self.cmd('network perimeter profile show --name {profile_name} --perimeter-name {nsp_name} --resource-group {rg}', checks=[ + self.check('name', '{profile_name}') + ]) + + self.cmd('network perimeter profile list --perimeter-name {nsp_name} --resource-group {rg}') + + self.cmd('network perimeter profile delete --name {profile_name} --perimeter-name {nsp_name} --resource-group {rg} --yes') + + @ResourceGroupPreparer(name_prefix='test_nsp_accessrule_crud', location='eastus2euap') + def test_nsp_accessrule_crud(self, resource_group): + self.kwargs.update({ + 'nsp_name': 'TestNetworkSecurityPerimeter', + 'profile_name': 'TestNspProfile', + 'accessrule_name': 'TestNspAccessRule' + }) + + self.cmd('network perimeter create --name {nsp_name} -l eastus2euap --resource-group {rg}') + self.cmd('network perimeter profile create --name {profile_name} --perimeter-name {nsp_name} --resource-group {rg}') + + self.cmd('az network perimeter profile access-rule create --name {accessrule_name} --profile-name {profile_name} --perimeter-name {nsp_name} --resource-group {rg} --fqdn "[\'www.abc.com\', \'www.google.com\']" --direction "Outbound"') + + self.cmd('az network perimeter profile access-rule show --name {accessrule_name} --profile-name {profile_name} --perimeter-name {nsp_name} --resource-group {rg}', checks=[ + self.check('properties.fullyQualifiedDomainNames', "[\'www.abc.com\', \'www.google.com\']") + ]) + + self.cmd('az network perimeter profile access-rule update --name {accessrule_name} --profile-name {profile_name} --perimeter-name {nsp_name} --resource-group {rg} --fqdn "[\'www.abc.com\']" --direction "Outbound"') + + self.cmd('az network perimeter profile access-rule show --name {accessrule_name} --profile-name {profile_name} --perimeter-name {nsp_name} --resource-group {rg}', checks=[ + self.check('properties.fullyQualifiedDomainNames', "[\'www.abc.com\']") + ]) + + self.cmd('network perimeter profile access-rule list --perimeter-name {nsp_name} --profile-name {profile_name} --resource-group {rg}') + + self.cmd('network perimeter profile access-rule delete --name {accessrule_name} --perimeter-name {nsp_name} --profile-name {profile_name} --resource-group {rg} --yes') + + @ResourceGroupPreparer(name_prefix='test_nsp_accessrule_inbound', location='eastus2euap') + def test_nsp_accessrule_inbound(self, resource_group): + self.kwargs.update({ + 'nsp_name': 'TestNetworkSecurityPerimeter', + 'profile_name': 'TestNspProfile', + 'ip_accessrule_name': 'TestNspAccessRule_ip', + 'sub_accessrule_name': 'TestNspAccessRule_subscription', + 'nsp_accessrule_name': 'TestNspAccessRule_nsp', + 'sub': self.get_subscription_id() + }) + + self.cmd('network perimeter create --name {nsp_name} -l eastus2euap --resource-group {rg}') + self.cmd('network perimeter profile create --name {profile_name} --perimeter-name {nsp_name} --resource-group {rg}') + + # IP based access rule + self.cmd('az network perimeter profile access-rule create --name {ip_accessrule_name} --profile-name {profile_name} --perimeter-name {nsp_name} --resource-group {rg} --address-prefixes "[10.10.0.0/16]"', checks=[ + self.check('properties.addressPrefixes', "['10.10.0.0/16']") + ]) + + # Subscription based access rule + self.cmd('az network perimeter profile access-rule create --name {sub_accessrule_name} --profile-name {profile_name} --perimeter-name {nsp_name} --resource-group {rg} --subscriptions [0].id="/subscriptions/{sub}"', checks=[ + self.check('properties.subscriptions[0].id', "/subscriptions/{sub}") + ]) + + # NSP based access rule + self.cmd('network perimeter create --name nsp_for_rule -l eastus2euap --resource-group {rg}') + self.cmd('az network perimeter profile access-rule create --name {nsp_accessrule_name} --profile-name {profile_name} --perimeter-name {nsp_name} --resource-group {rg} --nsp [0].id="/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule"', checks=[ + self.check('properties.networkSecurityPerimeters[0].id', "/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule") + ]) + + @ResourceGroupPreparer(name_prefix='test_nsp_association_crud', location='eastus2euap') + def test_nsp_association_crud(self, resource_group): + self.kwargs.update({ + 'nsp_name': 'TestNetworkSecurityPerimeter', + 'profile_name': 'TestNspProfile', + 'association_name': 'TestNspAssociation', + 'resource_name': 'kvnspclitest5', + 'sub': self.get_subscription_id() + }) + + self.cmd('network perimeter create --name {nsp_name} -l eastus2euap --resource-group {rg}') + self.cmd('network perimeter profile create --name {profile_name} --perimeter-name {nsp_name} --resource-group {rg}') + + self.cmd('keyvault create --name {resource_name} -l eastus2euap --resource-group {rg}') + + self.cmd('network perimeter association create --name {association_name} --perimeter-name {nsp_name} --resource-group {rg} --access-mode Learning ' + '--private-link-resource id="/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.KeyVault/vaults/{resource_name}" ' + '--profile id="/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Network/networkSecurityPerimeters/{nsp_name}/profiles/{profile_name}"') + + self.cmd('network perimeter association show --name {association_name} --perimeter-name {nsp_name} --resource-group {rg}', checks=[ + self.check('properties.accessMode', 'Learning') + ]) + + self.cmd('network perimeter association update --name {association_name} --perimeter-name {nsp_name} --resource-group {rg} --access-mode Enforced ' + '--private-link-resource id="/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.KeyVault/vaults/{resource_name}" ' + '--profile id="/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Network/networkSecurityPerimeters/{nsp_name}/profiles/{profile_name}"') + + self.cmd('network perimeter association show --name {association_name} --perimeter-name {nsp_name} --resource-group {rg}', checks=[ + self.check('properties.accessMode', 'Enforced') + ]) + + self.cmd('network perimeter association list --perimeter-name {nsp_name} --resource-group {rg}') + + self.cmd('network perimeter association delete --name {association_name} --perimeter-name {nsp_name} --resource-group {rg} --yes') + + self.cmd('network perimeter association show --name {association_name} --perimeter-name {nsp_name} --resource-group {rg}', expect_failure=True) + + self.cmd('keyvault delete --name {resource_name} --resource-group {rg} --no-wait') + self.cmd('keyvault purge --name {resource_name} -l eastus2euap --no-wait') From 94de19d9797cec0f0c1d06136714e72583fad6b0 Mon Sep 17 00:00:00 2001 From: Nikhil Saxena Date: Mon, 31 Oct 2022 09:51:51 +0530 Subject: [PATCH 03/12] added examples --- .../aaz/latest/network/perimeter/_create.py | 5 ++++- .../aaz/latest/network/perimeter/_delete.py | 3 +++ .../azext_nsp/aaz/latest/network/perimeter/_list.py | 3 +++ .../azext_nsp/aaz/latest/network/perimeter/_show.py | 3 +++ .../latest/network/perimeter/association/_create.py | 3 +++ .../latest/network/perimeter/association/_delete.py | 3 +++ .../latest/network/perimeter/association/_list.py | 3 +++ .../latest/network/perimeter/association/_show.py | 3 +++ .../latest/network/perimeter/association/_update.py | 3 +++ .../network/perimeter/onboarded_resources/_list.py | 3 +++ .../aaz/latest/network/perimeter/profile/_create.py | 3 +++ .../aaz/latest/network/perimeter/profile/_delete.py | 3 +++ .../aaz/latest/network/perimeter/profile/_list.py | 3 +++ .../aaz/latest/network/perimeter/profile/_show.py | 3 +++ .../network/perimeter/profile/access_rule/_create.py | 12 ++++++++++++ .../network/perimeter/profile/access_rule/_delete.py | 3 +++ .../network/perimeter/profile/access_rule/_list.py | 3 +++ .../network/perimeter/profile/access_rule/_show.py | 3 +++ .../network/perimeter/profile/access_rule/_update.py | 3 +++ 19 files changed, 67 insertions(+), 1 deletion(-) diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/_create.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/_create.py index 78482a91340..7c508f2265d 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/_create.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/_create.py @@ -15,7 +15,10 @@ "network perimeter create", ) class Create(AAZCommand): - """Creates or updates a Network Security Perimeter. + """Creates a Network Security Perimeter. + + :example: Create a Network Security Perimeter + az network perimeter create -n MyPerimeter -g MyResourceGroup -l northcentralus """ _aaz_info = { diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/_delete.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/_delete.py index a7364fd47c6..1ae90eae9e9 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/_delete.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/_delete.py @@ -17,6 +17,9 @@ ) class Delete(AAZCommand): """Deletes a network security perimeter. + + :example: Delete a Network Security Perimeter + az network perimeter delete -g MyResourceGroup -n MyPerimeter """ _aaz_info = { diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/_list.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/_list.py index e5c1040ed2b..70526f8e251 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/_list.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/_list.py @@ -16,6 +16,9 @@ ) class List(AAZCommand): """List all network security perimeters in a subscription. + + :example: List Network Security Perimeters + az network perimeter list -g MyResourceGroup """ _aaz_info = { diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/_show.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/_show.py index d8d6488e776..e105f94535a 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/_show.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/_show.py @@ -16,6 +16,9 @@ ) class Show(AAZCommand): """Gets the specified network security perimeter by the name. + + :example: Get the Network Security Perimeter + az network perimeter show -g MyResourceGroup -n MyPerimeter """ _aaz_info = { diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_create.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_create.py index 13e58cb93d6..77b0bc869f6 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_create.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_create.py @@ -16,6 +16,9 @@ ) class Create(AAZCommand): """Creates or updates a NSP resource association. + + :example: Create NSP Association + az network perimeter association create -n MyAssociation --perimeter-name MyPerimeter -g MyResourceGroup --access-mode Learning --private-link-resource "{id:}" --profile "{id:}" """ _aaz_info = { diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_delete.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_delete.py index aa9a30122be..8e1ab8e33b4 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_delete.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_delete.py @@ -17,6 +17,9 @@ ) class Delete(AAZCommand): """Deletes an NSP association resource. + + :example: Delete NSP Association + az network perimeter association delete -n MyAssociation --perimeter-name MyPerimeter -g MyResourceGroup """ _aaz_info = { diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_list.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_list.py index ac3368b6b5d..3eb46dc0886 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_list.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_list.py @@ -16,6 +16,9 @@ ) class List(AAZCommand): """Lists the NSP resource associations. + + :example: List NSP Associations inside a Perimeter + az network perimeter association list --perimeter-name MyPerimeter -g MyResourceGroup """ _aaz_info = { diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_show.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_show.py index e6a8218bdf3..651de0f0660 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_show.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_show.py @@ -16,6 +16,9 @@ ) class Show(AAZCommand): """Gets the specified NSP association by name. + + :example: Get NSP Association + az network perimeter association show -n MyAssociation --perimeter-name MyPerimeter -g MyResourceGroup """ _aaz_info = { diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_update.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_update.py index 2c076027087..9b63b3d83c8 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_update.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_update.py @@ -16,6 +16,9 @@ ) class Update(AAZCommand): """Creates or updates a NSP resource association. + + :example: Update NSP Association + az network perimeter association update --name MyAssociation --perimeter-name MyPerimeter --resource-group MyResourceGroup --access-mode Enforced --private-link-resource id=" --profile id="ProfileArmID" """ _aaz_info = { diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/onboarded_resources/_list.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/onboarded_resources/_list.py index 5ca4224099a..02ef841144d 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/onboarded_resources/_list.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/onboarded_resources/_list.py @@ -16,6 +16,9 @@ ) class List(AAZCommand): """Gets the list of resources that are onboarded with NSP. These resources can be associated with a network security perimeter. + + :example: List NSP onboarded resources + az network perimeter onboarded-resources list -l northcentralus """ _aaz_info = { diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_create.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_create.py index fe8c6bf0fe5..5cbae89ea8e 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_create.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_create.py @@ -16,6 +16,9 @@ ) class Create(AAZCommand): """Creates or updates a network profile. + + :example: Create NSP Profile + az network perimeter profile create -n MyProfile --perimeter-name MyPerimeter -g MyResourceGroup """ _aaz_info = { diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_delete.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_delete.py index a93cd631619..42252031fd5 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_delete.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_delete.py @@ -17,6 +17,9 @@ ) class Delete(AAZCommand): """Deletes an NSP profile. + + :example: Delete NSP Profile + az network perimeter profile delete -n MyProfile --perimeter-name MyPerimeter -g MyResourceGroup """ _aaz_info = { diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_list.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_list.py index f875a66b6d9..6eac209f903 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_list.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_list.py @@ -16,6 +16,9 @@ ) class List(AAZCommand): """Lists the NSP profiles in the specified network security perimeter. + + :example: List NSP Profiles inside a Perimeter + az network perimeter profile list --perimeter-name MyPerimeter -g MyResourceGroup """ _aaz_info = { diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_show.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_show.py index 508a20e71b6..ef1280d963b 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_show.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/_show.py @@ -16,6 +16,9 @@ ) class Show(AAZCommand): """Gets the specified NSP profile. + + :example: Get NSP Profile + az network perimeter profile show --perimeter-name MyPerimeter -g MyResourceGroup -n MyProfile """ _aaz_info = { diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_create.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_create.py index fe677b7e437..2564ac28834 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_create.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_create.py @@ -16,6 +16,18 @@ ) class Create(AAZCommand): """Creates or updates a network access rule. + + :example: Create IP based access rule + az network perimeter profile access-rule create -n MyAccessRule --profile-name MyProfile --perimeter-name MyPerimeter -g MyResourceGroup --address-prefixes "[10.10.0.0/16]" + + :example: Create NSP based access rule + az network perimeter profile access-rule create -n MyAccessRule --profile-name MyProfile --perimeter-name MyPerimeter -g MyResourceGroup --nsp "[{id:}]" + + :example: Create FQDN based access rule + az network perimeter profile access-rule create -n MyAccessRule --profile-name MyProfile --perimeter-name MyPerimeter -g MyResourceGroup --fqdn "['www.abc.com', 'www.google.com']" --direction "Outbound" + + :example: Create Subscription based access rule + az network perimeter profile access-rule create -n MyAccessRule --profile-name MyProfile --perimeter-name MyPerimeter -g MyResourceGroup --subscriptions [0].id="" [1].id="" """ _aaz_info = { diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_delete.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_delete.py index 7aa27a964fb..aef785134ed 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_delete.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_delete.py @@ -17,6 +17,9 @@ ) class Delete(AAZCommand): """Deletes an NSP access rule. + + :example: Delete NSP access rule + az network perimeter profile access-rule delete -n MyAccessRule --profile-name MyProfile --perimeter-name MyPerimeter -g MyResourceGroup """ _aaz_info = { diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_list.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_list.py index af151cbbbd9..3265f7d8c26 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_list.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_list.py @@ -16,6 +16,9 @@ ) class List(AAZCommand): """Lists the NSP access rules in the specified NSP profile. + + :example: List access rules inside a Profile + az network perimeter profile access-rule list --profile-name MyProfile --perimeter-name MyPerimeter -g MyResourceGroup """ _aaz_info = { diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_show.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_show.py index 736412d9227..b0951c8878c 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_show.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_show.py @@ -16,6 +16,9 @@ ) class Show(AAZCommand): """Gets the specified NSP access rule by name. + + :example: Get NSP access rule + az network perimeter profile access-rule show -n MyAccessRule --profile-name MyProfile --perimeter-name MyPerimeter -g MyResourceGroup """ _aaz_info = { diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_update.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_update.py index 8a7ac0af985..63bba704a8b 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_update.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/profile/access_rule/_update.py @@ -16,6 +16,9 @@ ) class Update(AAZCommand): """Creates or updates a network access rule. + + :example: Update access rule + az network perimeter profile access-rule update -n MyAccessRule --profile-name MyProfile --perimeter-name MyPerimeter -g MyResourceGroup --address-prefixes "[10.10.0.0/16]" """ _aaz_info = { From d8e576db2fc6ce78ca27e3a3024ac930c670ec07 Mon Sep 17 00:00:00 2001 From: Nikhil Saxena Date: Mon, 14 Nov 2022 12:26:20 +0530 Subject: [PATCH 04/12] updated test runs --- .../recordings/test_nsp_accessrule_crud.yaml | 34 ++++---- .../test_nsp_accessrule_inbound.yaml | 40 ++++----- .../recordings/test_nsp_association_crud.yaml | 82 +++++++++---------- .../latest/recordings/test_nsp_crud.yaml | 22 ++--- .../recordings/test_nsp_profile_crud.yaml | 18 ++-- 5 files changed, 98 insertions(+), 98 deletions(-) diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml index 7097df6285c..2e7991f321e 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml @@ -22,7 +22,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"27983ebb-9283-4d7f-a510-8dc9f778be91","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"bb2123f7-e8e9-4550-84bf-106c5c0253d0","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:00:59 GMT + - Mon, 14 Nov 2022 06:47:47 GMT expires: - '-1' pragma: @@ -70,7 +70,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:00:48Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:47:27Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:00:59 GMT + - Mon, 14 Nov 2022 06:47:47 GMT expires: - '-1' pragma: @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:01 GMT + - Mon, 14 Nov 2022 06:47:51 GMT expires: - '-1' pragma: @@ -141,7 +141,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -164,7 +164,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:00:48Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:47:27Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -173,7 +173,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:02 GMT + - Mon, 14 Nov 2022 06:47:51 GMT expires: - '-1' pragma: @@ -220,7 +220,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:05 GMT + - Mon, 14 Nov 2022 06:47:57 GMT expires: - '-1' pragma: @@ -268,7 +268,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:07 GMT + - Mon, 14 Nov 2022 06:48:00 GMT expires: - '-1' pragma: @@ -305,7 +305,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:00:48Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:47:27Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -314,7 +314,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:07 GMT + - Mon, 14 Nov 2022 06:48:00 GMT expires: - '-1' pragma: @@ -356,7 +356,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:09 GMT + - Mon, 14 Nov 2022 06:48:02 GMT expires: - '-1' pragma: @@ -408,7 +408,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:13 GMT + - Mon, 14 Nov 2022 06:48:04 GMT expires: - '-1' pragma: @@ -456,7 +456,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:15 GMT + - Mon, 14 Nov 2022 06:48:05 GMT expires: - '-1' pragma: @@ -502,7 +502,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:17 GMT + - Mon, 14 Nov 2022 06:48:05 GMT expires: - '-1' pragma: @@ -548,7 +548,7 @@ interactions: content-length: - '0' date: - - Mon, 17 Oct 2022 18:01:20 GMT + - Mon, 14 Nov 2022 06:48:09 GMT expires: - '-1' pragma: diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml index 301fe2db32b..7fe266b8085 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml @@ -22,7 +22,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"68bbb51d-615a-497f-8a27-daa6a05735b9","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"9a53467a-d409-460a-8a5a-9e0510fbc28a","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:03 GMT + - Mon, 14 Nov 2022 06:47:41 GMT expires: - '-1' pragma: @@ -70,7 +70,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:00:48Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:47:27Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:03 GMT + - Mon, 14 Nov 2022 06:47:42 GMT expires: - '-1' pragma: @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:08 GMT + - Mon, 14 Nov 2022 06:47:46 GMT expires: - '-1' pragma: @@ -164,7 +164,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:00:48Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:47:27Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -173,7 +173,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:08 GMT + - Mon, 14 Nov 2022 06:47:46 GMT expires: - '-1' pragma: @@ -220,7 +220,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:10 GMT + - Mon, 14 Nov 2022 06:47:50 GMT expires: - '-1' pragma: @@ -236,7 +236,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -259,7 +259,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:00:48Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:47:27Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -268,7 +268,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:10 GMT + - Mon, 14 Nov 2022 06:47:50 GMT expires: - '-1' pragma: @@ -315,7 +315,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:12 GMT + - Mon, 14 Nov 2022 06:47:55 GMT expires: - '-1' pragma: @@ -331,7 +331,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -358,7 +358,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule?api-version=2021-02-01-preview response: body: - string: '{"name":"nsp_for_rule","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"3a60f81e-183a-4a7c-9264-2b3b6a780cb1","provisioningState":"Succeeded"}}' + string: '{"name":"nsp_for_rule","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"48b74cd9-990a-4cd5-9def-aad78f8b06d9","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -367,7 +367,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:24 GMT + - Mon, 14 Nov 2022 06:48:07 GMT expires: - '-1' pragma: @@ -406,7 +406,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:00:48Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:47:27Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -415,7 +415,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:24 GMT + - Mon, 14 Nov 2022 06:48:07 GMT expires: - '-1' pragma: @@ -453,7 +453,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_nsp?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNspAccessRule_nsp","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_nsp","type":"Microsoft.Network/networkSecurityPerimeters/profiles/accessRules","properties":{"provisioningState":"Succeeded","direction":"Inbound","addressPrefixes":[],"fullyQualifiedDomainNames":[],"subscriptions":[],"networkSecurityPerimeters":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","perimeterGuid":"3a60f81e-183a-4a7c-9264-2b3b6a780cb1","location":"eastus2euap"}]}}' + string: '{"name":"TestNspAccessRule_nsp","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_nsp","type":"Microsoft.Network/networkSecurityPerimeters/profiles/accessRules","properties":{"provisioningState":"Succeeded","direction":"Inbound","addressPrefixes":[],"fullyQualifiedDomainNames":[],"subscriptions":[],"networkSecurityPerimeters":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","perimeterGuid":"48b74cd9-990a-4cd5-9def-aad78f8b06d9","location":"eastus2euap"}]}}' headers: cache-control: - no-cache @@ -462,7 +462,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:25 GMT + - Mon, 14 Nov 2022 06:48:11 GMT expires: - '-1' pragma: @@ -478,7 +478,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml index 82b361936e9..3d063f409cb 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml @@ -22,7 +22,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"93c5d42e-4958-49f9-b50c-d1b4904a4e18","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"21348ba0-de41-4add-a49c-e270127bb161","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:02 GMT + - Mon, 14 Nov 2022 06:47:43 GMT expires: - '-1' pragma: @@ -70,7 +70,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:00:48Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:47:27Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:02 GMT + - Mon, 14 Nov 2022 06:47:44 GMT expires: - '-1' pragma: @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:04 GMT + - Mon, 14 Nov 2022 06:47:47 GMT expires: - '-1' pragma: @@ -141,7 +141,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -175,7 +175,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:05 GMT + - Mon, 14 Nov 2022 06:47:48 GMT expires: - '-1' pragma: @@ -219,11 +219,11 @@ interactions: content-type: - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:05 GMT + - Mon, 14 Nov 2022 06:47:49 GMT odata-version: - '4.0' request-id: - - 9dbff22d-6e49-424e-8f15-35736b9d7d79 + - 35e681db-f65c-4c7a-b249-a42c21905974 strict-transport-security: - max-age=31536000 transfer-encoding: @@ -231,7 +231,7 @@ interactions: vary: - Accept-Encoding x-ms-ags-diagnostic: - - '{"ServerInfo":{"DataCenter":"South India","Slice":"E","Ring":"2","ScaleUnit":"000","RoleInstance":"MA1PEPF00002721"}}' + - '{"ServerInfo":{"DataCenter":"South India","Slice":"E","Ring":"2","ScaleUnit":"002","RoleInstance":"MA1PEPF00003153"}}' x-ms-resource-unit: - '1' status: @@ -265,16 +265,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2021-06-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.KeyVault/vaults","location":"eastus2euap","tags":{},"systemData":{"createdBy":"nikhilsaxena@microsoft.com","createdByType":"User","createdAt":"2022-10-17T18:01:11.692Z","lastModifiedBy":"nikhilsaxena@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-10-17T18:01:11.692Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"d50cfdce-f74f-4b75-9ea4-dd65c07770fd","permissions":{"keys":["all"],"secrets":["all"],"certificates":["all"],"storage":["all"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"softDeleteRetentionInDays":90,"vaultUri":"https://kvnspclitest5.vault.azure.net","provisioningState":"RegisteringDns","publicNetworkAccess":"Enabled"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.KeyVault/vaults","location":"eastus2euap","tags":{},"systemData":{"createdBy":"nikhilsaxena@microsoft.com","createdByType":"User","createdAt":"2022-11-14T06:48:00.05Z","lastModifiedBy":"nikhilsaxena@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-11-14T06:48:00.05Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"d50cfdce-f74f-4b75-9ea4-dd65c07770fd","permissions":{"keys":["all"],"secrets":["all"],"certificates":["all"],"storage":["all"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"softDeleteRetentionInDays":90,"vaultUri":"https://kvnspclitest5.vault.azure.net","provisioningState":"RegisteringDns","publicNetworkAccess":"Enabled"}}' headers: cache-control: - no-cache content-length: - - '1005' + - '1003' content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:14 GMT + - Mon, 14 Nov 2022 06:48:04 GMT expires: - '-1' pragma: @@ -292,9 +292,9 @@ interactions: x-content-type-options: - nosniff x-ms-keyvault-service-version: - - 1.5.534.0 + - 1.5.564.0 x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -317,16 +317,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2021-06-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.KeyVault/vaults","location":"eastus2euap","tags":{},"systemData":{"createdBy":"nikhilsaxena@microsoft.com","createdByType":"User","createdAt":"2022-10-17T18:01:11.692Z","lastModifiedBy":"nikhilsaxena@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-10-17T18:01:11.692Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"d50cfdce-f74f-4b75-9ea4-dd65c07770fd","permissions":{"keys":["all"],"secrets":["all"],"certificates":["all"],"storage":["all"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"softDeleteRetentionInDays":90,"vaultUri":"https://kvnspclitest5.vault.azure.net/","provisioningState":"Succeeded","publicNetworkAccess":"Enabled"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.KeyVault/vaults","location":"eastus2euap","tags":{},"systemData":{"createdBy":"nikhilsaxena@microsoft.com","createdByType":"User","createdAt":"2022-11-14T06:48:00.05Z","lastModifiedBy":"nikhilsaxena@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-11-14T06:48:00.05Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"d50cfdce-f74f-4b75-9ea4-dd65c07770fd","permissions":{"keys":["all"],"secrets":["all"],"certificates":["all"],"storage":["all"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"softDeleteRetentionInDays":90,"vaultUri":"https://kvnspclitest5.vault.azure.net/","provisioningState":"Succeeded","publicNetworkAccess":"Enabled"}}' headers: cache-control: - no-cache content-length: - - '1001' + - '999' content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:46 GMT + - Mon, 14 Nov 2022 06:48:37 GMT expires: - '-1' pragma: @@ -344,7 +344,7 @@ interactions: x-content-type-options: - nosniff x-ms-keyvault-service-version: - - 1.5.534.0 + - 1.5.564.0 status: code: 200 message: OK @@ -368,7 +368,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:00:48Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:47:27Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -377,7 +377,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:46 GMT + - Mon, 14 Nov 2022 06:48:36 GMT expires: - '-1' pragma: @@ -426,7 +426,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:54 GMT + - Mon, 14 Nov 2022 06:48:42 GMT expires: - '-1' pragma: @@ -442,7 +442,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK @@ -474,7 +474,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:56 GMT + - Mon, 14 Nov 2022 06:48:45 GMT expires: - '-1' pragma: @@ -512,7 +512,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:00:48Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:47:27Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -521,7 +521,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:56 GMT + - Mon, 14 Nov 2022 06:48:45 GMT expires: - '-1' pragma: @@ -564,7 +564,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:58 GMT + - Mon, 14 Nov 2022 06:48:47 GMT expires: - '-1' pragma: @@ -617,7 +617,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:59 GMT + - Mon, 14 Nov 2022 06:48:48 GMT expires: - '-1' pragma: @@ -665,7 +665,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:02:01 GMT + - Mon, 14 Nov 2022 06:48:50 GMT expires: - '-1' pragma: @@ -711,7 +711,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:02:04 GMT + - Mon, 14 Nov 2022 06:48:53 GMT expires: - '-1' pragma: @@ -755,7 +755,7 @@ interactions: cache-control: - no-cache date: - - Mon, 17 Oct 2022 18:02:06 GMT + - Mon, 14 Nov 2022 06:48:56 GMT expires: - '-1' pragma: @@ -767,7 +767,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14999' status: code: 204 message: No Content @@ -800,7 +800,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:02:08 GMT + - Mon, 14 Nov 2022 06:48:57 GMT expires: - '-1' pragma: @@ -842,7 +842,7 @@ interactions: content-length: - '0' date: - - Mon, 17 Oct 2022 18:02:20 GMT + - Mon, 14 Nov 2022 06:49:10 GMT expires: - '-1' pragma: @@ -856,7 +856,7 @@ interactions: x-content-type-options: - nosniff x-ms-keyvault-service-version: - - 1.5.534.0 + - 1.5.564.0 x-ms-ratelimit-remaining-subscription-deletes: - '14999' status: @@ -881,7 +881,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/deletedVaults/kvnspclitest5?api-version=2021-06-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/deletedVaults/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.KeyVault/deletedVaults","properties":{"vaultId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5","location":"eastus2euap","tags":{},"deletionDate":"2022-10-17T18:02:11Z","scheduledPurgeDate":"2023-01-15T18:02:11Z"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/deletedVaults/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.KeyVault/deletedVaults","properties":{"vaultId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5","location":"eastus2euap","tags":{},"deletionDate":"2022-11-14T06:49:00Z","scheduledPurgeDate":"2023-02-12T06:49:00Z"}}' headers: cache-control: - no-cache @@ -890,7 +890,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:02:22 GMT + - Mon, 14 Nov 2022 06:49:12 GMT expires: - '-1' pragma: @@ -908,7 +908,7 @@ interactions: x-content-type-options: - nosniff x-ms-keyvault-service-version: - - 1.5.534.0 + - 1.5.564.0 status: code: 200 message: OK @@ -940,11 +940,11 @@ interactions: content-length: - '0' date: - - Mon, 17 Oct 2022 18:02:23 GMT + - Mon, 14 Nov 2022 06:49:13 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/operationResults/VVR8MDYzODAxNjI2NTQ0MzE5MjgwNnxDNjBCMTc1NkFFRDQ0MDdEQjAyNUMwQkIxOEQ5OUIzNQ?api-version=2021-06-01-preview + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/operationResults/VVR8MDYzODA0MDA1MzU0Nzg0NDIxMXw3NjlGOTI4Q0FFMzQ0NTU0OEZERTIyQUFFMEI2NDY5OA?api-version=2021-06-01-preview pragma: - no-cache server: @@ -956,7 +956,7 @@ interactions: x-content-type-options: - nosniff x-ms-keyvault-service-version: - - 1.5.534.0 + - 1.5.564.0 x-ms-ratelimit-remaining-subscription-writes: - '1199' status: diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml index 7ad41d4a864..b8f9375af9d 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml @@ -22,7 +22,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"8fe0221d-e556-4883-bef6-808ce00e1378","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"03dccef2-7cd5-4b3a-b38a-3302ee428511","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:00:59 GMT + - Mon, 14 Nov 2022 06:47:43 GMT expires: - '-1' pragma: @@ -70,7 +70,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"8fe0221d-e556-4883-bef6-808ce00e1378","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"03dccef2-7cd5-4b3a-b38a-3302ee428511","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:00 GMT + - Mon, 14 Nov 2022 06:47:46 GMT expires: - '-1' pragma: @@ -116,7 +116,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters?api-version=2021-02-01-preview response: body: - string: '{"nextLink":"","value":[{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"8fe0221d-e556-4883-bef6-808ce00e1378","provisioningState":"Succeeded"}}]}' + string: '{"nextLink":"","value":[{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"03dccef2-7cd5-4b3a-b38a-3302ee428511","provisioningState":"Succeeded"}}]}' headers: cache-control: - no-cache @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:02 GMT + - Mon, 14 Nov 2022 06:47:48 GMT expires: - '-1' pragma: @@ -171,7 +171,7 @@ interactions: content-length: - '0' date: - - Mon, 17 Oct 2022 18:01:10 GMT + - Mon, 14 Nov 2022 06:47:56 GMT expires: - '-1' pragma: @@ -215,7 +215,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:11 GMT + - Mon, 14 Nov 2022 06:47:58 GMT expires: - '-1' pragma: @@ -252,16 +252,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/perimeterAssociableResourceTypes?api-version=2021-02-01-preview&firstIndex=10&pageSize=10 response: body: - string: '{"type":"","nextLink":"","value":[{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.ServiceBus.namespaces","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.ServiceBus.namespaces","properties":{"providerNamespace":"Microsoft.ServiceBus","resourceType":"namespaces","displayName":"Microsoft.ServiceBus/namespaces","apiVersion":"2022-01-01-preview","publicDnsZones":["servicebus.windows.net"]}}]}' + string: '{"type":"","nextLink":"","value":[{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.ServiceBus.namespaces","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.ServiceBus.namespaces","properties":{"providerNamespace":"Microsoft.ServiceBus","resourceType":"namespaces","displayName":"Microsoft.ServiceBus/namespaces","apiVersion":"2022-01-01-preview","publicDnsZones":["servicebus.windows.net"]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.Insights.ScheduledQueryRules","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.Insights.ScheduledQueryRules","properties":{"providerNamespace":"Microsoft.Insights","resourceType":"ScheduledQueryRules","displayName":"Microsoft.Insights/ScheduledQueryRules","apiVersion":"2021-10-01","publicDnsZones":[]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.Insights.actionGroups","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.Insights.actionGroups","properties":{"providerNamespace":"Microsoft.Insights","resourceType":"actionGroups","displayName":"Microsoft.Insights/actionGroups","apiVersion":"2021-10-01","publicDnsZones":["azns.azure.com","azns.azure.net","azns.azure.cn","azns.microsofticm.com","azurenotifications.msftcloudes.cn","azurenotifications.msftcloudes.net"]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.DocumentDB.databaseAccounts","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.DocumentDB.databaseAccounts","properties":{"providerNamespace":"Microsoft.DocumentDB","resourceType":"databaseAccounts","displayName":"Microsoft.DocumentDB/databaseAccounts","apiVersion":"2022-08-15-preview","publicDnsZones":["documents.azure.com","mongo.cosmos.azure.com","cassandra.cosmos.azure.com","gremlin.cosmos.azure.com","table.cosmos.azure.com"]}}]}' headers: cache-control: - no-cache content-length: - - '482' + - '2060' content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:12 GMT + - Mon, 14 Nov 2022 06:47:59 GMT expires: - '-1' pragma: diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml index 402f31f2bcf..aeca60adb72 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml @@ -22,7 +22,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"610676ee-39b0-4eaa-9583-e2e9b9f75a2a","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"6affe8f1-e991-4000-8faa-d6a1b5ac48b5","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:38 GMT + - Mon, 14 Nov 2022 06:48:31 GMT expires: - '-1' pragma: @@ -47,7 +47,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -70,7 +70,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_profile_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001","name":"test_nsp_profile_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-10-17T18:01:28Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001","name":"test_nsp_profile_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:48:17Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:38 GMT + - Mon, 14 Nov 2022 06:48:31 GMT expires: - '-1' pragma: @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:38 GMT + - Mon, 14 Nov 2022 06:48:34 GMT expires: - '-1' pragma: @@ -173,7 +173,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:42 GMT + - Mon, 14 Nov 2022 06:48:35 GMT expires: - '-1' pragma: @@ -219,7 +219,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 17 Oct 2022 18:01:42 GMT + - Mon, 14 Nov 2022 06:48:37 GMT expires: - '-1' pragma: @@ -265,7 +265,7 @@ interactions: content-length: - '0' date: - - Mon, 17 Oct 2022 18:01:44 GMT + - Mon, 14 Nov 2022 06:48:41 GMT expires: - '-1' pragma: From 0d1237468ffb3173a000611085340dc2df321808 Mon Sep 17 00:00:00 2001 From: Nikhil Saxena Date: Mon, 14 Nov 2022 13:51:56 +0530 Subject: [PATCH 05/12] use cognitive for associations --- .../recordings/test_nsp_accessrule_crud.yaml | 38 +- .../test_nsp_accessrule_inbound.yaml | 44 +-- .../recordings/test_nsp_association_crud.yaml | 369 ++++-------------- .../latest/recordings/test_nsp_crud.yaml | 20 +- .../recordings/test_nsp_profile_crud.yaml | 20 +- src/nsp/azext_nsp/tests/latest/test_nsp.py | 10 +- 6 files changed, 146 insertions(+), 355 deletions(-) diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml index 2e7991f321e..44ec6fff811 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml @@ -22,7 +22,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"bb2123f7-e8e9-4550-84bf-106c5c0253d0","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"64c4b6e3-9835-41e5-a048-24ec67f52ffd","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:47:47 GMT + - Mon, 14 Nov 2022 08:16:57 GMT expires: - '-1' pragma: @@ -47,7 +47,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK @@ -70,7 +70,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:47:27Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:16:45Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:47:47 GMT + - Mon, 14 Nov 2022 08:16:58 GMT expires: - '-1' pragma: @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:47:51 GMT + - Mon, 14 Nov 2022 08:17:00 GMT expires: - '-1' pragma: @@ -164,7 +164,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:47:27Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:16:45Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -173,7 +173,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:47:51 GMT + - Mon, 14 Nov 2022 08:17:01 GMT expires: - '-1' pragma: @@ -220,7 +220,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:47:57 GMT + - Mon, 14 Nov 2022 08:17:02 GMT expires: - '-1' pragma: @@ -236,7 +236,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK @@ -268,7 +268,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:00 GMT + - Mon, 14 Nov 2022 08:17:03 GMT expires: - '-1' pragma: @@ -305,7 +305,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:47:27Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:16:45Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -314,7 +314,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:00 GMT + - Mon, 14 Nov 2022 08:17:03 GMT expires: - '-1' pragma: @@ -356,7 +356,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:02 GMT + - Mon, 14 Nov 2022 08:17:05 GMT expires: - '-1' pragma: @@ -408,7 +408,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:04 GMT + - Mon, 14 Nov 2022 08:17:05 GMT expires: - '-1' pragma: @@ -424,7 +424,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' status: code: 200 message: OK @@ -456,7 +456,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:05 GMT + - Mon, 14 Nov 2022 08:17:07 GMT expires: - '-1' pragma: @@ -502,7 +502,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:05 GMT + - Mon, 14 Nov 2022 08:17:11 GMT expires: - '-1' pragma: @@ -548,7 +548,7 @@ interactions: content-length: - '0' date: - - Mon, 14 Nov 2022 06:48:09 GMT + - Mon, 14 Nov 2022 08:17:14 GMT expires: - '-1' pragma: diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml index 7fe266b8085..ccd5ee819c8 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml @@ -22,7 +22,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"9a53467a-d409-460a-8a5a-9e0510fbc28a","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"e40822c0-9626-4b07-8d08-16dfb8d808ee","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:47:41 GMT + - Mon, 14 Nov 2022 08:16:52 GMT expires: - '-1' pragma: @@ -47,7 +47,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK @@ -70,7 +70,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:47:27Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:16:45Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:47:42 GMT + - Mon, 14 Nov 2022 08:16:53 GMT expires: - '-1' pragma: @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:47:46 GMT + - Mon, 14 Nov 2022 08:16:56 GMT expires: - '-1' pragma: @@ -141,7 +141,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK @@ -164,7 +164,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:47:27Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:16:45Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -173,7 +173,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:47:46 GMT + - Mon, 14 Nov 2022 08:16:56 GMT expires: - '-1' pragma: @@ -220,7 +220,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:47:50 GMT + - Mon, 14 Nov 2022 08:16:59 GMT expires: - '-1' pragma: @@ -236,7 +236,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK @@ -259,7 +259,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:47:27Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:16:45Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -268,7 +268,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:47:50 GMT + - Mon, 14 Nov 2022 08:17:00 GMT expires: - '-1' pragma: @@ -315,7 +315,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:47:55 GMT + - Mon, 14 Nov 2022 08:17:03 GMT expires: - '-1' pragma: @@ -331,7 +331,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' status: code: 200 message: OK @@ -358,7 +358,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule?api-version=2021-02-01-preview response: body: - string: '{"name":"nsp_for_rule","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"48b74cd9-990a-4cd5-9def-aad78f8b06d9","provisioningState":"Succeeded"}}' + string: '{"name":"nsp_for_rule","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"e49225cd-7abe-49f9-841d-131f25e6b9c3","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -367,7 +367,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:07 GMT + - Mon, 14 Nov 2022 08:17:06 GMT expires: - '-1' pragma: @@ -383,7 +383,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' status: code: 200 message: OK @@ -406,7 +406,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:47:27Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:16:45Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -415,7 +415,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:07 GMT + - Mon, 14 Nov 2022 08:17:06 GMT expires: - '-1' pragma: @@ -453,7 +453,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_nsp?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNspAccessRule_nsp","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_nsp","type":"Microsoft.Network/networkSecurityPerimeters/profiles/accessRules","properties":{"provisioningState":"Succeeded","direction":"Inbound","addressPrefixes":[],"fullyQualifiedDomainNames":[],"subscriptions":[],"networkSecurityPerimeters":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","perimeterGuid":"48b74cd9-990a-4cd5-9def-aad78f8b06d9","location":"eastus2euap"}]}}' + string: '{"name":"TestNspAccessRule_nsp","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_nsp","type":"Microsoft.Network/networkSecurityPerimeters/profiles/accessRules","properties":{"provisioningState":"Succeeded","direction":"Inbound","addressPrefixes":[],"fullyQualifiedDomainNames":[],"subscriptions":[],"networkSecurityPerimeters":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","perimeterGuid":"e49225cd-7abe-49f9-841d-131f25e6b9c3","location":"eastus2euap"}]}}' headers: cache-control: - no-cache @@ -462,7 +462,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:11 GMT + - Mon, 14 Nov 2022 08:17:08 GMT expires: - '-1' pragma: diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml index 3d063f409cb..1a9b69be894 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml @@ -22,7 +22,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"21348ba0-de41-4add-a49c-e270127bb161","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"07cd4ae2-cca4-4fc5-98f6-349a43fda992","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:47:43 GMT + - Mon, 14 Nov 2022 08:20:08 GMT expires: - '-1' pragma: @@ -47,7 +47,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK @@ -70,7 +70,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:47:27Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:19:56Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:47:44 GMT + - Mon, 14 Nov 2022 08:20:08 GMT expires: - '-1' pragma: @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:47:47 GMT + - Mon, 14 Nov 2022 08:20:10 GMT expires: - '-1' pragma: @@ -146,208 +146,59 @@ interactions: code: 200 message: OK - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - keyvault create - Connection: - - keep-alive - ParameterSetName: - - --name -l --resource-group - User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2021-06-01-preview - response: - body: - string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.KeyVault/vaults/kvnspclitest5'' - under resource group ''test_nsp_association_crud000001'' was not found. For - more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' - headers: - cache-control: - - no-cache - content-length: - - '242' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 14 Nov 2022 06:47:48 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-failure-cause: - - gateway - status: - code: 404 - message: Not Found -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - keyvault create - Connection: - - keep-alive - ParameterSetName: - - --name -l --resource-group - User-Agent: - - python/3.10.5 (Windows-10-10.0.22621-SP0) AZURECLI/2.38.0 - method: GET - uri: https://graph.microsoft.com/v1.0/me - response: - body: - string: '{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users/$entity","businessPhones":[],"displayName":"Nikhil - Saxena","givenName":"Nikhil","jobTitle":"SOFTWARE ENGINEER","mail":"nikhilsaxena@microsoft.com","mobilePhone":null,"officeLocation":"BENGALURU - LUXOR-MIRPL/Mobile","preferredLanguage":null,"surname":"Saxena","userPrincipalName":"nikhilsaxena@microsoft.com","id":"d50cfdce-f74f-4b75-9ea4-dd65c07770fd"}' - headers: - cache-control: - - no-cache - content-length: - - '419' - content-type: - - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 - date: - - Mon, 14 Nov 2022 06:47:49 GMT - odata-version: - - '4.0' - request-id: - - 35e681db-f65c-4c7a-b249-a42c21905974 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-ms-ags-diagnostic: - - '{"ServerInfo":{"DataCenter":"South India","Slice":"E","Ring":"2","ScaleUnit":"002","RoleInstance":"MA1PEPF00003153"}}' - x-ms-resource-unit: - - '1' - status: - code: 200 - message: OK -- request: - body: '{"location": "eastus2euap", "properties": {"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", - "sku": {"family": "A", "name": "standard"}, "accessPolicies": [{"tenantId": - "72f988bf-86f1-41af-91ab-2d7cd011db47", "objectId": "d50cfdce-f74f-4b75-9ea4-dd65c07770fd", - "permissions": {"keys": ["all"], "secrets": ["all"], "certificates": ["all"], - "storage": ["all"]}}], "softDeleteRetentionInDays": 90, "networkAcls": {"bypass": - "AzureServices", "defaultAction": "Allow"}}}' + body: '{"kind": "ComputerVision", "sku": {"name": "S1"}, "location": "eastus2euap", + "properties": {}}' headers: Accept: - application/json Accept-Encoding: - gzip, deflate CommandName: - - keyvault create + - cognitiveservices account create Connection: - keep-alive Content-Length: - - '467' + - '94' Content-Type: - application/json ParameterSetName: - - --name -l --resource-group + - --name --resource-group --kind --sku --location --yes User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.38.0 azsdk-python-mgmt-cognitiveservices/13.2.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2021-06-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5?api-version=2022-03-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.KeyVault/vaults","location":"eastus2euap","tags":{},"systemData":{"createdBy":"nikhilsaxena@microsoft.com","createdByType":"User","createdAt":"2022-11-14T06:48:00.05Z","lastModifiedBy":"nikhilsaxena@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-11-14T06:48:00.05Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"d50cfdce-f74f-4b75-9ea4-dd65c07770fd","permissions":{"keys":["all"],"secrets":["all"],"certificates":["all"],"storage":["all"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"softDeleteRetentionInDays":90,"vaultUri":"https://kvnspclitest5.vault.azure.net","provisioningState":"RegisteringDns","publicNetworkAccess":"Enabled"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.CognitiveServices/accounts","etag":"\"0200cb4d-0000-3400-0000-6371fa460000\"","location":"eastus2euap","sku":{"name":"S1"},"kind":"ComputerVision","properties":{"endpoint":"https://eastus2euap.api.cognitive.microsoft.com/","internalId":"74cb732c62844540bb0b51872dc9a527","dateCreated":"2022-11-14T08:20:21.9307944Z","callRateLimit":{"rules":[{"key":"vision.recognizeText","renewalPeriod":1,"count":30,"dynamicThrottlingEnabled":true,"matchPatterns":[{"path":"vision/recognizeText","method":"POST"},{"path":"vision/textOperations/*","method":"GET"},{"path":"vision/read/*","method":"*"}]},{"key":"vision","renewalPeriod":1,"count":15,"dynamicThrottlingEnabled":true,"matchPatterns":[{"path":"vision/*","method":"*"}]},{"key":"container.billing","renewalPeriod":10,"count":500,"dynamicThrottlingEnabled":false,"matchPatterns":[{"path":"billing/*","method":"*"}]},{"key":"default","renewalPeriod":1,"count":20,"dynamicThrottlingEnabled":true,"matchPatterns":[{"path":"*","method":"*"}]}]},"isMigrated":false,"privateEndpointConnections":[],"publicNetworkAccess":"Enabled","capabilities":[{"name":"DynamicThrottling"},{"name":"VirtualNetworks"},{"name":"NetworkSecurityPerimeter"},{"name":"Container","value":"ComputerVision.*,ComputerVision.VideoAnalytics"}],"endpoints":{"Computer + Vision":"https://eastus2euap.api.cognitive.microsoft.com/"},"provisioningState":"Succeeded"},"systemData":{"createdBy":"nikhilsaxena@microsoft.com","createdByType":"User","createdAt":"2022-11-14T08:20:21.0001746Z","lastModifiedBy":"nikhilsaxena@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-11-14T08:20:21.0001746Z"}}' headers: cache-control: - no-cache content-length: - - '1003' + - '1825' content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:04 GMT + - Mon, 14 Nov 2022 08:20:24 GMT + etag: + - '"0200cb4d-0000-3400-0000-6371fa460000"' expires: - '-1' pragma: - no-cache server: - - Microsoft-IIS/10.0 + - istio-envoy strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-aspnet-version: - - 4.0.30319 x-content-type-options: - nosniff - x-ms-keyvault-service-version: - - 1.5.564.0 + x-envoy-upstream-service-time: + - '645' x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - keyvault create - Connection: - - keep-alive - ParameterSetName: - - --name -l --resource-group - User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2021-06-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.KeyVault/vaults","location":"eastus2euap","tags":{},"systemData":{"createdBy":"nikhilsaxena@microsoft.com","createdByType":"User","createdAt":"2022-11-14T06:48:00.05Z","lastModifiedBy":"nikhilsaxena@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-11-14T06:48:00.05Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"d50cfdce-f74f-4b75-9ea4-dd65c07770fd","permissions":{"keys":["all"],"secrets":["all"],"certificates":["all"],"storage":["all"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"softDeleteRetentionInDays":90,"vaultUri":"https://kvnspclitest5.vault.azure.net/","provisioningState":"Succeeded","publicNetworkAccess":"Enabled"}}' - headers: - cache-control: - - no-cache - content-length: - - '999' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 14 Nov 2022 06:48:37 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-aspnet-version: - - 4.0.30319 - x-content-type-options: - - nosniff - x-ms-keyvault-service-version: - - 1.5.564.0 + - '1198' status: - code: 200 - message: OK + code: 201 + message: Created - request: body: null headers: @@ -368,7 +219,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:47:27Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:19:56Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -377,7 +228,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:36 GMT + - Mon, 14 Nov 2022 08:20:24 GMT expires: - '-1' pragma: @@ -393,7 +244,7 @@ interactions: message: OK - request: body: '{"location": "eastus2euap", "name": "TestNspAssociation", "properties": - {"accessMode": "Learning", "privateLinkResource": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"}, + {"accessMode": "Learning", "privateLinkResource": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"}, "profile": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"}}}' headers: Accept: @@ -405,7 +256,7 @@ interactions: Connection: - keep-alive Content-Length: - - '510' + - '521' Content-Type: - application/json ParameterSetName: @@ -417,35 +268,33 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Learning","provisioningState":"Accepted","hasProvisioningIssues":"no"}}' + string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Learning","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' headers: cache-control: - no-cache content-length: - - '836' + - '848' content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:42 GMT + - Mon, 14 Nov 2022 08:20:29 GMT expires: - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview pragma: - no-cache server: - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - '1198' status: - code: 200 - message: OK + code: 201 + message: Created - request: body: null headers: @@ -465,16 +314,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Learning","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' + string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Learning","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' headers: cache-control: - no-cache content-length: - - '837' + - '848' content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:45 GMT + - Mon, 14 Nov 2022 08:20:30 GMT expires: - '-1' pragma: @@ -512,7 +361,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:47:27Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:19:56Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -521,7 +370,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:45 GMT + - Mon, 14 Nov 2022 08:20:30 GMT expires: - '-1' pragma: @@ -555,16 +404,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Learning","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' + string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Learning","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' headers: cache-control: - no-cache content-length: - - '837' + - '848' content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:47 GMT + - Mon, 14 Nov 2022 08:20:32 GMT expires: - '-1' pragma: @@ -584,7 +433,7 @@ interactions: message: OK - request: body: '{"location": "eastus2euap", "name": "TestNspAssociation", "properties": - {"accessMode": "Enforced", "privateLinkResource": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"}, + {"accessMode": "Enforced", "privateLinkResource": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"}, "profile": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"}}}' headers: Accept: @@ -596,7 +445,7 @@ interactions: Connection: - keep-alive Content-Length: - - '510' + - '521' Content-Type: - application/json ParameterSetName: @@ -608,16 +457,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Enforced","provisioningState":"Accepted","hasProvisioningIssues":"no"}}' + string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Enforced","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' headers: cache-control: - no-cache content-length: - - '836' + - '848' content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:48 GMT + - Mon, 14 Nov 2022 08:20:34 GMT expires: - '-1' pragma: @@ -633,7 +482,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1195' status: code: 200 message: OK @@ -656,16 +505,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Enforced","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' + string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Enforced","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' headers: cache-control: - no-cache content-length: - - '837' + - '848' content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:50 GMT + - Mon, 14 Nov 2022 08:20:36 GMT expires: - '-1' pragma: @@ -702,16 +551,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations?api-version=2021-02-01-preview response: body: - string: '{"nextLink":"","value":[{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Enforced","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}]}' + string: '{"nextLink":"","value":[{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Enforced","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}]}' headers: cache-control: - no-cache content-length: - - '863' + - '874' content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:53 GMT + - Mon, 14 Nov 2022 08:20:47 GMT expires: - '-1' pragma: @@ -755,7 +604,7 @@ interactions: cache-control: - no-cache date: - - Mon, 14 Nov 2022 06:48:56 GMT + - Mon, 14 Nov 2022 08:20:52 GMT expires: - '-1' pragma: @@ -800,7 +649,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:57 GMT + - Mon, 14 Nov 2022 08:20:53 GMT expires: - '-1' pragma: @@ -822,17 +671,17 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - keyvault delete + - cognitiveservices account delete Connection: - keep-alive Content-Length: - '0' ParameterSetName: - - --name --resource-group --no-wait + - --name --resource-group User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.38.0 azsdk-python-mgmt-cognitiveservices/13.2.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2021-06-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5?api-version=2022-03-01 response: body: string: '' @@ -842,23 +691,21 @@ interactions: content-length: - '0' date: - - Mon, 14 Nov 2022 06:49:10 GMT + - Mon, 14 Nov 2022 08:21:11 GMT expires: - '-1' pragma: - no-cache server: - - Microsoft-IIS/10.0 + - istio-envoy strict-transport-security: - max-age=31536000; includeSubDomains - x-aspnet-version: - - 4.0.30319 x-content-type-options: - nosniff - x-ms-keyvault-service-version: - - 1.5.564.0 + x-envoy-upstream-service-time: + - '82' x-ms-ratelimit-remaining-subscription-deletes: - - '14999' + - '14998' status: code: 200 message: OK @@ -870,96 +717,40 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - keyvault purge - Connection: - - keep-alive - ParameterSetName: - - --name -l --no-wait - User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/deletedVaults/kvnspclitest5?api-version=2021-06-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/deletedVaults/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.KeyVault/deletedVaults","properties":{"vaultId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5","location":"eastus2euap","tags":{},"deletionDate":"2022-11-14T06:49:00Z","scheduledPurgeDate":"2023-02-12T06:49:00Z"}}' - headers: - cache-control: - - no-cache - content-length: - - '497' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 14 Nov 2022 06:49:12 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-IIS/10.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-aspnet-version: - - 4.0.30319 - x-content-type-options: - - nosniff - x-ms-keyvault-service-version: - - 1.5.564.0 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - keyvault purge + - cognitiveservices account purge Connection: - keep-alive Content-Length: - '0' ParameterSetName: - - --name -l --no-wait + - --name -l -g User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/deletedVaults/kvnspclitest5/purge?api-version=2021-06-01-preview + - AZURECLI/2.38.0 azsdk-python-mgmt-cognitiveservices/13.2.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CognitiveServices/locations/eastus2euap/resourceGroups/test_nsp_association_crud000001/deletedAccounts/kvnspclitest5?api-version=2022-03-01 response: body: string: '' headers: cache-control: - no-cache - content-length: - - '0' date: - - Mon, 14 Nov 2022 06:49:13 GMT + - Mon, 14 Nov 2022 08:21:12 GMT expires: - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/operationResults/VVR8MDYzODA0MDA1MzU0Nzg0NDIxMXw3NjlGOTI4Q0FFMzQ0NTU0OEZERTIyQUFFMEI2NDY5OA?api-version=2021-06-01-preview pragma: - no-cache server: - - Microsoft-IIS/10.0 + - istio-envoy strict-transport-security: - max-age=31536000; includeSubDomains - x-aspnet-version: - - 4.0.30319 x-content-type-options: - nosniff - x-ms-keyvault-service-version: - - 1.5.564.0 - x-ms-ratelimit-remaining-subscription-writes: - - '1199' + x-envoy-upstream-service-time: + - '57' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' status: - code: 202 - message: Accepted + code: 204 + message: No Content version: 1 diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml index b8f9375af9d..93385b8c71a 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml @@ -22,7 +22,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"03dccef2-7cd5-4b3a-b38a-3302ee428511","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"5fd14254-6430-4a03-a322-bb675d295b32","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:47:43 GMT + - Mon, 14 Nov 2022 08:16:57 GMT expires: - '-1' pragma: @@ -47,7 +47,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK @@ -70,7 +70,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"03dccef2-7cd5-4b3a-b38a-3302ee428511","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"5fd14254-6430-4a03-a322-bb675d295b32","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:47:46 GMT + - Mon, 14 Nov 2022 08:17:00 GMT expires: - '-1' pragma: @@ -116,7 +116,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters?api-version=2021-02-01-preview response: body: - string: '{"nextLink":"","value":[{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"03dccef2-7cd5-4b3a-b38a-3302ee428511","provisioningState":"Succeeded"}}]}' + string: '{"nextLink":"","value":[{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"5fd14254-6430-4a03-a322-bb675d295b32","provisioningState":"Succeeded"}}]}' headers: cache-control: - no-cache @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:47:48 GMT + - Mon, 14 Nov 2022 08:17:01 GMT expires: - '-1' pragma: @@ -171,7 +171,7 @@ interactions: content-length: - '0' date: - - Mon, 14 Nov 2022 06:47:56 GMT + - Mon, 14 Nov 2022 08:17:06 GMT expires: - '-1' pragma: @@ -215,7 +215,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:47:58 GMT + - Mon, 14 Nov 2022 08:17:07 GMT expires: - '-1' pragma: @@ -261,7 +261,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:47:59 GMT + - Mon, 14 Nov 2022 08:17:07 GMT expires: - '-1' pragma: diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml index aeca60adb72..3f68bf12726 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml @@ -22,7 +22,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"6affe8f1-e991-4000-8faa-d6a1b5ac48b5","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"f2dc3081-bff4-4c8f-9386-3e3c0fec66fe","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:31 GMT + - Mon, 14 Nov 2022 08:17:32 GMT expires: - '-1' pragma: @@ -47,7 +47,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK @@ -70,7 +70,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_profile_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001","name":"test_nsp_profile_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T06:48:17Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001","name":"test_nsp_profile_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:17:22Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:31 GMT + - Mon, 14 Nov 2022 08:17:32 GMT expires: - '-1' pragma: @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:34 GMT + - Mon, 14 Nov 2022 08:17:35 GMT expires: - '-1' pragma: @@ -141,7 +141,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -173,7 +173,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:35 GMT + - Mon, 14 Nov 2022 08:17:36 GMT expires: - '-1' pragma: @@ -219,7 +219,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 06:48:37 GMT + - Mon, 14 Nov 2022 08:17:38 GMT expires: - '-1' pragma: @@ -265,7 +265,7 @@ interactions: content-length: - '0' date: - - Mon, 14 Nov 2022 06:48:41 GMT + - Mon, 14 Nov 2022 08:17:40 GMT expires: - '-1' pragma: diff --git a/src/nsp/azext_nsp/tests/latest/test_nsp.py b/src/nsp/azext_nsp/tests/latest/test_nsp.py index 6bf82a0df65..5b4f023f9cf 100644 --- a/src/nsp/azext_nsp/tests/latest/test_nsp.py +++ b/src/nsp/azext_nsp/tests/latest/test_nsp.py @@ -116,10 +116,10 @@ def test_nsp_association_crud(self, resource_group): self.cmd('network perimeter create --name {nsp_name} -l eastus2euap --resource-group {rg}') self.cmd('network perimeter profile create --name {profile_name} --perimeter-name {nsp_name} --resource-group {rg}') - self.cmd('keyvault create --name {resource_name} -l eastus2euap --resource-group {rg}') + self.cmd('cognitiveservices account create --name {resource_name} --resource-group {rg} --kind ComputerVision --sku S1 --location eastus2euap --yes') self.cmd('network perimeter association create --name {association_name} --perimeter-name {nsp_name} --resource-group {rg} --access-mode Learning ' - '--private-link-resource id="/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.KeyVault/vaults/{resource_name}" ' + '--private-link-resource id="/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.CognitiveServices/accounts/{resource_name}" ' '--profile id="/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Network/networkSecurityPerimeters/{nsp_name}/profiles/{profile_name}"') self.cmd('network perimeter association show --name {association_name} --perimeter-name {nsp_name} --resource-group {rg}', checks=[ @@ -127,7 +127,7 @@ def test_nsp_association_crud(self, resource_group): ]) self.cmd('network perimeter association update --name {association_name} --perimeter-name {nsp_name} --resource-group {rg} --access-mode Enforced ' - '--private-link-resource id="/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.KeyVault/vaults/{resource_name}" ' + '--private-link-resource id="/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.CognitiveServices/accounts/{resource_name}" ' '--profile id="/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Network/networkSecurityPerimeters/{nsp_name}/profiles/{profile_name}"') self.cmd('network perimeter association show --name {association_name} --perimeter-name {nsp_name} --resource-group {rg}', checks=[ @@ -140,5 +140,5 @@ def test_nsp_association_crud(self, resource_group): self.cmd('network perimeter association show --name {association_name} --perimeter-name {nsp_name} --resource-group {rg}', expect_failure=True) - self.cmd('keyvault delete --name {resource_name} --resource-group {rg} --no-wait') - self.cmd('keyvault purge --name {resource_name} -l eastus2euap --no-wait') + self.cmd('cognitiveservices account delete --name {resource_name} --resource-group {rg}') + self.cmd('cognitiveservices account purge --name {resource_name} -l eastus2euap -g {rg}') From 13210db57f54f0e43593f1113a73b0758f32ea15 Mon Sep 17 00:00:00 2001 From: Nikhil Saxena Date: Mon, 14 Nov 2022 14:56:13 +0530 Subject: [PATCH 06/12] removed association recording --- .../recordings/test_nsp_association_crud.yaml | 756 ------------------ 1 file changed, 756 deletions(-) delete mode 100644 src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml deleted file mode 100644 index 1a9b69be894..00000000000 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml +++ /dev/null @@ -1,756 +0,0 @@ -interactions: -- request: - body: '{"location": "eastus2euap", "name": "TestNetworkSecurityPerimeter"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - network perimeter create - Connection: - - keep-alive - Content-Length: - - '67' - Content-Type: - - application/json - ParameterSetName: - - --name -l --resource-group - User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview - response: - body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"07cd4ae2-cca4-4fc5-98f6-349a43fda992","provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '428' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 14 Nov 2022 08:20:08 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - network perimeter profile create - Connection: - - keep-alive - ParameterSetName: - - --name --perimeter-name --resource-group - User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2021-04-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:19:56Z"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '345' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 14 Nov 2022 08:20:08 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": "eastus2euap", "name": "TestNspProfile"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - network perimeter profile create - Connection: - - keep-alive - Content-Length: - - '53' - Content-Type: - - application/json - ParameterSetName: - - --name --perimeter-name --resource-group - User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile?api-version=2021-02-01-preview - response: - body: - string: '{"name":"TestNspProfile","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile","type":"Microsoft.Network/networkSecurityPerimeters/profiles","properties":{"accessRulesVersion":"0","diagnosticSettingsVersion":"0"},"location":"eastus2euap"}' - headers: - cache-control: - - no-cache - content-length: - - '397' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 14 Nov 2022 08:20:10 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 200 - message: OK -- request: - body: '{"kind": "ComputerVision", "sku": {"name": "S1"}, "location": "eastus2euap", - "properties": {}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - cognitiveservices account create - Connection: - - keep-alive - Content-Length: - - '94' - Content-Type: - - application/json - ParameterSetName: - - --name --resource-group --kind --sku --location --yes - User-Agent: - - AZURECLI/2.38.0 azsdk-python-mgmt-cognitiveservices/13.2.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5?api-version=2022-03-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.CognitiveServices/accounts","etag":"\"0200cb4d-0000-3400-0000-6371fa460000\"","location":"eastus2euap","sku":{"name":"S1"},"kind":"ComputerVision","properties":{"endpoint":"https://eastus2euap.api.cognitive.microsoft.com/","internalId":"74cb732c62844540bb0b51872dc9a527","dateCreated":"2022-11-14T08:20:21.9307944Z","callRateLimit":{"rules":[{"key":"vision.recognizeText","renewalPeriod":1,"count":30,"dynamicThrottlingEnabled":true,"matchPatterns":[{"path":"vision/recognizeText","method":"POST"},{"path":"vision/textOperations/*","method":"GET"},{"path":"vision/read/*","method":"*"}]},{"key":"vision","renewalPeriod":1,"count":15,"dynamicThrottlingEnabled":true,"matchPatterns":[{"path":"vision/*","method":"*"}]},{"key":"container.billing","renewalPeriod":10,"count":500,"dynamicThrottlingEnabled":false,"matchPatterns":[{"path":"billing/*","method":"*"}]},{"key":"default","renewalPeriod":1,"count":20,"dynamicThrottlingEnabled":true,"matchPatterns":[{"path":"*","method":"*"}]}]},"isMigrated":false,"privateEndpointConnections":[],"publicNetworkAccess":"Enabled","capabilities":[{"name":"DynamicThrottling"},{"name":"VirtualNetworks"},{"name":"NetworkSecurityPerimeter"},{"name":"Container","value":"ComputerVision.*,ComputerVision.VideoAnalytics"}],"endpoints":{"Computer - Vision":"https://eastus2euap.api.cognitive.microsoft.com/"},"provisioningState":"Succeeded"},"systemData":{"createdBy":"nikhilsaxena@microsoft.com","createdByType":"User","createdAt":"2022-11-14T08:20:21.0001746Z","lastModifiedBy":"nikhilsaxena@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-11-14T08:20:21.0001746Z"}}' - headers: - cache-control: - - no-cache - content-length: - - '1825' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 14 Nov 2022 08:20:24 GMT - etag: - - '"0200cb4d-0000-3400-0000-6371fa460000"' - expires: - - '-1' - pragma: - - no-cache - server: - - istio-envoy - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '645' - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - network perimeter association create - Connection: - - keep-alive - ParameterSetName: - - --name --perimeter-name --resource-group --access-mode --private-link-resource - --profile - User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2021-04-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:19:56Z"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '345' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 14 Nov 2022 08:20:24 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": "eastus2euap", "name": "TestNspAssociation", "properties": - {"accessMode": "Learning", "privateLinkResource": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"}, - "profile": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"}}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - network perimeter association create - Connection: - - keep-alive - Content-Length: - - '521' - Content-Type: - - application/json - ParameterSetName: - - --name --perimeter-name --resource-group --access-mode --private-link-resource - --profile - User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview - response: - body: - string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Learning","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' - headers: - cache-control: - - no-cache - content-length: - - '848' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 14 Nov 2022 08:20:29 GMT - expires: - - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - network perimeter association show - Connection: - - keep-alive - ParameterSetName: - - --name --perimeter-name --resource-group - User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview - response: - body: - string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Learning","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' - headers: - cache-control: - - no-cache - content-length: - - '848' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 14 Nov 2022 08:20:30 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - 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 perimeter association update - Connection: - - keep-alive - ParameterSetName: - - --name --perimeter-name --resource-group --access-mode --private-link-resource - --profile - User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2021-04-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:19:56Z"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '345' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 14 Nov 2022 08:20:30 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 perimeter association update - Connection: - - keep-alive - ParameterSetName: - - --name --perimeter-name --resource-group --access-mode --private-link-resource - --profile - User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview - response: - body: - string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Learning","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' - headers: - cache-control: - - no-cache - content-length: - - '848' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 14 Nov 2022 08:20:32 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{"location": "eastus2euap", "name": "TestNspAssociation", "properties": - {"accessMode": "Enforced", "privateLinkResource": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"}, - "profile": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"}}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - network perimeter association update - Connection: - - keep-alive - Content-Length: - - '521' - Content-Type: - - application/json - ParameterSetName: - - --name --perimeter-name --resource-group --access-mode --private-link-resource - --profile - User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview - response: - body: - string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Enforced","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' - headers: - cache-control: - - no-cache - content-length: - - '848' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 14 Nov 2022 08:20:34 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1195' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - network perimeter association show - Connection: - - keep-alive - ParameterSetName: - - --name --perimeter-name --resource-group - User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview - response: - body: - string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Enforced","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' - headers: - cache-control: - - no-cache - content-length: - - '848' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 14 Nov 2022 08:20:36 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - 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 perimeter association list - Connection: - - keep-alive - ParameterSetName: - - --perimeter-name --resource-group - User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations?api-version=2021-02-01-preview - response: - body: - string: '{"nextLink":"","value":[{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Enforced","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}]}' - headers: - cache-control: - - no-cache - content-length: - - '874' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 14 Nov 2022 08:20:47 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - network perimeter association delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - --name --perimeter-name --resource-group --yes - User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview - response: - body: - string: '' - headers: - cache-control: - - no-cache - date: - - Mon, 14 Nov 2022 08:20:52 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - network perimeter association show - Connection: - - keep-alive - ParameterSetName: - - --name --perimeter-name --resource-group - User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview - response: - body: - string: '{"error":{"message":"Resource [/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation] - does not exist or has been deleted","code":"NotFound"}}' - headers: - cache-control: - - no-cache - content-length: - - '309' - content-type: - - application/json; charset=utf-8 - date: - - Mon, 14 Nov 2022 08:20:53 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Kestrel - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 404 - message: Not Found -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - cognitiveservices account delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - --name --resource-group - User-Agent: - - AZURECLI/2.38.0 azsdk-python-mgmt-cognitiveservices/13.2.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5?api-version=2022-03-01 - response: - body: - string: '' - headers: - cache-control: - - no-cache - content-length: - - '0' - date: - - Mon, 14 Nov 2022 08:21:11 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - istio-envoy - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '82' - x-ms-ratelimit-remaining-subscription-deletes: - - '14998' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - cognitiveservices account purge - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - --name -l -g - User-Agent: - - AZURECLI/2.38.0 azsdk-python-mgmt-cognitiveservices/13.2.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CognitiveServices/locations/eastus2euap/resourceGroups/test_nsp_association_crud000001/deletedAccounts/kvnspclitest5?api-version=2022-03-01 - response: - body: - string: '' - headers: - cache-control: - - no-cache - date: - - Mon, 14 Nov 2022 08:21:12 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - istio-envoy - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '57' - x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - status: - code: 204 - message: No Content -version: 1 From c286a856deee95e9bc2bffe7ed0686309b7ce7e7 Mon Sep 17 00:00:00 2001 From: Nikhil Saxena Date: Mon, 14 Nov 2022 15:08:53 +0530 Subject: [PATCH 07/12] re-record tests --- .../test_create_storage_account.yaml | 44 - .../recordings/test_nsp_accessrule_crud.yaml | 38 +- .../test_nsp_accessrule_inbound.yaml | 44 +- .../recordings/test_nsp_association_crud.yaml | 756 ++++++++++++++++++ .../latest/recordings/test_nsp_crud.yaml | 20 +- .../recordings/test_nsp_profile_crud.yaml | 18 +- 6 files changed, 816 insertions(+), 104 deletions(-) delete mode 100644 src/nsp/azext_nsp/tests/latest/recordings/test_create_storage_account.yaml create mode 100644 src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_create_storage_account.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_create_storage_account.yaml deleted file mode 100644 index 80b1b5d260e..00000000000 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_create_storage_account.yaml +++ /dev/null @@ -1,44 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - group show - Connection: - - keep-alive - ParameterSetName: - - -n - User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001?api-version=2021-04-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2022-10-16T20:36:06Z"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '310' - content-type: - - application/json; charset=utf-8 - date: - - Sun, 16 Oct 2022 20:36: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 -version: 1 diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml index 44ec6fff811..54750bb4cb6 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml @@ -22,7 +22,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"64c4b6e3-9835-41e5-a048-24ec67f52ffd","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"9fdb45ae-74b4-433e-8066-32d71c0a11f0","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:16:57 GMT + - Mon, 14 Nov 2022 09:35:56 GMT expires: - '-1' pragma: @@ -47,7 +47,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -70,7 +70,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:16:45Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:35:44Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:16:58 GMT + - Mon, 14 Nov 2022 09:35:57 GMT expires: - '-1' pragma: @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:00 GMT + - Mon, 14 Nov 2022 09:36:00 GMT expires: - '-1' pragma: @@ -164,7 +164,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:16:45Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:35:44Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -173,7 +173,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:01 GMT + - Mon, 14 Nov 2022 09:36:00 GMT expires: - '-1' pragma: @@ -220,7 +220,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:02 GMT + - Mon, 14 Nov 2022 09:36:03 GMT expires: - '-1' pragma: @@ -236,7 +236,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -268,7 +268,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:03 GMT + - Mon, 14 Nov 2022 09:36:04 GMT expires: - '-1' pragma: @@ -305,7 +305,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:16:45Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:35:44Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -314,7 +314,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:03 GMT + - Mon, 14 Nov 2022 09:36:05 GMT expires: - '-1' pragma: @@ -356,7 +356,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:05 GMT + - Mon, 14 Nov 2022 09:36:06 GMT expires: - '-1' pragma: @@ -408,7 +408,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:05 GMT + - Mon, 14 Nov 2022 09:36:08 GMT expires: - '-1' pragma: @@ -424,7 +424,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1198' status: code: 200 message: OK @@ -456,7 +456,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:07 GMT + - Mon, 14 Nov 2022 09:36:11 GMT expires: - '-1' pragma: @@ -502,7 +502,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:11 GMT + - Mon, 14 Nov 2022 09:36:13 GMT expires: - '-1' pragma: @@ -548,7 +548,7 @@ interactions: content-length: - '0' date: - - Mon, 14 Nov 2022 08:17:14 GMT + - Mon, 14 Nov 2022 09:36:16 GMT expires: - '-1' pragma: diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml index ccd5ee819c8..39f414aa92b 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml @@ -22,7 +22,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"e40822c0-9626-4b07-8d08-16dfb8d808ee","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"e1209602-e493-4114-99f8-f4f3b673bcf7","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:16:52 GMT + - Mon, 14 Nov 2022 09:35:57 GMT expires: - '-1' pragma: @@ -47,7 +47,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -70,7 +70,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:16:45Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:35:44Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:16:53 GMT + - Mon, 14 Nov 2022 09:35:57 GMT expires: - '-1' pragma: @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:16:56 GMT + - Mon, 14 Nov 2022 09:36:00 GMT expires: - '-1' pragma: @@ -141,7 +141,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -164,7 +164,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:16:45Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:35:44Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -173,7 +173,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:16:56 GMT + - Mon, 14 Nov 2022 09:36:00 GMT expires: - '-1' pragma: @@ -220,7 +220,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:16:59 GMT + - Mon, 14 Nov 2022 09:36:03 GMT expires: - '-1' pragma: @@ -236,7 +236,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -259,7 +259,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:16:45Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:35:44Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -268,7 +268,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:00 GMT + - Mon, 14 Nov 2022 09:36:04 GMT expires: - '-1' pragma: @@ -315,7 +315,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:03 GMT + - Mon, 14 Nov 2022 09:36:05 GMT expires: - '-1' pragma: @@ -331,7 +331,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1198' status: code: 200 message: OK @@ -358,7 +358,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule?api-version=2021-02-01-preview response: body: - string: '{"name":"nsp_for_rule","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"e49225cd-7abe-49f9-841d-131f25e6b9c3","provisioningState":"Succeeded"}}' + string: '{"name":"nsp_for_rule","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"03eb9d2f-4f63-433e-868c-02e5119da515","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -367,7 +367,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:06 GMT + - Mon, 14 Nov 2022 09:36:10 GMT expires: - '-1' pragma: @@ -383,7 +383,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1198' status: code: 200 message: OK @@ -406,7 +406,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:16:45Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:35:44Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -415,7 +415,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:06 GMT + - Mon, 14 Nov 2022 09:36:10 GMT expires: - '-1' pragma: @@ -453,7 +453,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_nsp?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNspAccessRule_nsp","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_nsp","type":"Microsoft.Network/networkSecurityPerimeters/profiles/accessRules","properties":{"provisioningState":"Succeeded","direction":"Inbound","addressPrefixes":[],"fullyQualifiedDomainNames":[],"subscriptions":[],"networkSecurityPerimeters":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","perimeterGuid":"e49225cd-7abe-49f9-841d-131f25e6b9c3","location":"eastus2euap"}]}}' + string: '{"name":"TestNspAccessRule_nsp","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_nsp","type":"Microsoft.Network/networkSecurityPerimeters/profiles/accessRules","properties":{"provisioningState":"Succeeded","direction":"Inbound","addressPrefixes":[],"fullyQualifiedDomainNames":[],"subscriptions":[],"networkSecurityPerimeters":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","perimeterGuid":"03eb9d2f-4f63-433e-868c-02e5119da515","location":"eastus2euap"}]}}' headers: cache-control: - no-cache @@ -462,7 +462,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:08 GMT + - Mon, 14 Nov 2022 09:36:13 GMT expires: - '-1' pragma: diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml new file mode 100644 index 00000000000..4b984b570a9 --- /dev/null +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml @@ -0,0 +1,756 @@ +interactions: +- request: + body: '{"location": "eastus2euap", "name": "TestNetworkSecurityPerimeter"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter create + Connection: + - keep-alive + Content-Length: + - '67' + Content-Type: + - application/json + ParameterSetName: + - --name -l --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"39a19411-1dd3-46b2-8858-30db5e0ccb77","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '428' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 14 Nov 2022 09:35:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile create + Connection: + - keep-alive + ParameterSetName: + - --name --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:35:44Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '345' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 14 Nov 2022 09:35:58 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": "eastus2euap", "name": "TestNspProfile"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile create + Connection: + - keep-alive + Content-Length: + - '53' + Content-Type: + - application/json + ParameterSetName: + - --name --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspProfile","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile","type":"Microsoft.Network/networkSecurityPerimeters/profiles","properties":{"accessRulesVersion":"0","diagnosticSettingsVersion":"0"},"location":"eastus2euap"}' + headers: + cache-control: + - no-cache + content-length: + - '397' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 14 Nov 2022 09:36:00 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"kind": "ComputerVision", "sku": {"name": "S1"}, "location": "eastus2euap", + "properties": {}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - cognitiveservices account create + Connection: + - keep-alive + Content-Length: + - '94' + Content-Type: + - application/json + ParameterSetName: + - --name --resource-group --kind --sku --location --yes + User-Agent: + - AZURECLI/2.38.0 azsdk-python-mgmt-cognitiveservices/13.2.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5?api-version=2022-03-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.CognitiveServices/accounts","etag":"\"02004e51-0000-3400-0000-63720c070000\"","location":"eastus2euap","sku":{"name":"S1"},"kind":"ComputerVision","properties":{"endpoint":"https://eastus2euap.api.cognitive.microsoft.com/","internalId":"038d1bd0f1ea4f2ba56a20b1872f15d8","dateCreated":"2022-11-14T09:36:07.4671216Z","callRateLimit":{"rules":[{"key":"vision.recognizeText","renewalPeriod":1,"count":30,"dynamicThrottlingEnabled":true,"matchPatterns":[{"path":"vision/recognizeText","method":"POST"},{"path":"vision/textOperations/*","method":"GET"},{"path":"vision/read/*","method":"*"}]},{"key":"vision","renewalPeriod":1,"count":15,"dynamicThrottlingEnabled":true,"matchPatterns":[{"path":"vision/*","method":"*"}]},{"key":"container.billing","renewalPeriod":10,"count":500,"dynamicThrottlingEnabled":false,"matchPatterns":[{"path":"billing/*","method":"*"}]},{"key":"default","renewalPeriod":1,"count":20,"dynamicThrottlingEnabled":true,"matchPatterns":[{"path":"*","method":"*"}]}]},"isMigrated":false,"privateEndpointConnections":[],"publicNetworkAccess":"Enabled","capabilities":[{"name":"DynamicThrottling"},{"name":"VirtualNetworks"},{"name":"NetworkSecurityPerimeter"},{"name":"Container","value":"ComputerVision.*,ComputerVision.VideoAnalytics"}],"endpoints":{"Computer + Vision":"https://eastus2euap.api.cognitive.microsoft.com/"},"provisioningState":"Succeeded"},"systemData":{"createdBy":"nikhilsaxena@microsoft.com","createdByType":"User","createdAt":"2022-11-14T09:36:06.5036617Z","lastModifiedBy":"nikhilsaxena@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-11-14T09:36:06.5036617Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '1825' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 14 Nov 2022 09:36:09 GMT + etag: + - '"02004e51-0000-3400-0000-63720c070000"' + expires: + - '-1' + pragma: + - no-cache + server: + - istio-envoy + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '521' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter association create + Connection: + - keep-alive + ParameterSetName: + - --name --perimeter-name --resource-group --access-mode --private-link-resource + --profile + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:35:44Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '345' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 14 Nov 2022 09:36:09 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": "eastus2euap", "name": "TestNspAssociation", "properties": + {"accessMode": "Learning", "privateLinkResource": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"}, + "profile": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter association create + Connection: + - keep-alive + Content-Length: + - '521' + Content-Type: + - application/json + ParameterSetName: + - --name --perimeter-name --resource-group --access-mode --private-link-resource + --profile + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Learning","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' + headers: + cache-control: + - no-cache + content-length: + - '848' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 14 Nov 2022 09:36:15 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter association show + Connection: + - keep-alive + ParameterSetName: + - --name --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Learning","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' + headers: + cache-control: + - no-cache + content-length: + - '848' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 14 Nov 2022 09:36:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + 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 perimeter association update + Connection: + - keep-alive + ParameterSetName: + - --name --perimeter-name --resource-group --access-mode --private-link-resource + --profile + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:35:44Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '345' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 14 Nov 2022 09:36:16 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 perimeter association update + Connection: + - keep-alive + ParameterSetName: + - --name --perimeter-name --resource-group --access-mode --private-link-resource + --profile + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Learning","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' + headers: + cache-control: + - no-cache + content-length: + - '848' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 14 Nov 2022 09:36:17 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2euap", "name": "TestNspAssociation", "properties": + {"accessMode": "Enforced", "privateLinkResource": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"}, + "profile": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter association update + Connection: + - keep-alive + Content-Length: + - '521' + Content-Type: + - application/json + ParameterSetName: + - --name --perimeter-name --resource-group --access-mode --private-link-resource + --profile + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Enforced","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' + headers: + cache-control: + - no-cache + content-length: + - '848' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 14 Nov 2022 09:36:21 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter association show + Connection: + - keep-alive + ParameterSetName: + - --name --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Enforced","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' + headers: + cache-control: + - no-cache + content-length: + - '848' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 14 Nov 2022 09:36:23 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + 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 perimeter association list + Connection: + - keep-alive + ParameterSetName: + - --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations?api-version=2021-02-01-preview + response: + body: + string: '{"nextLink":"","value":[{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Enforced","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '874' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 14 Nov 2022 09:36:25 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter association delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --name --perimeter-name --resource-group --yes + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + date: + - Mon, 14 Nov 2022 09:36:26 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter association show + Connection: + - keep-alive + ParameterSetName: + - --name --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview + response: + body: + string: '{"error":{"message":"Resource [/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation] + does not exist or has been deleted","code":"NotFound"}}' + headers: + cache-control: + - no-cache + content-length: + - '309' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 14 Nov 2022 09:36:31 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - cognitiveservices account delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --name --resource-group + User-Agent: + - AZURECLI/2.38.0 azsdk-python-mgmt-cognitiveservices/13.2.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5?api-version=2022-03-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 14 Nov 2022 09:36:43 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - istio-envoy + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '93' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - cognitiveservices account purge + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --name -l -g + User-Agent: + - AZURECLI/2.38.0 azsdk-python-mgmt-cognitiveservices/13.2.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CognitiveServices/locations/eastus2euap/resourceGroups/test_nsp_association_crud000001/deletedAccounts/kvnspclitest5?api-version=2022-03-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + date: + - Mon, 14 Nov 2022 09:36:45 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - istio-envoy + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '78' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 204 + message: No Content +version: 1 diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml index 93385b8c71a..58b1e861c16 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml @@ -22,7 +22,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"5fd14254-6430-4a03-a322-bb675d295b32","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"aa3e189d-abd2-4e23-a735-d08e66c9937b","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:16:57 GMT + - Mon, 14 Nov 2022 09:35:57 GMT expires: - '-1' pragma: @@ -47,7 +47,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -70,7 +70,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"5fd14254-6430-4a03-a322-bb675d295b32","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"aa3e189d-abd2-4e23-a735-d08e66c9937b","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:00 GMT + - Mon, 14 Nov 2022 09:35:58 GMT expires: - '-1' pragma: @@ -116,7 +116,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters?api-version=2021-02-01-preview response: body: - string: '{"nextLink":"","value":[{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"5fd14254-6430-4a03-a322-bb675d295b32","provisioningState":"Succeeded"}}]}' + string: '{"nextLink":"","value":[{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"aa3e189d-abd2-4e23-a735-d08e66c9937b","provisioningState":"Succeeded"}}]}' headers: cache-control: - no-cache @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:01 GMT + - Mon, 14 Nov 2022 09:36:00 GMT expires: - '-1' pragma: @@ -171,7 +171,7 @@ interactions: content-length: - '0' date: - - Mon, 14 Nov 2022 08:17:06 GMT + - Mon, 14 Nov 2022 09:36:07 GMT expires: - '-1' pragma: @@ -215,7 +215,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:07 GMT + - Mon, 14 Nov 2022 09:36:08 GMT expires: - '-1' pragma: @@ -261,7 +261,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:07 GMT + - Mon, 14 Nov 2022 09:36:09 GMT expires: - '-1' pragma: diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml index 3f68bf12726..1d1a44f980c 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml @@ -22,7 +22,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"f2dc3081-bff4-4c8f-9386-3e3c0fec66fe","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"d432e30c-457d-4363-8d53-34448e042224","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:32 GMT + - Mon, 14 Nov 2022 09:36:40 GMT expires: - '-1' pragma: @@ -47,7 +47,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -70,7 +70,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_profile_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001","name":"test_nsp_profile_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T08:17:22Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001","name":"test_nsp_profile_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:36:24Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:32 GMT + - Mon, 14 Nov 2022 09:36:40 GMT expires: - '-1' pragma: @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:35 GMT + - Mon, 14 Nov 2022 09:36:46 GMT expires: - '-1' pragma: @@ -173,7 +173,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:36 GMT + - Mon, 14 Nov 2022 09:36:51 GMT expires: - '-1' pragma: @@ -219,7 +219,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 08:17:38 GMT + - Mon, 14 Nov 2022 09:36:55 GMT expires: - '-1' pragma: @@ -265,7 +265,7 @@ interactions: content-length: - '0' date: - - Mon, 14 Nov 2022 08:17:40 GMT + - Mon, 14 Nov 2022 09:37:03 GMT expires: - '-1' pragma: From 05e820e097b37c006ee99d1a52f4f833a397cab6 Mon Sep 17 00:00:00 2001 From: Nikhil Saxena Date: Wed, 16 Nov 2022 14:42:17 +0530 Subject: [PATCH 08/12] update test runs --- .../recordings/test_nsp_accessrule_crud.yaml | 40 +- .../test_nsp_accessrule_inbound.yaml | 44 +-- .../recordings/test_nsp_association_crud.yaml | 371 ++++++++++++++---- .../latest/recordings/test_nsp_crud.yaml | 26 +- .../recordings/test_nsp_profile_crud.yaml | 20 +- src/nsp/azext_nsp/tests/latest/test_nsp.py | 10 +- 6 files changed, 360 insertions(+), 151 deletions(-) diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml index 54750bb4cb6..d6df0e48963 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml @@ -22,7 +22,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"9fdb45ae-74b4-433e-8066-32d71c0a11f0","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"6668839b-7231-41a6-8ef9-e5037c6264bb","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:35:56 GMT + - Wed, 16 Nov 2022 09:09:46 GMT expires: - '-1' pragma: @@ -47,7 +47,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' status: code: 200 message: OK @@ -70,7 +70,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:35:44Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:09:34Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:35:57 GMT + - Wed, 16 Nov 2022 09:09:47 GMT expires: - '-1' pragma: @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:00 GMT + - Wed, 16 Nov 2022 09:09:49 GMT expires: - '-1' pragma: @@ -141,7 +141,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK @@ -164,7 +164,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:35:44Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:09:34Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -173,7 +173,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:00 GMT + - Wed, 16 Nov 2022 09:09:49 GMT expires: - '-1' pragma: @@ -220,7 +220,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:03 GMT + - Wed, 16 Nov 2022 09:09:53 GMT expires: - '-1' pragma: @@ -236,7 +236,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' status: code: 200 message: OK @@ -268,7 +268,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:04 GMT + - Wed, 16 Nov 2022 09:09:55 GMT expires: - '-1' pragma: @@ -305,7 +305,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:35:44Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:09:34Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -314,7 +314,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:05 GMT + - Wed, 16 Nov 2022 09:09:55 GMT expires: - '-1' pragma: @@ -356,7 +356,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:06 GMT + - Wed, 16 Nov 2022 09:09:55 GMT expires: - '-1' pragma: @@ -408,7 +408,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:08 GMT + - Wed, 16 Nov 2022 09:09:56 GMT expires: - '-1' pragma: @@ -424,7 +424,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1197' status: code: 200 message: OK @@ -456,7 +456,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:11 GMT + - Wed, 16 Nov 2022 09:09:59 GMT expires: - '-1' pragma: @@ -502,7 +502,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:13 GMT + - Wed, 16 Nov 2022 09:09:59 GMT expires: - '-1' pragma: @@ -548,7 +548,7 @@ interactions: content-length: - '0' date: - - Mon, 14 Nov 2022 09:36:16 GMT + - Wed, 16 Nov 2022 09:10:03 GMT expires: - '-1' pragma: diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml index 39f414aa92b..6d0d0513dd5 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml @@ -22,7 +22,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"e1209602-e493-4114-99f8-f4f3b673bcf7","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"ac71cd9a-b602-45ee-94fc-442c96ef2fa8","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:35:57 GMT + - Wed, 16 Nov 2022 09:09:49 GMT expires: - '-1' pragma: @@ -70,7 +70,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:35:44Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:09:34Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:35:57 GMT + - Wed, 16 Nov 2022 09:09:49 GMT expires: - '-1' pragma: @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:00 GMT + - Wed, 16 Nov 2022 09:09:51 GMT expires: - '-1' pragma: @@ -141,7 +141,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' status: code: 200 message: OK @@ -164,7 +164,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:35:44Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:09:34Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -173,7 +173,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:00 GMT + - Wed, 16 Nov 2022 09:09:52 GMT expires: - '-1' pragma: @@ -220,7 +220,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:03 GMT + - Wed, 16 Nov 2022 09:09:54 GMT expires: - '-1' pragma: @@ -236,7 +236,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK @@ -259,7 +259,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:35:44Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:09:34Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -268,7 +268,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:04 GMT + - Wed, 16 Nov 2022 09:09:55 GMT expires: - '-1' pragma: @@ -315,7 +315,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:05 GMT + - Wed, 16 Nov 2022 09:09:58 GMT expires: - '-1' pragma: @@ -331,7 +331,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -358,7 +358,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule?api-version=2021-02-01-preview response: body: - string: '{"name":"nsp_for_rule","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"03eb9d2f-4f63-433e-868c-02e5119da515","provisioningState":"Succeeded"}}' + string: '{"name":"nsp_for_rule","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"8901c59b-5312-40d6-afff-d6aa562ae666","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -367,7 +367,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:10 GMT + - Wed, 16 Nov 2022 09:10:02 GMT expires: - '-1' pragma: @@ -383,7 +383,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1196' status: code: 200 message: OK @@ -406,7 +406,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:35:44Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:09:34Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -415,7 +415,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:10 GMT + - Wed, 16 Nov 2022 09:10:02 GMT expires: - '-1' pragma: @@ -453,7 +453,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_nsp?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNspAccessRule_nsp","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_nsp","type":"Microsoft.Network/networkSecurityPerimeters/profiles/accessRules","properties":{"provisioningState":"Succeeded","direction":"Inbound","addressPrefixes":[],"fullyQualifiedDomainNames":[],"subscriptions":[],"networkSecurityPerimeters":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","perimeterGuid":"03eb9d2f-4f63-433e-868c-02e5119da515","location":"eastus2euap"}]}}' + string: '{"name":"TestNspAccessRule_nsp","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_nsp","type":"Microsoft.Network/networkSecurityPerimeters/profiles/accessRules","properties":{"provisioningState":"Succeeded","direction":"Inbound","addressPrefixes":[],"fullyQualifiedDomainNames":[],"subscriptions":[],"networkSecurityPerimeters":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","perimeterGuid":"8901c59b-5312-40d6-afff-d6aa562ae666","location":"eastus2euap"}]}}' headers: cache-control: - no-cache @@ -462,7 +462,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:13 GMT + - Wed, 16 Nov 2022 09:10:03 GMT expires: - '-1' pragma: @@ -478,7 +478,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml index 4b984b570a9..be4710f3a9e 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml @@ -22,7 +22,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"39a19411-1dd3-46b2-8858-30db5e0ccb77","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"0a4b36ec-4f43-4ee9-96b1-8cfabdec0218","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:35:58 GMT + - Wed, 16 Nov 2022 09:09:48 GMT expires: - '-1' pragma: @@ -70,7 +70,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:35:44Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:09:34Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:35:58 GMT + - Wed, 16 Nov 2022 09:09:49 GMT expires: - '-1' pragma: @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:00 GMT + - Wed, 16 Nov 2022 09:09:51 GMT expires: - '-1' pragma: @@ -141,64 +141,213 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - keyvault create + Connection: + - keep-alive + ParameterSetName: + - --name -l --resource-group + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2021-06-01-preview + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.KeyVault/vaults/kvnspclitest5'' + under resource group ''test_nsp_association_crud000001'' was not found. For + more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '242' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Nov 2022 09:09:52 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - keyvault create + Connection: + - keep-alive + ParameterSetName: + - --name -l --resource-group + User-Agent: + - python/3.10.5 (Windows-10-10.0.22621-SP0) AZURECLI/2.38.0 + method: GET + uri: https://graph.microsoft.com/v1.0/me + response: + body: + string: '{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users/$entity","businessPhones":[],"displayName":"Nikhil + Saxena","givenName":"Nikhil","jobTitle":"SOFTWARE ENGINEER","mail":"nikhilsaxena@microsoft.com","mobilePhone":null,"officeLocation":"BENGALURU + LUXOR-MIRPL/Mobile","preferredLanguage":null,"surname":"Saxena","userPrincipalName":"nikhilsaxena@microsoft.com","id":"d50cfdce-f74f-4b75-9ea4-dd65c07770fd"}' + headers: + cache-control: + - no-cache + content-length: + - '419' + content-type: + - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 + date: + - Wed, 16 Nov 2022 09:09:52 GMT + odata-version: + - '4.0' + request-id: + - 9a2abb64-cfa0-450e-a4e7-90fe34af997d + strict-transport-security: + - max-age=31536000 + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-ms-ags-diagnostic: + - '{"ServerInfo":{"DataCenter":"South India","Slice":"E","Ring":"2","ScaleUnit":"002","RoleInstance":"MA1PEPF00001470"}}' + x-ms-resource-unit: + - '1' status: code: 200 message: OK - request: - body: '{"kind": "ComputerVision", "sku": {"name": "S1"}, "location": "eastus2euap", - "properties": {}}' + body: '{"location": "eastus2euap", "properties": {"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "sku": {"family": "A", "name": "standard"}, "accessPolicies": [{"tenantId": + "72f988bf-86f1-41af-91ab-2d7cd011db47", "objectId": "d50cfdce-f74f-4b75-9ea4-dd65c07770fd", + "permissions": {"keys": ["all"], "secrets": ["all"], "certificates": ["all"], + "storage": ["all"]}}], "softDeleteRetentionInDays": 90, "networkAcls": {"bypass": + "AzureServices", "defaultAction": "Allow"}}}' headers: Accept: - application/json Accept-Encoding: - gzip, deflate CommandName: - - cognitiveservices account create + - keyvault create Connection: - keep-alive Content-Length: - - '94' + - '467' Content-Type: - application/json ParameterSetName: - - --name --resource-group --kind --sku --location --yes + - --name -l --resource-group User-Agent: - - AZURECLI/2.38.0 azsdk-python-mgmt-cognitiveservices/13.2.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5?api-version=2022-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2021-06-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.CognitiveServices/accounts","etag":"\"02004e51-0000-3400-0000-63720c070000\"","location":"eastus2euap","sku":{"name":"S1"},"kind":"ComputerVision","properties":{"endpoint":"https://eastus2euap.api.cognitive.microsoft.com/","internalId":"038d1bd0f1ea4f2ba56a20b1872f15d8","dateCreated":"2022-11-14T09:36:07.4671216Z","callRateLimit":{"rules":[{"key":"vision.recognizeText","renewalPeriod":1,"count":30,"dynamicThrottlingEnabled":true,"matchPatterns":[{"path":"vision/recognizeText","method":"POST"},{"path":"vision/textOperations/*","method":"GET"},{"path":"vision/read/*","method":"*"}]},{"key":"vision","renewalPeriod":1,"count":15,"dynamicThrottlingEnabled":true,"matchPatterns":[{"path":"vision/*","method":"*"}]},{"key":"container.billing","renewalPeriod":10,"count":500,"dynamicThrottlingEnabled":false,"matchPatterns":[{"path":"billing/*","method":"*"}]},{"key":"default","renewalPeriod":1,"count":20,"dynamicThrottlingEnabled":true,"matchPatterns":[{"path":"*","method":"*"}]}]},"isMigrated":false,"privateEndpointConnections":[],"publicNetworkAccess":"Enabled","capabilities":[{"name":"DynamicThrottling"},{"name":"VirtualNetworks"},{"name":"NetworkSecurityPerimeter"},{"name":"Container","value":"ComputerVision.*,ComputerVision.VideoAnalytics"}],"endpoints":{"Computer - Vision":"https://eastus2euap.api.cognitive.microsoft.com/"},"provisioningState":"Succeeded"},"systemData":{"createdBy":"nikhilsaxena@microsoft.com","createdByType":"User","createdAt":"2022-11-14T09:36:06.5036617Z","lastModifiedBy":"nikhilsaxena@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-11-14T09:36:06.5036617Z"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.KeyVault/vaults","location":"eastus2euap","tags":{},"systemData":{"createdBy":"nikhilsaxena@microsoft.com","createdByType":"User","createdAt":"2022-11-16T09:09:55.541Z","lastModifiedBy":"nikhilsaxena@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-11-16T09:09:55.541Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"d50cfdce-f74f-4b75-9ea4-dd65c07770fd","permissions":{"keys":["all"],"secrets":["all"],"certificates":["all"],"storage":["all"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"softDeleteRetentionInDays":90,"vaultUri":"https://kvnspclitest5.vault.azure.net","provisioningState":"RegisteringDns","publicNetworkAccess":"Enabled"}}' headers: cache-control: - no-cache content-length: - - '1825' + - '1005' content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:09 GMT - etag: - - '"02004e51-0000-3400-0000-63720c070000"' + - Wed, 16 Nov 2022 09:09:57 GMT expires: - '-1' pragma: - no-cache server: - - istio-envoy + - Microsoft-IIS/10.0 strict-transport-security: - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 x-content-type-options: - nosniff - x-envoy-upstream-service-time: - - '521' + x-ms-keyvault-service-version: + - 1.5.564.0 x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1196' status: - code: 201 - message: Created + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - keyvault create + Connection: + - keep-alive + ParameterSetName: + - --name -l --resource-group + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2021-06-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.KeyVault/vaults","location":"eastus2euap","tags":{},"systemData":{"createdBy":"nikhilsaxena@microsoft.com","createdByType":"User","createdAt":"2022-11-16T09:09:55.541Z","lastModifiedBy":"nikhilsaxena@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-11-16T09:09:55.541Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"d50cfdce-f74f-4b75-9ea4-dd65c07770fd","permissions":{"keys":["all"],"secrets":["all"],"certificates":["all"],"storage":["all"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"softDeleteRetentionInDays":90,"vaultUri":"https://kvnspclitest5.vault.azure.net/","provisioningState":"Succeeded","publicNetworkAccess":"Enabled"}}' + headers: + cache-control: + - no-cache + content-length: + - '1001' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Nov 2022 09:10:29 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-keyvault-service-version: + - 1.5.564.0 + status: + code: 200 + message: OK - request: body: null headers: @@ -219,7 +368,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:35:44Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:09:34Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -228,7 +377,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:09 GMT + - Wed, 16 Nov 2022 09:10:29 GMT expires: - '-1' pragma: @@ -244,7 +393,7 @@ interactions: message: OK - request: body: '{"location": "eastus2euap", "name": "TestNspAssociation", "properties": - {"accessMode": "Learning", "privateLinkResource": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"}, + {"accessMode": "Learning", "privateLinkResource": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"}, "profile": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"}}}' headers: Accept: @@ -256,7 +405,7 @@ interactions: Connection: - keep-alive Content-Length: - - '521' + - '510' Content-Type: - application/json ParameterSetName: @@ -268,33 +417,35 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Learning","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' + string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Learning","provisioningState":"Accepted","hasProvisioningIssues":"no"}}' headers: cache-control: - no-cache content-length: - - '848' + - '836' content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:15 GMT + - Wed, 16 Nov 2022 09:10:35 GMT expires: - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview pragma: - no-cache server: - Kestrel strict-transport-security: - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - '1199' status: - code: 201 - message: Created + code: 200 + message: OK - request: body: null headers: @@ -314,16 +465,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Learning","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' + string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Learning","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' headers: cache-control: - no-cache content-length: - - '848' + - '837' content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:16 GMT + - Wed, 16 Nov 2022 09:10:37 GMT expires: - '-1' pragma: @@ -361,7 +512,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:35:44Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:09:34Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -370,7 +521,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:16 GMT + - Wed, 16 Nov 2022 09:10:36 GMT expires: - '-1' pragma: @@ -404,16 +555,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Learning","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' + string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Learning","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' headers: cache-control: - no-cache content-length: - - '848' + - '837' content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:17 GMT + - Wed, 16 Nov 2022 09:10:38 GMT expires: - '-1' pragma: @@ -433,7 +584,7 @@ interactions: message: OK - request: body: '{"location": "eastus2euap", "name": "TestNspAssociation", "properties": - {"accessMode": "Enforced", "privateLinkResource": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"}, + {"accessMode": "Enforced", "privateLinkResource": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"}, "profile": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"}}}' headers: Accept: @@ -445,7 +596,7 @@ interactions: Connection: - keep-alive Content-Length: - - '521' + - '510' Content-Type: - application/json ParameterSetName: @@ -457,16 +608,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Enforced","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' + string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Enforced","provisioningState":"Accepted","hasProvisioningIssues":"no"}}' headers: cache-control: - no-cache content-length: - - '848' + - '836' content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:21 GMT + - Wed, 16 Nov 2022 09:10:39 GMT expires: - '-1' pragma: @@ -482,7 +633,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1196' status: code: 200 message: OK @@ -505,16 +656,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Enforced","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' + string: '{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Enforced","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}' headers: cache-control: - no-cache content-length: - - '848' + - '837' content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:23 GMT + - Wed, 16 Nov 2022 09:10:40 GMT expires: - '-1' pragma: @@ -551,16 +702,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations?api-version=2021-02-01-preview response: body: - string: '{"nextLink":"","value":[{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Enforced","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}]}' + string: '{"nextLink":"","value":[{"name":"TestNspAssociation","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation","type":"Microsoft.Network/networkSecurityPerimeters/resourceAssociations","properties":{"privateLinkResource":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5"},"profile":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"},"accessMode":"Enforced","provisioningState":"Succeeded","hasProvisioningIssues":"no"}}]}' headers: cache-control: - no-cache content-length: - - '874' + - '863' content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:25 GMT + - Wed, 16 Nov 2022 09:10:43 GMT expires: - '-1' pragma: @@ -604,7 +755,7 @@ interactions: cache-control: - no-cache date: - - Mon, 14 Nov 2022 09:36:26 GMT + - Wed, 16 Nov 2022 09:10:45 GMT expires: - '-1' pragma: @@ -616,7 +767,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14999' + - '14998' status: code: 204 message: No Content @@ -649,7 +800,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:31 GMT + - Wed, 16 Nov 2022 09:10:47 GMT expires: - '-1' pragma: @@ -671,17 +822,17 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - cognitiveservices account delete + - keyvault delete Connection: - keep-alive Content-Length: - '0' ParameterSetName: - - --name --resource-group + - --name --resource-group --no-wait User-Agent: - - AZURECLI/2.38.0 azsdk-python-mgmt-cognitiveservices/13.2.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.CognitiveServices/accounts/kvnspclitest5?api-version=2022-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2021-06-01-preview response: body: string: '' @@ -691,21 +842,23 @@ interactions: content-length: - '0' date: - - Mon, 14 Nov 2022 09:36:43 GMT + - Wed, 16 Nov 2022 09:10:58 GMT expires: - '-1' pragma: - no-cache server: - - istio-envoy + - Microsoft-IIS/10.0 strict-transport-security: - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 x-content-type-options: - nosniff - x-envoy-upstream-service-time: - - '93' + x-ms-keyvault-service-version: + - 1.5.564.0 x-ms-ratelimit-remaining-subscription-deletes: - - '14999' + - '14997' status: code: 200 message: OK @@ -717,40 +870,96 @@ interactions: Accept-Encoding: - gzip, deflate CommandName: - - cognitiveservices account purge + - keyvault purge + Connection: + - keep-alive + ParameterSetName: + - --name -l --no-wait + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/deletedVaults/kvnspclitest5?api-version=2021-06-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/deletedVaults/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.KeyVault/deletedVaults","properties":{"vaultId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5","location":"eastus2euap","tags":{},"deletionDate":"2022-11-16T09:10:48Z","scheduledPurgeDate":"2023-02-14T09:10:48Z"}}' + headers: + cache-control: + - no-cache + content-length: + - '497' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 16 Nov 2022 09:11:00 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-keyvault-service-version: + - 1.5.564.0 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - keyvault purge Connection: - keep-alive Content-Length: - '0' ParameterSetName: - - --name -l -g + - --name -l --no-wait User-Agent: - - AZURECLI/2.38.0 azsdk-python-mgmt-cognitiveservices/13.2.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CognitiveServices/locations/eastus2euap/resourceGroups/test_nsp_association_crud000001/deletedAccounts/kvnspclitest5?api-version=2022-03-01 + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/deletedVaults/kvnspclitest5/purge?api-version=2021-06-01-preview response: body: string: '' headers: cache-control: - no-cache + content-length: + - '0' date: - - Mon, 14 Nov 2022 09:36:45 GMT + - Wed, 16 Nov 2022 09:11:01 GMT expires: - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/operationResults/VVR8MDYzODA0MTg2NjYyNzkxOTc1OHw5Q0Y1QkM0QjU1OUM0QkEzOTRGQTQzOEI4QTg0QjZFMA?api-version=2021-06-01-preview pragma: - no-cache server: - - istio-envoy + - Microsoft-IIS/10.0 strict-transport-security: - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 x-content-type-options: - nosniff - x-envoy-upstream-service-time: - - '78' - x-ms-ratelimit-remaining-subscription-deletes: - - '14999' + x-ms-keyvault-service-version: + - 1.5.564.0 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' status: - code: 204 - message: No Content + code: 202 + message: Accepted version: 1 diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml index 58b1e861c16..94510521c90 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml @@ -22,7 +22,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"aa3e189d-abd2-4e23-a735-d08e66c9937b","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"2043f43c-0c7a-4988-942c-b564c348661d","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:35:57 GMT + - Wed, 16 Nov 2022 09:09:46 GMT expires: - '-1' pragma: @@ -47,7 +47,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK @@ -70,7 +70,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"aa3e189d-abd2-4e23-a735-d08e66c9937b","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"2043f43c-0c7a-4988-942c-b564c348661d","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:35:58 GMT + - Wed, 16 Nov 2022 09:09:47 GMT expires: - '-1' pragma: @@ -116,7 +116,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters?api-version=2021-02-01-preview response: body: - string: '{"nextLink":"","value":[{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"aa3e189d-abd2-4e23-a735-d08e66c9937b","provisioningState":"Succeeded"}}]}' + string: '{"nextLink":"","value":[{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"2043f43c-0c7a-4988-942c-b564c348661d","provisioningState":"Succeeded"}}]}' headers: cache-control: - no-cache @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:00 GMT + - Wed, 16 Nov 2022 09:09:50 GMT expires: - '-1' pragma: @@ -171,7 +171,7 @@ interactions: content-length: - '0' date: - - Mon, 14 Nov 2022 09:36:07 GMT + - Wed, 16 Nov 2022 09:09:56 GMT expires: - '-1' pragma: @@ -183,7 +183,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14999' + - '14998' status: code: 200 message: OK @@ -215,7 +215,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:08 GMT + - Wed, 16 Nov 2022 09:09:57 GMT expires: - '-1' pragma: @@ -252,16 +252,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/perimeterAssociableResourceTypes?api-version=2021-02-01-preview&firstIndex=10&pageSize=10 response: body: - string: '{"type":"","nextLink":"","value":[{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.ServiceBus.namespaces","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.ServiceBus.namespaces","properties":{"providerNamespace":"Microsoft.ServiceBus","resourceType":"namespaces","displayName":"Microsoft.ServiceBus/namespaces","apiVersion":"2022-01-01-preview","publicDnsZones":["servicebus.windows.net"]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.Insights.ScheduledQueryRules","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.Insights.ScheduledQueryRules","properties":{"providerNamespace":"Microsoft.Insights","resourceType":"ScheduledQueryRules","displayName":"Microsoft.Insights/ScheduledQueryRules","apiVersion":"2021-10-01","publicDnsZones":[]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.Insights.actionGroups","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.Insights.actionGroups","properties":{"providerNamespace":"Microsoft.Insights","resourceType":"actionGroups","displayName":"Microsoft.Insights/actionGroups","apiVersion":"2021-10-01","publicDnsZones":["azns.azure.com","azns.azure.net","azns.azure.cn","azns.microsofticm.com","azurenotifications.msftcloudes.cn","azurenotifications.msftcloudes.net"]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.DocumentDB.databaseAccounts","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.DocumentDB.databaseAccounts","properties":{"providerNamespace":"Microsoft.DocumentDB","resourceType":"databaseAccounts","displayName":"Microsoft.DocumentDB/databaseAccounts","apiVersion":"2022-08-15-preview","publicDnsZones":["documents.azure.com","mongo.cosmos.azure.com","cassandra.cosmos.azure.com","gremlin.cosmos.azure.com","table.cosmos.azure.com"]}}]}' + string: '{"type":"","nextLink":"","value":[{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.ServiceBus.namespaces","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.ServiceBus.namespaces","properties":{"providerNamespace":"Microsoft.ServiceBus","resourceType":"namespaces","displayName":"Microsoft.ServiceBus/namespaces","apiVersion":"2022-01-01-preview","publicDnsZones":["servicebus.windows.net"]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.Insights.ScheduledQueryRules","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.Insights.ScheduledQueryRules","properties":{"providerNamespace":"Microsoft.Insights","resourceType":"ScheduledQueryRules","displayName":"Microsoft.Insights/ScheduledQueryRules","apiVersion":"2021-10-01","publicDnsZones":[]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.Insights.actionGroups","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.Insights.actionGroups","properties":{"providerNamespace":"Microsoft.Insights","resourceType":"actionGroups","displayName":"Microsoft.Insights/actionGroups","apiVersion":"2021-10-01","publicDnsZones":["azns.azure.com","azns.azure.net","azns.azure.cn","azns.microsofticm.com","azurenotifications.msftcloudes.cn","azurenotifications.msftcloudes.net"]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.DocumentDB.databaseAccounts","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.DocumentDB.databaseAccounts","properties":{"providerNamespace":"Microsoft.DocumentDB","resourceType":"databaseAccounts","displayName":"Microsoft.DocumentDB/databaseAccounts","apiVersion":"2022-08-15-preview","publicDnsZones":["documents.azure.com","mongo.cosmos.azure.com","cassandra.cosmos.azure.com","gremlin.cosmos.azure.com","table.cosmos.azure.com"]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.Devices.IotHubs","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.Devices.IotHubs","properties":{"providerNamespace":"Microsoft.Devices","resourceType":"IotHubs","displayName":"Microsoft.Devices/IotHubs","apiVersion":"2021-07-02-preview","publicDnsZones":["servicebus.windows.net","azure-devices.net"]}}]}' headers: cache-control: - no-cache content-length: - - '2060' + - '2503' content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:09 GMT + - Wed, 16 Nov 2022 09:09:58 GMT expires: - '-1' pragma: diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml index 1d1a44f980c..4d970258548 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml @@ -22,7 +22,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"d432e30c-457d-4363-8d53-34448e042224","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"6c857b56-68da-4698-91f2-dc75dbf003b5","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:40 GMT + - Wed, 16 Nov 2022 09:10:32 GMT expires: - '-1' pragma: @@ -47,7 +47,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK @@ -70,7 +70,7 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_profile_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001","name":"test_nsp_profile_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-14T09:36:24Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001","name":"test_nsp_profile_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:10:08Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:40 GMT + - Wed, 16 Nov 2022 09:10:32 GMT expires: - '-1' pragma: @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:46 GMT + - Wed, 16 Nov 2022 09:10:33 GMT expires: - '-1' pragma: @@ -141,7 +141,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' status: code: 200 message: OK @@ -173,7 +173,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:51 GMT + - Wed, 16 Nov 2022 09:10:36 GMT expires: - '-1' pragma: @@ -219,7 +219,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 14 Nov 2022 09:36:55 GMT + - Wed, 16 Nov 2022 09:10:36 GMT expires: - '-1' pragma: @@ -265,7 +265,7 @@ interactions: content-length: - '0' date: - - Mon, 14 Nov 2022 09:37:03 GMT + - Wed, 16 Nov 2022 09:10:37 GMT expires: - '-1' pragma: diff --git a/src/nsp/azext_nsp/tests/latest/test_nsp.py b/src/nsp/azext_nsp/tests/latest/test_nsp.py index 5b4f023f9cf..dfcfedc3936 100644 --- a/src/nsp/azext_nsp/tests/latest/test_nsp.py +++ b/src/nsp/azext_nsp/tests/latest/test_nsp.py @@ -116,10 +116,10 @@ def test_nsp_association_crud(self, resource_group): self.cmd('network perimeter create --name {nsp_name} -l eastus2euap --resource-group {rg}') self.cmd('network perimeter profile create --name {profile_name} --perimeter-name {nsp_name} --resource-group {rg}') - self.cmd('cognitiveservices account create --name {resource_name} --resource-group {rg} --kind ComputerVision --sku S1 --location eastus2euap --yes') + self.cmd('keyvault create --name {resource_name} -l eastus2euap --resource-group {rg}') self.cmd('network perimeter association create --name {association_name} --perimeter-name {nsp_name} --resource-group {rg} --access-mode Learning ' - '--private-link-resource id="/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.CognitiveServices/accounts/{resource_name}" ' + '--private-link-resource id="/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.KeyVault/vaults/{resource_name}" ' '--profile id="/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Network/networkSecurityPerimeters/{nsp_name}/profiles/{profile_name}"') self.cmd('network perimeter association show --name {association_name} --perimeter-name {nsp_name} --resource-group {rg}', checks=[ @@ -127,7 +127,7 @@ def test_nsp_association_crud(self, resource_group): ]) self.cmd('network perimeter association update --name {association_name} --perimeter-name {nsp_name} --resource-group {rg} --access-mode Enforced ' - '--private-link-resource id="/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.CognitiveServices/accounts/{resource_name}" ' + '--private-link-resource id="/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.KeyVault/vaults/{resource_name}" ' '--profile id="/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Network/networkSecurityPerimeters/{nsp_name}/profiles/{profile_name}"') self.cmd('network perimeter association show --name {association_name} --perimeter-name {nsp_name} --resource-group {rg}', checks=[ @@ -140,5 +140,5 @@ def test_nsp_association_crud(self, resource_group): self.cmd('network perimeter association show --name {association_name} --perimeter-name {nsp_name} --resource-group {rg}', expect_failure=True) - self.cmd('cognitiveservices account delete --name {resource_name} --resource-group {rg}') - self.cmd('cognitiveservices account purge --name {resource_name} -l eastus2euap -g {rg}') + self.cmd('keyvault delete --name {resource_name} --resource-group {rg} --no-wait') + self.cmd('keyvault purge --name {resource_name} -l eastus2euap --no-wait') \ No newline at end of file From ffd321f5b3d4db74c6a5eb7630c0d28c9b4e1fca Mon Sep 17 00:00:00 2001 From: Nikhil Saxena Date: Thu, 17 Nov 2022 08:59:46 +0530 Subject: [PATCH 09/12] ran tests after upgrading keyvault version --- .../recordings/test_nsp_accessrule_crud.yaml | 64 ++++----- .../test_nsp_accessrule_inbound.yaml | 62 ++++----- .../recordings/test_nsp_association_crud.yaml | 128 +++++++++--------- .../latest/recordings/test_nsp_crud.yaml | 34 ++--- .../recordings/test_nsp_profile_crud.yaml | 28 ++-- 5 files changed, 158 insertions(+), 158 deletions(-) diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml index d6df0e48963..a37ed87f8e7 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_crud.yaml @@ -17,12 +17,12 @@ interactions: ParameterSetName: - --name -l --resource-group User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"6668839b-7231-41a6-8ef9-e5037c6264bb","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"dff3bcf8-f8ff-4ef2-981a-2cb3fbc866e3","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:46 GMT + - Thu, 17 Nov 2022 03:27:34 GMT expires: - '-1' pragma: @@ -47,7 +47,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1199' status: code: 200 message: OK @@ -65,12 +65,12 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:09:34Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-17T03:27:17Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:47 GMT + - Thu, 17 Nov 2022 03:27:35 GMT expires: - '-1' pragma: @@ -111,7 +111,7 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile?api-version=2021-02-01-preview response: @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:49 GMT + - Thu, 17 Nov 2022 03:27:37 GMT expires: - '-1' pragma: @@ -141,7 +141,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -159,12 +159,12 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group --fqdn --direction User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:09:34Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-17T03:27:17Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -173,7 +173,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:49 GMT + - Thu, 17 Nov 2022 03:27:37 GMT expires: - '-1' pragma: @@ -206,7 +206,7 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group --fqdn --direction User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule?api-version=2021-02-01-preview response: @@ -220,7 +220,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:53 GMT + - Thu, 17 Nov 2022 03:27:40 GMT expires: - '-1' pragma: @@ -236,7 +236,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1199' status: code: 200 message: OK @@ -254,7 +254,7 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule?api-version=2021-02-01-preview response: @@ -268,7 +268,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:55 GMT + - Thu, 17 Nov 2022 03:27:44 GMT expires: - '-1' pragma: @@ -300,12 +300,12 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group --fqdn --direction User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:09:34Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001","name":"test_nsp_accessrule_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-17T03:27:17Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -314,7 +314,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:55 GMT + - Thu, 17 Nov 2022 03:27:44 GMT expires: - '-1' pragma: @@ -342,7 +342,7 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group --fqdn --direction User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule?api-version=2021-02-01-preview response: @@ -356,7 +356,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:55 GMT + - Thu, 17 Nov 2022 03:27:45 GMT expires: - '-1' pragma: @@ -394,7 +394,7 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group --fqdn --direction User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule?api-version=2021-02-01-preview response: @@ -408,7 +408,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:56 GMT + - Thu, 17 Nov 2022 03:27:46 GMT expires: - '-1' pragma: @@ -424,7 +424,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1198' status: code: 200 message: OK @@ -442,7 +442,7 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule?api-version=2021-02-01-preview response: @@ -456,7 +456,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:59 GMT + - Thu, 17 Nov 2022 03:27:48 GMT expires: - '-1' pragma: @@ -488,7 +488,7 @@ interactions: ParameterSetName: - --perimeter-name --profile-name --resource-group User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules?api-version=2021-02-01-preview response: @@ -502,7 +502,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:59 GMT + - Thu, 17 Nov 2022 03:27:50 GMT expires: - '-1' pragma: @@ -536,7 +536,7 @@ interactions: ParameterSetName: - --name --perimeter-name --profile-name --resource-group --yes User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule?api-version=2021-02-01-preview response: @@ -548,7 +548,7 @@ interactions: content-length: - '0' date: - - Wed, 16 Nov 2022 09:10:03 GMT + - Thu, 17 Nov 2022 03:27:55 GMT expires: - '-1' pragma: diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml index 6d0d0513dd5..f7ab78b6892 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_accessrule_inbound.yaml @@ -17,12 +17,12 @@ interactions: ParameterSetName: - --name -l --resource-group User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"ac71cd9a-b602-45ee-94fc-442c96ef2fa8","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"b0699211-c569-4331-8e23-d8b1c7827e7e","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:49 GMT + - Thu, 17 Nov 2022 03:27:36 GMT expires: - '-1' pragma: @@ -65,12 +65,12 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:09:34Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-17T03:27:17Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:49 GMT + - Thu, 17 Nov 2022 03:27:36 GMT expires: - '-1' pragma: @@ -111,7 +111,7 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile?api-version=2021-02-01-preview response: @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:51 GMT + - Thu, 17 Nov 2022 03:27:40 GMT expires: - '-1' pragma: @@ -141,7 +141,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1199' status: code: 200 message: OK @@ -159,12 +159,12 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group --address-prefixes User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:09:34Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-17T03:27:17Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -173,7 +173,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:52 GMT + - Thu, 17 Nov 2022 03:27:41 GMT expires: - '-1' pragma: @@ -206,7 +206,7 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group --address-prefixes User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_ip?api-version=2021-02-01-preview response: @@ -220,7 +220,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:54 GMT + - Thu, 17 Nov 2022 03:27:45 GMT expires: - '-1' pragma: @@ -236,7 +236,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -254,12 +254,12 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group --subscriptions User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:09:34Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-17T03:27:17Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -268,7 +268,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:55 GMT + - Thu, 17 Nov 2022 03:27:45 GMT expires: - '-1' pragma: @@ -301,7 +301,7 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group --subscriptions User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_subscription?api-version=2021-02-01-preview response: @@ -315,7 +315,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:58 GMT + - Thu, 17 Nov 2022 03:27:48 GMT expires: - '-1' pragma: @@ -353,12 +353,12 @@ interactions: ParameterSetName: - --name -l --resource-group User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule?api-version=2021-02-01-preview response: body: - string: '{"name":"nsp_for_rule","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"8901c59b-5312-40d6-afff-d6aa562ae666","provisioningState":"Succeeded"}}' + string: '{"name":"nsp_for_rule","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"34fe1e07-6a99-4d34-afee-653690b0de95","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -367,7 +367,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:10:02 GMT + - Thu, 17 Nov 2022 03:28:00 GMT expires: - '-1' pragma: @@ -383,7 +383,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1199' status: code: 200 message: OK @@ -401,12 +401,12 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group --nsp User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:09:34Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001","name":"test_nsp_accessrule_inbound000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-17T03:27:17Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -415,7 +415,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:10:02 GMT + - Thu, 17 Nov 2022 03:28:00 GMT expires: - '-1' pragma: @@ -448,12 +448,12 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group --nsp User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_nsp?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNspAccessRule_nsp","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_nsp","type":"Microsoft.Network/networkSecurityPerimeters/profiles/accessRules","properties":{"provisioningState":"Succeeded","direction":"Inbound","addressPrefixes":[],"fullyQualifiedDomainNames":[],"subscriptions":[],"networkSecurityPerimeters":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","perimeterGuid":"8901c59b-5312-40d6-afff-d6aa562ae666","location":"eastus2euap"}]}}' + string: '{"name":"TestNspAccessRule_nsp","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_nsp","type":"Microsoft.Network/networkSecurityPerimeters/profiles/accessRules","properties":{"provisioningState":"Succeeded","direction":"Inbound","addressPrefixes":[],"fullyQualifiedDomainNames":[],"subscriptions":[],"networkSecurityPerimeters":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/nsp_for_rule","perimeterGuid":"34fe1e07-6a99-4d34-afee-653690b0de95","location":"eastus2euap"}]}}' headers: cache-control: - no-cache @@ -462,7 +462,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:10:03 GMT + - Thu, 17 Nov 2022 03:28:03 GMT expires: - '-1' pragma: @@ -478,7 +478,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml index be4710f3a9e..6bf7001d67a 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_association_crud.yaml @@ -17,12 +17,12 @@ interactions: ParameterSetName: - --name -l --resource-group User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"0a4b36ec-4f43-4ee9-96b1-8cfabdec0218","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"27e1cf3e-c620-4a77-8e15-c3c712cedf60","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:48 GMT + - Thu, 17 Nov 2022 03:27:35 GMT expires: - '-1' pragma: @@ -65,12 +65,12 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:09:34Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-17T03:27:17Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:49 GMT + - Thu, 17 Nov 2022 03:27:35 GMT expires: - '-1' pragma: @@ -111,7 +111,7 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile?api-version=2021-02-01-preview response: @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:51 GMT + - Thu, 17 Nov 2022 03:27:38 GMT expires: - '-1' pragma: @@ -141,7 +141,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -159,9 +159,9 @@ interactions: ParameterSetName: - --name -l --resource-group User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 azsdk-python-azure-mgmt-keyvault/10.1.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2021-06-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2022-07-01 response: body: string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.KeyVault/vaults/kvnspclitest5'' @@ -175,7 +175,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:52 GMT + - Thu, 17 Nov 2022 03:27:39 GMT expires: - '-1' pragma: @@ -203,7 +203,7 @@ interactions: ParameterSetName: - --name -l --resource-group User-Agent: - - python/3.10.5 (Windows-10-10.0.22621-SP0) AZURECLI/2.38.0 + - python/3.10.5 (Windows-10-10.0.22621-SP0) AZURECLI/2.42.0 method: GET uri: https://graph.microsoft.com/v1.0/me response: @@ -219,11 +219,11 @@ interactions: content-type: - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:52 GMT + - Thu, 17 Nov 2022 03:27:40 GMT odata-version: - '4.0' request-id: - - 9a2abb64-cfa0-450e-a4e7-90fe34af997d + - 4bc621ad-27cf-4c03-8d6c-f8d489e89253 strict-transport-security: - max-age=31536000 transfer-encoding: @@ -231,7 +231,7 @@ interactions: vary: - Accept-Encoding x-ms-ags-diagnostic: - - '{"ServerInfo":{"DataCenter":"South India","Slice":"E","Ring":"2","ScaleUnit":"002","RoleInstance":"MA1PEPF00001470"}}' + - '{"ServerInfo":{"DataCenter":"South India","Slice":"E","Ring":"2","ScaleUnit":"000","RoleInstance":"MA1PEPF000012F3"}}' x-ms-resource-unit: - '1' status: @@ -242,8 +242,8 @@ interactions: "sku": {"family": "A", "name": "standard"}, "accessPolicies": [{"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", "objectId": "d50cfdce-f74f-4b75-9ea4-dd65c07770fd", "permissions": {"keys": ["all"], "secrets": ["all"], "certificates": ["all"], - "storage": ["all"]}}], "softDeleteRetentionInDays": 90, "networkAcls": {"bypass": - "AzureServices", "defaultAction": "Allow"}}}' + "storage": ["all"]}}], "enableSoftDelete": true, "softDeleteRetentionInDays": + 90, "networkAcls": {"bypass": "AzureServices", "defaultAction": "Allow"}}}' headers: Accept: - application/json @@ -254,18 +254,18 @@ interactions: Connection: - keep-alive Content-Length: - - '467' + - '493' Content-Type: - application/json ParameterSetName: - --name -l --resource-group User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 azsdk-python-azure-mgmt-keyvault/10.1.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2021-06-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2022-07-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.KeyVault/vaults","location":"eastus2euap","tags":{},"systemData":{"createdBy":"nikhilsaxena@microsoft.com","createdByType":"User","createdAt":"2022-11-16T09:09:55.541Z","lastModifiedBy":"nikhilsaxena@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-11-16T09:09:55.541Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"d50cfdce-f74f-4b75-9ea4-dd65c07770fd","permissions":{"keys":["all"],"secrets":["all"],"certificates":["all"],"storage":["all"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"softDeleteRetentionInDays":90,"vaultUri":"https://kvnspclitest5.vault.azure.net","provisioningState":"RegisteringDns","publicNetworkAccess":"Enabled"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.KeyVault/vaults","location":"eastus2euap","tags":{},"systemData":{"createdBy":"nikhilsaxena@microsoft.com","createdByType":"User","createdAt":"2022-11-17T03:27:46.183Z","lastModifiedBy":"nikhilsaxena@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-11-17T03:27:46.183Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"d50cfdce-f74f-4b75-9ea4-dd65c07770fd","permissions":{"keys":["all"],"secrets":["all"],"certificates":["all"],"storage":["all"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"softDeleteRetentionInDays":90,"vaultUri":"https://kvnspclitest5.vault.azure.net","provisioningState":"RegisteringDns","publicNetworkAccess":"Enabled"}}' headers: cache-control: - no-cache @@ -274,7 +274,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:57 GMT + - Thu, 17 Nov 2022 03:27:49 GMT expires: - '-1' pragma: @@ -294,7 +294,7 @@ interactions: x-ms-keyvault-service-version: - 1.5.564.0 x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1199' status: code: 200 message: OK @@ -312,12 +312,12 @@ interactions: ParameterSetName: - --name -l --resource-group User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 azsdk-python-azure-mgmt-keyvault/10.1.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2021-06-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2022-07-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.KeyVault/vaults","location":"eastus2euap","tags":{},"systemData":{"createdBy":"nikhilsaxena@microsoft.com","createdByType":"User","createdAt":"2022-11-16T09:09:55.541Z","lastModifiedBy":"nikhilsaxena@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-11-16T09:09:55.541Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"d50cfdce-f74f-4b75-9ea4-dd65c07770fd","permissions":{"keys":["all"],"secrets":["all"],"certificates":["all"],"storage":["all"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"softDeleteRetentionInDays":90,"vaultUri":"https://kvnspclitest5.vault.azure.net/","provisioningState":"Succeeded","publicNetworkAccess":"Enabled"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.KeyVault/vaults","location":"eastus2euap","tags":{},"systemData":{"createdBy":"nikhilsaxena@microsoft.com","createdByType":"User","createdAt":"2022-11-17T03:27:46.183Z","lastModifiedBy":"nikhilsaxena@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2022-11-17T03:27:46.183Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"d50cfdce-f74f-4b75-9ea4-dd65c07770fd","permissions":{"keys":["all"],"secrets":["all"],"certificates":["all"],"storage":["all"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"softDeleteRetentionInDays":90,"vaultUri":"https://kvnspclitest5.vault.azure.net/","provisioningState":"Succeeded","publicNetworkAccess":"Enabled"}}' headers: cache-control: - no-cache @@ -326,7 +326,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:10:29 GMT + - Thu, 17 Nov 2022 03:28:19 GMT expires: - '-1' pragma: @@ -363,12 +363,12 @@ interactions: - --name --perimeter-name --resource-group --access-mode --private-link-resource --profile User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:09:34Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-17T03:27:17Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -377,7 +377,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:10:29 GMT + - Thu, 17 Nov 2022 03:28:20 GMT expires: - '-1' pragma: @@ -412,7 +412,7 @@ interactions: - --name --perimeter-name --resource-group --access-mode --private-link-resource --profile User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview response: @@ -426,7 +426,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:10:35 GMT + - Thu, 17 Nov 2022 03:28:28 GMT expires: - '-1' pragma: @@ -460,7 +460,7 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview response: @@ -474,7 +474,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:10:37 GMT + - Thu, 17 Nov 2022 03:28:29 GMT expires: - '-1' pragma: @@ -507,12 +507,12 @@ interactions: - --name --perimeter-name --resource-group --access-mode --private-link-resource --profile User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:09:34Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001","name":"test_nsp_association_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-17T03:27:17Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -521,7 +521,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:10:36 GMT + - Thu, 17 Nov 2022 03:28:30 GMT expires: - '-1' pragma: @@ -550,7 +550,7 @@ interactions: - --name --perimeter-name --resource-group --access-mode --private-link-resource --profile User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview response: @@ -564,7 +564,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:10:38 GMT + - Thu, 17 Nov 2022 03:28:30 GMT expires: - '-1' pragma: @@ -603,7 +603,7 @@ interactions: - --name --perimeter-name --resource-group --access-mode --private-link-resource --profile User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview response: @@ -617,7 +617,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:10:39 GMT + - Thu, 17 Nov 2022 03:28:31 GMT expires: - '-1' pragma: @@ -633,7 +633,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1198' status: code: 200 message: OK @@ -651,7 +651,7 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview response: @@ -665,7 +665,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:10:40 GMT + - Thu, 17 Nov 2022 03:28:34 GMT expires: - '-1' pragma: @@ -697,7 +697,7 @@ interactions: ParameterSetName: - --perimeter-name --resource-group User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations?api-version=2021-02-01-preview response: @@ -711,7 +711,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:10:43 GMT + - Thu, 17 Nov 2022 03:28:37 GMT expires: - '-1' pragma: @@ -745,7 +745,7 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group --yes User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview response: @@ -755,7 +755,7 @@ interactions: cache-control: - no-cache date: - - Wed, 16 Nov 2022 09:10:45 GMT + - Thu, 17 Nov 2022 03:28:40 GMT expires: - '-1' pragma: @@ -767,7 +767,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14999' status: code: 204 message: No Content @@ -785,7 +785,7 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/resourceAssociations/TestNspAssociation?api-version=2021-02-01-preview response: @@ -800,7 +800,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:10:47 GMT + - Thu, 17 Nov 2022 03:28:41 GMT expires: - '-1' pragma: @@ -830,9 +830,9 @@ interactions: ParameterSetName: - --name --resource-group --no-wait User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 azsdk-python-azure-mgmt-keyvault/10.1.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2021-06-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5?api-version=2022-07-01 response: body: string: '' @@ -842,7 +842,7 @@ interactions: content-length: - '0' date: - - Wed, 16 Nov 2022 09:10:58 GMT + - Thu, 17 Nov 2022 03:28:52 GMT expires: - '-1' pragma: @@ -858,7 +858,7 @@ interactions: x-ms-keyvault-service-version: - 1.5.564.0 x-ms-ratelimit-remaining-subscription-deletes: - - '14997' + - '14999' status: code: 200 message: OK @@ -876,12 +876,12 @@ interactions: ParameterSetName: - --name -l --no-wait User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 azsdk-python-azure-mgmt-keyvault/10.1.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/deletedVaults/kvnspclitest5?api-version=2021-06-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/deletedVaults/kvnspclitest5?api-version=2022-07-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/deletedVaults/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.KeyVault/deletedVaults","properties":{"vaultId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5","location":"eastus2euap","tags":{},"deletionDate":"2022-11-16T09:10:48Z","scheduledPurgeDate":"2023-02-14T09:10:48Z"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/deletedVaults/kvnspclitest5","name":"kvnspclitest5","type":"Microsoft.KeyVault/deletedVaults","properties":{"vaultId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvnspclitest5","location":"eastus2euap","tags":{},"deletionDate":"2022-11-17T03:28:43Z","scheduledPurgeDate":"2023-02-15T03:28:43Z"}}' headers: cache-control: - no-cache @@ -890,7 +890,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:11:00 GMT + - Thu, 17 Nov 2022 03:28:54 GMT expires: - '-1' pragma: @@ -928,9 +928,9 @@ interactions: ParameterSetName: - --name -l --no-wait User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-keyvault/9.3.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 azsdk-python-azure-mgmt-keyvault/10.1.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/deletedVaults/kvnspclitest5/purge?api-version=2021-06-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/deletedVaults/kvnspclitest5/purge?api-version=2022-07-01 response: body: string: '' @@ -940,11 +940,11 @@ interactions: content-length: - '0' date: - - Wed, 16 Nov 2022 09:11:01 GMT + - Thu, 17 Nov 2022 03:28:55 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/operationResults/VVR8MDYzODA0MTg2NjYyNzkxOTc1OHw5Q0Y1QkM0QjU1OUM0QkEzOTRGQTQzOEI4QTg0QjZFMA?api-version=2021-06-01-preview + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/operationResults/VVR8MDYzODA0MjUyNTM3MDAyNjQ0M3w5NkY1ODU0NTYxREI0NDE3OUNCMkM3ODM5OTA4MTBDMg?api-version=2022-07-01 pragma: - no-cache server: diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml index 94510521c90..13b5a83640c 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_crud.yaml @@ -17,12 +17,12 @@ interactions: ParameterSetName: - --name -l --resource-group User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"2043f43c-0c7a-4988-942c-b564c348661d","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"385bf697-e115-4e47-9cc9-f055297ae4a7","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:46 GMT + - Thu, 17 Nov 2022 03:27:36 GMT expires: - '-1' pragma: @@ -47,7 +47,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK @@ -65,12 +65,12 @@ interactions: ParameterSetName: - --resource-group --name User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"2043f43c-0c7a-4988-942c-b564c348661d","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"385bf697-e115-4e47-9cc9-f055297ae4a7","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:47 GMT + - Thu, 17 Nov 2022 03:27:38 GMT expires: - '-1' pragma: @@ -111,12 +111,12 @@ interactions: ParameterSetName: - --resource-group User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters?api-version=2021-02-01-preview response: body: - string: '{"nextLink":"","value":[{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"2043f43c-0c7a-4988-942c-b564c348661d","provisioningState":"Succeeded"}}]}' + string: '{"nextLink":"","value":[{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"385bf697-e115-4e47-9cc9-f055297ae4a7","provisioningState":"Succeeded"}}]}' headers: cache-control: - no-cache @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:50 GMT + - Thu, 17 Nov 2022 03:27:40 GMT expires: - '-1' pragma: @@ -159,7 +159,7 @@ interactions: ParameterSetName: - -g --name --yes User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: @@ -171,7 +171,7 @@ interactions: content-length: - '0' date: - - Wed, 16 Nov 2022 09:09:56 GMT + - Thu, 17 Nov 2022 03:27:50 GMT expires: - '-1' pragma: @@ -183,7 +183,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14999' status: code: 200 message: OK @@ -201,7 +201,7 @@ interactions: ParameterSetName: - -l User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/perimeterAssociableResourceTypes?api-version=2021-02-01-preview response: @@ -215,7 +215,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:57 GMT + - Thu, 17 Nov 2022 03:27:51 GMT expires: - '-1' pragma: @@ -247,7 +247,7 @@ interactions: ParameterSetName: - -l User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus2euap/perimeterAssociableResourceTypes?api-version=2021-02-01-preview&firstIndex=10&pageSize=10 response: @@ -261,7 +261,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:09:58 GMT + - Thu, 17 Nov 2022 03:27:52 GMT expires: - '-1' pragma: diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml index 4d970258548..40dc44f4293 100644 --- a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_profile_crud.yaml @@ -17,12 +17,12 @@ interactions: ParameterSetName: - --name -l --resource-group User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter?api-version=2021-02-01-preview response: body: - string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"6c857b56-68da-4698-91f2-dc75dbf003b5","provisioningState":"Succeeded"}}' + string: '{"name":"TestNetworkSecurityPerimeter","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"b6d13203-58f7-41f9-90ab-28e675155a80","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:10:32 GMT + - Thu, 17 Nov 2022 03:28:11 GMT expires: - '-1' pragma: @@ -65,12 +65,12 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_profile_crud000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001","name":"test_nsp_profile_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-16T09:10:08Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001","name":"test_nsp_profile_crud000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2euap","tags":{"product":"azurecli","cause":"automation","date":"2022-11-17T03:28:02Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:10:32 GMT + - Thu, 17 Nov 2022 03:28:11 GMT expires: - '-1' pragma: @@ -111,7 +111,7 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile?api-version=2021-02-01-preview response: @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:10:33 GMT + - Thu, 17 Nov 2022 03:28:13 GMT expires: - '-1' pragma: @@ -159,7 +159,7 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile?api-version=2021-02-01-preview response: @@ -173,7 +173,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:10:36 GMT + - Thu, 17 Nov 2022 03:28:14 GMT expires: - '-1' pragma: @@ -205,7 +205,7 @@ interactions: ParameterSetName: - --perimeter-name --resource-group User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles?api-version=2021-02-01-preview response: @@ -219,7 +219,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 16 Nov 2022 09:10:36 GMT + - Thu, 17 Nov 2022 03:28:16 GMT expires: - '-1' pragma: @@ -253,7 +253,7 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group --yes User-Agent: - - AZURECLI/2.38.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_profile_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile?api-version=2021-02-01-preview response: @@ -265,7 +265,7 @@ interactions: content-length: - '0' date: - - Wed, 16 Nov 2022 09:10:37 GMT + - Thu, 17 Nov 2022 03:28:19 GMT expires: - '-1' pragma: From f1daca2d9805b46745bf1622bc9b2fc45f573a61 Mon Sep 17 00:00:00 2001 From: Nikhil Saxena Date: Thu, 17 Nov 2022 16:03:50 +0530 Subject: [PATCH 10/12] added codeowner for NSP --- .github/CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6fd29c2e006..21bdf8cbf12 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -253,3 +253,5 @@ /src/scenario-guide/ @zhoxing-ms @ReaNAiveD /src/dynatrace/ @jsntcy + +/src/nsp @nikhilsaxena2609 From 3737b4b631903a58bad60667e29b94b1dfe466ac Mon Sep 17 00:00:00 2001 From: Nikhil Saxena Date: Fri, 18 Nov 2022 10:52:16 +0530 Subject: [PATCH 11/12] fix codeowners typo --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 21bdf8cbf12..2ccd01c723d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -254,4 +254,4 @@ /src/dynatrace/ @jsntcy -/src/nsp @nikhilsaxena2609 +/src/nsp/ @nikhilsaxena2609 From b90d7c7fea5a95bff28a15d1449a3088ae688f22 Mon Sep 17 00:00:00 2001 From: Nikhil Saxena Date: Tue, 22 Nov 2022 16:48:13 +0530 Subject: [PATCH 12/12] updated documentation --- src/nsp/README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/nsp/README.md b/src/nsp/README.md index 7d36df9d3e0..16e90d024e2 100644 --- a/src/nsp/README.md +++ b/src/nsp/README.md @@ -1,5 +1,13 @@ -# Azure CLI Nsp Extension # -This is an extension to Azure CLI to manage Nsp resources. +# Azure CLI NSP Extension # +This is an extension to Azure CLI to manage NSP resources. ## How to use ## -Please add commands usage here. \ No newline at end of file +Install this extension using the below CLI command +``` +az extension add --name nsp +``` + +Then, call it as you would any other az command: +``` +az network manager -h +``` \ No newline at end of file