From a91ec6bb565c19f601b52a23535a90b0a3ce7a2d Mon Sep 17 00:00:00 2001 From: Kaushal Kumar Date: Wed, 12 Apr 2023 11:13:54 +0530 Subject: [PATCH] NSP link and link reference (#6171) * NSP link and link reference * Update * perimeter name argument update * Add link and link reference tests * Add test cases * Linter fix * Update test cases and examples * Update * Update * recording update * remove random string generator * Update version for release * Update history --------- Co-authored-by: Kaushal Kumar --- src/nsp/HISTORY.rst | 19 +- .../aaz/latest/network/perimeter/_create.py | 15 +- .../aaz/latest/network/perimeter/_delete.py | 14 + .../aaz/latest/network/perimeter/_list.py | 14 + .../aaz/latest/network/perimeter/_show.py | 14 + .../network/perimeter/association/_create.py | 52 +- .../network/perimeter/association/_delete.py | 14 + .../network/perimeter/association/_list.py | 36 +- .../network/perimeter/association/_show.py | 36 +- .../network/perimeter/association/_update.py | 186 +++--- .../network/perimeter/association/_wait.py | 36 +- .../network/perimeter/link/__cmd_group.py | 23 + .../latest/network/perimeter/link/__init__.py | 17 + .../latest/network/perimeter/link/_create.py | 297 +++++++++ .../latest/network/perimeter/link/_delete.py | 173 ++++++ .../latest/network/perimeter/link/_list.py | 250 ++++++++ .../latest/network/perimeter/link/_show.py | 234 +++++++ .../latest/network/perimeter/link/_update.py | 444 +++++++++++++ .../latest/network/perimeter/link/_wait.py | 230 +++++++ .../perimeter/link_reference/__cmd_group.py | 23 + .../perimeter/link_reference/__init__.py | 15 + .../perimeter/link_reference/_delete.py | 173 ++++++ .../network/perimeter/link_reference/_list.py | 252 ++++++++ .../network/perimeter/link_reference/_show.py | 236 +++++++ .../network/perimeter/link_reference/_wait.py | 232 +++++++ .../perimeter/onboarded_resources/_list.py | 18 +- .../network/perimeter/profile/_create.py | 20 +- .../network/perimeter/profile/_delete.py | 14 + .../latest/network/perimeter/profile/_list.py | 18 + .../latest/network/perimeter/profile/_show.py | 18 + .../perimeter/profile/access_rule/_create.py | 55 +- .../perimeter/profile/access_rule/_delete.py | 14 + .../perimeter/profile/access_rule/_list.py | 26 + .../perimeter/profile/access_rule/_show.py | 26 + .../perimeter/profile/access_rule/_update.py | 228 ++++--- src/nsp/azext_nsp/azext_metadata.json | 2 +- .../recordings/test_nsp_accessrule_crud.yaml | 107 ++-- .../test_nsp_accessrule_inbound.yaml | 162 +++-- .../recordings/test_nsp_association_crud.yaml | 210 ++++--- .../latest/recordings/test_nsp_crud.yaml | 36 +- .../latest/recordings/test_nsp_link_crud.yaml | 296 +++++++++ .../test_nsp_link_linkreference_crud.yaml | 583 ++++++++++++++++++ .../recordings/test_nsp_profile_crud.yaml | 36 +- src/nsp/azext_nsp/tests/latest/test_nsp.py | 58 +- src/nsp/setup.py | 2 +- 45 files changed, 4473 insertions(+), 491 deletions(-) create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/link/__cmd_group.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/link/__init__.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_create.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_delete.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_list.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_show.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_update.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_wait.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/__cmd_group.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/__init__.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/_delete.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/_list.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/_show.py create mode 100644 src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/_wait.py create mode 100644 src/nsp/azext_nsp/tests/latest/recordings/test_nsp_link_crud.yaml create mode 100644 src/nsp/azext_nsp/tests/latest/recordings/test_nsp_link_linkreference_crud.yaml diff --git a/src/nsp/HISTORY.rst b/src/nsp/HISTORY.rst index 8c34bccfff8..12fea33e05b 100644 --- a/src/nsp/HISTORY.rst +++ b/src/nsp/HISTORY.rst @@ -2,7 +2,22 @@ Release History =============== +=============== +##### 0.2.0 +++++++ +New commands added: +* perimeter link: create, delete, list, show, update +* perimeter link-reference: delete, list, show -0.1.0 +Existing commands updated: +* perimeter profile access-rule: create, delete, list, show, update (introduced new keys [--phone-numbers, --email-addresses] in request and response. Now access rule supports email/sms based outbound connections. + +=============== +##### 0.1.0 ++++++ -* Initial release. \ No newline at end of file +New commands added: +* perimeter: create, delete, list, show +* perimeter profile: create, delete, list, show +* perimeter association: create, delete, list, show, update +* perimeter profile access-rule: create, delete, list, show, update +* perimeter onboarded-resources: list 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 7c508f2265d..f5e98462a66 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/_create.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/_create.py @@ -48,7 +48,6 @@ def _build_arguments_schema(cls, *args, **kwargs): 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, @@ -75,7 +74,17 @@ def _build_arguments_schema(cls, *args, **kwargs): return cls._args_schema def _execute_operations(self): + self.pre_operations() self.NetworkSecurityPerimetersCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) @@ -209,4 +218,8 @@ def _build_schema_on_200_201(cls): return cls._schema_on_200_201 +class _CreateHelper: + """Helper class for Create""" + + __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 index 1ae90eae9e9..fd3c8aac14e 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/_delete.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/_delete.py @@ -57,7 +57,17 @@ def _build_arguments_schema(cls, *args, **kwargs): return cls._args_schema def _execute_operations(self): + self.pre_operations() self.NetworkSecurityPerimetersDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass class NetworkSecurityPerimetersDelete(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" @@ -122,4 +132,8 @@ def on_204(self, session): pass +class _DeleteHelper: + """Helper class for Delete""" + + __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 index 70526f8e251..43f232412d4 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/_list.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/_list.py @@ -60,12 +60,22 @@ def _build_arguments_schema(cls, *args, **kwargs): return cls._args_schema def _execute_operations(self): + self.pre_operations() 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)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) @@ -305,4 +315,8 @@ def _build_schema_on_200(cls): return cls._schema_on_200 +class _ListHelper: + """Helper class for List""" + + __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 index e105f94535a..de3c8bbdfd0 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/_show.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/_show.py @@ -56,7 +56,17 @@ def _build_arguments_schema(cls, *args, **kwargs): return cls._args_schema def _execute_operations(self): + self.pre_operations() self.NetworkSecurityPerimetersGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) @@ -170,4 +180,8 @@ def _build_schema_on_200(cls): return cls._schema_on_200 +class _ShowHelper: + """Helper class for Show""" + + __all__ = ["Show"] 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 77b0bc869f6..efe22673f78 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 @@ -48,13 +48,11 @@ def _build_arguments_schema(cls, *args, **kwargs): 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, @@ -121,7 +119,17 @@ def _build_args_sub_resource_create(cls, _schema): _schema.id = cls._args_sub_resource_create.id def _execute_operations(self): + self.pre_operations() self.NspAssociationsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) @@ -212,8 +220,8 @@ def content(self): 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")) + _CreateHelper._build_schema_sub_resource_create(properties.set_prop("privateLinkResource", AAZObjectType, ".private_link_resource")) + _CreateHelper._build_schema_sub_resource_create(properties.set_prop("profile", AAZObjectType, ".profile")) tags = _builder.get(".tags") if tags is not None: @@ -261,9 +269,9 @@ def _build_schema_on_200_201(cls): properties.private_link_resource = AAZObjectType( serialized_name="privateLinkResource", ) - _build_schema_sub_resource_read(properties.private_link_resource) + _CreateHelper._build_schema_sub_resource_read(properties.private_link_resource) properties.profile = AAZObjectType() - _build_schema_sub_resource_read(properties.profile) + _CreateHelper._build_schema_sub_resource_read(properties.profile) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -275,27 +283,29 @@ def _build_schema_on_200_201(cls): return cls._schema_on_200_201 -def _build_schema_sub_resource_create(_builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") +class _CreateHelper: + """Helper class for Create""" + @classmethod + def _build_schema_sub_resource_create(cls, _builder): + if _builder is None: + return + _builder.set_prop("id", AAZStrType, ".id") -_schema_sub_resource_read = None - + _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 + @classmethod + def _build_schema_sub_resource_read(cls, _schema): + if cls._schema_sub_resource_read is not None: + _schema.id = cls._schema_sub_resource_read.id + return - _schema_sub_resource_read = AAZObjectType() + cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() + sub_resource_read = _schema_sub_resource_read + sub_resource_read.id = AAZStrType() - _schema.id = _schema_sub_resource_read.id + _schema.id = cls._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 index 8e1ab8e33b4..8df4d31f06e 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 @@ -64,7 +64,17 @@ def _build_arguments_schema(cls, *args, **kwargs): return cls._args_schema def _execute_operations(self): + self.pre_operations() yield self.NspAssociationsDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass class NspAssociationsDelete(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" @@ -156,4 +166,8 @@ def on_204(self, session): pass +class _DeleteHelper: + """Helper class for Delete""" + + __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 index 3eb46dc0886..e25e59fc022 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 @@ -66,7 +66,17 @@ def _build_arguments_schema(cls, *args, **kwargs): return cls._args_schema def _execute_operations(self): + self.pre_operations() self.NspAssociationsList(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) @@ -191,9 +201,9 @@ def _build_schema_on_200(cls): properties.private_link_resource = AAZObjectType( serialized_name="privateLinkResource", ) - _build_schema_sub_resource_read(properties.private_link_resource) + _ListHelper._build_schema_sub_resource_read(properties.private_link_resource) properties.profile = AAZObjectType() - _build_schema_sub_resource_read(properties.profile) + _ListHelper._build_schema_sub_resource_read(properties.profile) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -205,21 +215,23 @@ def _build_schema_on_200(cls): return cls._schema_on_200 -_schema_sub_resource_read = None +class _ListHelper: + """Helper class for List""" + _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 + @classmethod + def _build_schema_sub_resource_read(cls, _schema): + if cls._schema_sub_resource_read is not None: + _schema.id = cls._schema_sub_resource_read.id + return - _schema_sub_resource_read = AAZObjectType() + cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() + sub_resource_read = _schema_sub_resource_read + sub_resource_read.id = AAZStrType() - _schema.id = _schema_sub_resource_read.id + _schema.id = cls._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 index 651de0f0660..0864bc5b8ec 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 @@ -62,7 +62,17 @@ def _build_arguments_schema(cls, *args, **kwargs): return cls._args_schema def _execute_operations(self): + self.pre_operations() self.NspAssociationsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) @@ -175,9 +185,9 @@ def _build_schema_on_200(cls): properties.private_link_resource = AAZObjectType( serialized_name="privateLinkResource", ) - _build_schema_sub_resource_read(properties.private_link_resource) + _ShowHelper._build_schema_sub_resource_read(properties.private_link_resource) properties.profile = AAZObjectType() - _build_schema_sub_resource_read(properties.profile) + _ShowHelper._build_schema_sub_resource_read(properties.profile) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -189,21 +199,23 @@ def _build_schema_on_200(cls): return cls._schema_on_200 -_schema_sub_resource_read = None +class _ShowHelper: + """Helper class for Show""" + _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 + @classmethod + def _build_schema_sub_resource_read(cls, _schema): + if cls._schema_sub_resource_read is not None: + _schema.id = cls._schema_sub_resource_read.id + return - _schema_sub_resource_read = AAZObjectType() + cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() + sub_resource_read = _schema_sub_resource_read + sub_resource_read.id = AAZStrType() - _schema.id = _schema_sub_resource_read.id + _schema.id = cls._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 index 9b63b3d83c8..360b4cc1121 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 @@ -133,10 +133,30 @@ def _build_args_sub_resource_update(cls, _schema): _schema.id = cls._args_sub_resource_update.id def _execute_operations(self): + self.pre_operations() self.NspAssociationsGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) self.InstanceUpdateByJson(ctx=self.ctx)() self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) self.NspAssociationsCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) @@ -225,7 +245,7 @@ def _build_schema_on_200(cls): return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() - _build_schema_nsp_association_read(cls._schema_on_200) + _UpdateHelper._build_schema_nsp_association_read(cls._schema_on_200) return cls._schema_on_200 @@ -324,7 +344,7 @@ def _build_schema_on_200_201(cls): return cls._schema_on_200_201 cls._schema_on_200_201 = AAZObjectType() - _build_schema_nsp_association_read(cls._schema_on_200_201) + _UpdateHelper._build_schema_nsp_association_read(cls._schema_on_200_201) return cls._schema_on_200_201 @@ -347,8 +367,8 @@ def _update_instance(self, instance): 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")) + _UpdateHelper._build_schema_sub_resource_update(properties.set_prop("privateLinkResource", AAZObjectType, ".private_link_resource")) + _UpdateHelper._build_schema_sub_resource_update(properties.set_prop("profile", AAZObjectType, ".profile")) tags = _builder.get(".tags") if tags is not None: @@ -365,85 +385,85 @@ def __call__(self, *args, **kwargs): ) -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 +class _UpdateHelper: + """Helper class for Update""" + + @classmethod + def _build_schema_sub_resource_update(cls, _builder): + if _builder is None: + return + _builder.set_prop("id", AAZStrType, ".id") + + _schema_nsp_association_read = None + + @classmethod + def _build_schema_nsp_association_read(cls, _schema): + if cls._schema_nsp_association_read is not None: + _schema.id = cls._schema_nsp_association_read.id + _schema.location = cls._schema_nsp_association_read.location + _schema.name = cls._schema_nsp_association_read.name + _schema.properties = cls._schema_nsp_association_read.properties + _schema.tags = cls._schema_nsp_association_read.tags + _schema.type = cls._schema_nsp_association_read.type + return + + cls._schema_nsp_association_read = _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", + ) + cls._build_schema_sub_resource_read(properties.private_link_resource) + properties.profile = AAZObjectType() + cls._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 = cls._schema_nsp_association_read.id + _schema.location = cls._schema_nsp_association_read.location + _schema.name = cls._schema_nsp_association_read.name + _schema.properties = cls._schema_nsp_association_read.properties + _schema.tags = cls._schema_nsp_association_read.tags + _schema.type = cls._schema_nsp_association_read.type + + _schema_sub_resource_read = None + + @classmethod + def _build_schema_sub_resource_read(cls, _schema): + if cls._schema_sub_resource_read is not None: + _schema.id = cls._schema_sub_resource_read.id + return + + cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() + + sub_resource_read = _schema_sub_resource_read + sub_resource_read.id = AAZStrType() + + _schema.id = cls._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 index d613ec12b7b..86278864249 100644 --- a/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_wait.py +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/association/_wait.py @@ -58,7 +58,17 @@ def _build_arguments_schema(cls, *args, **kwargs): return cls._args_schema def _execute_operations(self): + self.pre_operations() self.NspAssociationsGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) @@ -171,9 +181,9 @@ def _build_schema_on_200(cls): properties.private_link_resource = AAZObjectType( serialized_name="privateLinkResource", ) - _build_schema_sub_resource_read(properties.private_link_resource) + _WaitHelper._build_schema_sub_resource_read(properties.private_link_resource) properties.profile = AAZObjectType() - _build_schema_sub_resource_read(properties.profile) + _WaitHelper._build_schema_sub_resource_read(properties.profile) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -185,21 +195,23 @@ def _build_schema_on_200(cls): return cls._schema_on_200 -_schema_sub_resource_read = None +class _WaitHelper: + """Helper class for Wait""" + _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 + @classmethod + def _build_schema_sub_resource_read(cls, _schema): + if cls._schema_sub_resource_read is not None: + _schema.id = cls._schema_sub_resource_read.id + return - _schema_sub_resource_read = AAZObjectType() + cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() + sub_resource_read = _schema_sub_resource_read + sub_resource_read.id = AAZStrType() - _schema.id = _schema_sub_resource_read.id + _schema.id = cls._schema_sub_resource_read.id __all__ = ["Wait"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/__cmd_group.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/__cmd_group.py new file mode 100644 index 00000000000..cfbfe8575a9 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/__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 link", +) +class __CMDGroup(AAZCommandGroup): + """Manage network security perimeter link + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/__init__.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/__init__.py new file mode 100644 index 00000000000..db73033039b --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/__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/link/_create.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_create.py new file mode 100644 index 00000000000..7d955ad9571 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_create.py @@ -0,0 +1,297 @@ +# -------------------------------------------------------------------------------------------- +# 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 link create", +) +class Create(AAZCommand): + """Create NSP link resource. + + :example: Create NSP Link + az network perimeter link create --name link1 --perimeter-name nsp1 --resource-group rg1 --auto-remote-nsp-id --local-inbound-profile "[\'*\']" --remote-inbound-profile "[\'*\']" ' + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/links/{}", "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.link_name = AAZStrArg( + options=["-n", "--name", "--link-name"], + help="The name of the NSP link.", + required=True, + ) + _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, + ) + + # define Arg Group "Properties" + + _args_schema = cls._args_schema + _args_schema.auto_remote_nsp_id = AAZStrArg( + options=["--auto-remote-nsp-id"], + arg_group="Properties", + help="Perimeter ARM Id for the remote NSP with which the link gets created in Auto-approval mode. It should be used when the NSP admin have Microsoft.Network/networkSecurityPerimeters/linkPerimeter/action permission on the remote NSP resource.", + ) + _args_schema.description = AAZStrArg( + options=["--description"], + arg_group="Properties", + help="A message passed to the owner of the remote NSP link resource with this connection request. In case of Auto-approved flow, it is default to 'Auto Approved'. Restricted to 140 chars.", + ) + _args_schema.local_inbound_profile = AAZListArg( + options=["--local-inbound-profile"], + arg_group="Properties", + help="List of local Inbound profile names to which Inbound is allowed. Use ['*'] to allow inbound to all profiles. It's default value is ['*'].", + fmt=AAZListArgFormat( + unique=True, + ), + ) + _args_schema.remote_inbound_profile = AAZListArg( + options=["--remote-inbound-profile"], + arg_group="Properties", + help="List of remote Inbound profile names to which Inbound is allowed. Use ['*'] to allow inbound to all profiles. This property can only be updated in auto-approval mode. It's default value is ['*'].", + fmt=AAZListArgFormat( + unique=True, + ), + ) + + local_inbound_profile = cls._args_schema.local_inbound_profile + local_inbound_profile.Element = AAZStrArg() + + remote_inbound_profile = cls._args_schema.remote_inbound_profile + remote_inbound_profile.Element = AAZStrArg() + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NspLinksCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NspLinksCreateOrUpdate(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}/links/{linkName}", + **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( + "linkName", self.ctx.args.link_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("properties", AAZObjectType) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("autoApprovedRemotePerimeterResourceId", AAZStrType, ".auto_remote_nsp_id") + properties.set_prop("description", AAZStrType, ".description") + properties.set_prop("localInboundProfiles", AAZListType, ".local_inbound_profile") + properties.set_prop("remoteInboundProfiles", AAZListType, ".remote_inbound_profile") + + local_inbound_profiles = _builder.get(".properties.localInboundProfiles") + if local_inbound_profiles is not None: + local_inbound_profiles.set_elements(AAZStrType, ".") + + remote_inbound_profiles = _builder.get(".properties.remoteInboundProfiles") + if remote_inbound_profiles is not None: + remote_inbound_profiles.set_elements(AAZStrType, ".") + + return self.serialize_content(_content_value) + + def on_200_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200_201 + ) + + _schema_on_200_201 = None + + @classmethod + def _build_schema_on_200_201(cls): + if cls._schema_on_200_201 is not None: + return cls._schema_on_200_201 + + cls._schema_on_200_201 = AAZObjectType() + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.auto_approved_remote_perimeter_resource_id = AAZStrType( + serialized_name="autoApprovedRemotePerimeterResourceId", + ) + properties.description = AAZStrType() + properties.local_inbound_profiles = AAZListType( + serialized_name="localInboundProfiles", + ) + properties.local_outbound_profiles = AAZListType( + serialized_name="localOutboundProfiles", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.remote_inbound_profiles = AAZListType( + serialized_name="remoteInboundProfiles", + ) + properties.remote_outbound_profiles = AAZListType( + serialized_name="remoteOutboundProfiles", + flags={"read_only": True}, + ) + properties.remote_perimeter_guid = AAZStrType( + serialized_name="remotePerimeterGuid", + flags={"read_only": True}, + ) + properties.remote_perimeter_location = AAZStrType( + serialized_name="remotePerimeterLocation", + flags={"read_only": True}, + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + + local_inbound_profiles = cls._schema_on_200_201.properties.local_inbound_profiles + local_inbound_profiles.Element = AAZStrType() + + local_outbound_profiles = cls._schema_on_200_201.properties.local_outbound_profiles + local_outbound_profiles.Element = AAZStrType() + + remote_inbound_profiles = cls._schema_on_200_201.properties.remote_inbound_profiles + remote_inbound_profiles.Element = AAZStrType() + + remote_outbound_profiles = cls._schema_on_200_201.properties.remote_outbound_profiles + remote_outbound_profiles.Element = AAZStrType() + + return cls._schema_on_200_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_delete.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_delete.py new file mode 100644 index 00000000000..b9aef3cffaa --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_delete.py @@ -0,0 +1,173 @@ +# -------------------------------------------------------------------------------------------- +# 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 link delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete an NSP Link resource. + + :example: Delete NSP link + az network perimeter link delete --name link1 --perimeter-name nsp1 --resource-group rg1 + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/links/{}", "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.link_name = AAZStrArg( + options=["-n", "--name", "--link-name"], + help="The name of the NSP link.", + 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.pre_operations() + yield self.NspLinksDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class NspLinksDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/links/{linkName}", + **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( + "linkName", self.ctx.args.link_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 + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_list.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_list.py new file mode 100644 index 00000000000..f41be70e561 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_list.py @@ -0,0 +1,250 @@ +# -------------------------------------------------------------------------------------------- +# 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 link list", +) +class List(AAZCommand): + """List the NSP Link resources in the specified network security perimeter. + + :example: Lists NSP links in a parameter + az network perimeter link list --perimeter-name nsp1 --resource-group rg1 + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/links", "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.pre_operations() + self.NspLinksList(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + 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 NspLinksList(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}/links", + **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.etag = AAZStrType( + flags={"read_only": True}, + ) + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.auto_approved_remote_perimeter_resource_id = AAZStrType( + serialized_name="autoApprovedRemotePerimeterResourceId", + ) + properties.description = AAZStrType() + properties.local_inbound_profiles = AAZListType( + serialized_name="localInboundProfiles", + ) + properties.local_outbound_profiles = AAZListType( + serialized_name="localOutboundProfiles", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.remote_inbound_profiles = AAZListType( + serialized_name="remoteInboundProfiles", + ) + properties.remote_outbound_profiles = AAZListType( + serialized_name="remoteOutboundProfiles", + flags={"read_only": True}, + ) + properties.remote_perimeter_guid = AAZStrType( + serialized_name="remotePerimeterGuid", + flags={"read_only": True}, + ) + properties.remote_perimeter_location = AAZStrType( + serialized_name="remotePerimeterLocation", + flags={"read_only": True}, + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + + local_inbound_profiles = cls._schema_on_200.value.Element.properties.local_inbound_profiles + local_inbound_profiles.Element = AAZStrType() + + local_outbound_profiles = cls._schema_on_200.value.Element.properties.local_outbound_profiles + local_outbound_profiles.Element = AAZStrType() + + remote_inbound_profiles = cls._schema_on_200.value.Element.properties.remote_inbound_profiles + remote_inbound_profiles.Element = AAZStrType() + + remote_outbound_profiles = cls._schema_on_200.value.Element.properties.remote_outbound_profiles + remote_outbound_profiles.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_show.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_show.py new file mode 100644 index 00000000000..78c06220d0a --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_show.py @@ -0,0 +1,234 @@ +# -------------------------------------------------------------------------------------------- +# 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 link show", +) +class Show(AAZCommand): + """Get the specified NSP link resource. + + :example: Get NSP link + az network perimeter link list --perimeter-name nsp1 --resource-group rg1 + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/links/{}", "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.link_name = AAZStrArg( + options=["-n", "--name", "--link-name"], + help="The name of the NSP link.", + 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.pre_operations() + self.NspLinksGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NspLinksGet(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}/links/{linkName}", + **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( + "linkName", self.ctx.args.link_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.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.auto_approved_remote_perimeter_resource_id = AAZStrType( + serialized_name="autoApprovedRemotePerimeterResourceId", + ) + properties.description = AAZStrType() + properties.local_inbound_profiles = AAZListType( + serialized_name="localInboundProfiles", + ) + properties.local_outbound_profiles = AAZListType( + serialized_name="localOutboundProfiles", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.remote_inbound_profiles = AAZListType( + serialized_name="remoteInboundProfiles", + ) + properties.remote_outbound_profiles = AAZListType( + serialized_name="remoteOutboundProfiles", + flags={"read_only": True}, + ) + properties.remote_perimeter_guid = AAZStrType( + serialized_name="remotePerimeterGuid", + flags={"read_only": True}, + ) + properties.remote_perimeter_location = AAZStrType( + serialized_name="remotePerimeterLocation", + flags={"read_only": True}, + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + + local_inbound_profiles = cls._schema_on_200.properties.local_inbound_profiles + local_inbound_profiles.Element = AAZStrType() + + local_outbound_profiles = cls._schema_on_200.properties.local_outbound_profiles + local_outbound_profiles.Element = AAZStrType() + + remote_inbound_profiles = cls._schema_on_200.properties.remote_inbound_profiles + remote_inbound_profiles.Element = AAZStrType() + + remote_outbound_profiles = cls._schema_on_200.properties.remote_outbound_profiles + remote_outbound_profiles.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_update.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_update.py new file mode 100644 index 00000000000..2f1de45b07f --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_update.py @@ -0,0 +1,444 @@ +# -------------------------------------------------------------------------------------------- +# 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 link update", +) +class Update(AAZCommand): + """Update NSP link resource. + + :example: Update NSP Link + az network perimeter link update --name link1 --perimeter-name nsp1 --resource-group rg1 --local-inbound-profile "[\'*\']" + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/links/{}", "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.link_name = AAZStrArg( + options=["-n", "--name", "--link-name"], + help="The name of the NSP link.", + 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 "Properties" + + _args_schema = cls._args_schema + _args_schema.description = AAZStrArg( + options=["--description"], + arg_group="Properties", + help="A message passed to the owner of the remote NSP link resource with this connection request. In case of Auto-approved flow, it is default to 'Auto Approved'. Restricted to 140 chars.", + nullable=True, + ) + _args_schema.local_inbound_profile = AAZListArg( + options=["--local-inbound-profile"], + arg_group="Properties", + help="List of local Inbound profile names to which Inbound is allowed. Use ['*'] to allow inbound to all profiles. It's default value is ['*'].", + nullable=True, + fmt=AAZListArgFormat( + unique=True, + ), + ) + _args_schema.remote_inbound_profile = AAZListArg( + options=["--remote-inbound-profile"], + arg_group="Properties", + help="List of remote Inbound profile names to which Inbound is allowed. Use ['*'] to allow inbound to all profiles. This property can only be updated in auto-approval mode. It's default value is ['*'].", + nullable=True, + fmt=AAZListArgFormat( + unique=True, + ), + ) + + local_inbound_profile = cls._args_schema.local_inbound_profile + local_inbound_profile.Element = AAZStrArg( + nullable=True, + ) + + remote_inbound_profile = cls._args_schema.remote_inbound_profile + remote_inbound_profile.Element = AAZStrArg( + nullable=True, + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.NspLinksGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) + self.InstanceUpdateByJson(ctx=self.ctx)() + self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) + self.NspLinksCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NspLinksGet(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}/links/{linkName}", + **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( + "linkName", self.ctx.args.link_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() + _UpdateHelper._build_schema_nsp_link_read(cls._schema_on_200) + + return cls._schema_on_200 + + class NspLinksCreateOrUpdate(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}/links/{linkName}", + **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( + "linkName", self.ctx.args.link_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() + _UpdateHelper._build_schema_nsp_link_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("properties", AAZObjectType) + + properties = _builder.get(".properties") + if properties is not None: + properties.set_prop("description", AAZStrType, ".description") + properties.set_prop("localInboundProfiles", AAZListType, ".local_inbound_profile") + properties.set_prop("remoteInboundProfiles", AAZListType, ".remote_inbound_profile") + + local_inbound_profiles = _builder.get(".properties.localInboundProfiles") + if local_inbound_profiles is not None: + local_inbound_profiles.set_elements(AAZStrType, ".") + + remote_inbound_profiles = _builder.get(".properties.remoteInboundProfiles") + if remote_inbound_profiles is not None: + remote_inbound_profiles.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 + ) + + +class _UpdateHelper: + """Helper class for Update""" + + _schema_nsp_link_read = None + + @classmethod + def _build_schema_nsp_link_read(cls, _schema): + if cls._schema_nsp_link_read is not None: + _schema.etag = cls._schema_nsp_link_read.etag + _schema.id = cls._schema_nsp_link_read.id + _schema.name = cls._schema_nsp_link_read.name + _schema.properties = cls._schema_nsp_link_read.properties + _schema.type = cls._schema_nsp_link_read.type + return + + cls._schema_nsp_link_read = _schema_nsp_link_read = AAZObjectType() + + nsp_link_read = _schema_nsp_link_read + nsp_link_read.etag = AAZStrType( + flags={"read_only": True}, + ) + nsp_link_read.id = AAZStrType( + flags={"read_only": True}, + ) + nsp_link_read.name = AAZStrType( + flags={"read_only": True}, + ) + nsp_link_read.properties = AAZObjectType() + nsp_link_read.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = _schema_nsp_link_read.properties + properties.auto_approved_remote_perimeter_resource_id = AAZStrType( + serialized_name="autoApprovedRemotePerimeterResourceId", + ) + properties.description = AAZStrType() + properties.local_inbound_profiles = AAZListType( + serialized_name="localInboundProfiles", + ) + properties.local_outbound_profiles = AAZListType( + serialized_name="localOutboundProfiles", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.remote_inbound_profiles = AAZListType( + serialized_name="remoteInboundProfiles", + ) + properties.remote_outbound_profiles = AAZListType( + serialized_name="remoteOutboundProfiles", + flags={"read_only": True}, + ) + properties.remote_perimeter_guid = AAZStrType( + serialized_name="remotePerimeterGuid", + flags={"read_only": True}, + ) + properties.remote_perimeter_location = AAZStrType( + serialized_name="remotePerimeterLocation", + flags={"read_only": True}, + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + + local_inbound_profiles = _schema_nsp_link_read.properties.local_inbound_profiles + local_inbound_profiles.Element = AAZStrType() + + local_outbound_profiles = _schema_nsp_link_read.properties.local_outbound_profiles + local_outbound_profiles.Element = AAZStrType() + + remote_inbound_profiles = _schema_nsp_link_read.properties.remote_inbound_profiles + remote_inbound_profiles.Element = AAZStrType() + + remote_outbound_profiles = _schema_nsp_link_read.properties.remote_outbound_profiles + remote_outbound_profiles.Element = AAZStrType() + + _schema.etag = cls._schema_nsp_link_read.etag + _schema.id = cls._schema_nsp_link_read.id + _schema.name = cls._schema_nsp_link_read.name + _schema.properties = cls._schema_nsp_link_read.properties + _schema.type = cls._schema_nsp_link_read.type + + +__all__ = ["Update"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_wait.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_wait.py new file mode 100644 index 00000000000..64527e4d590 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link/_wait.py @@ -0,0 +1,230 @@ +# -------------------------------------------------------------------------------------------- +# 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 link 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/{}/links/{}", "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.link_name = AAZStrArg( + options=["-n", "--name", "--link-name"], + help="The name of the NSP link.", + 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.pre_operations() + self.NspLinksGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class NspLinksGet(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}/links/{linkName}", + **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( + "linkName", self.ctx.args.link_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.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.auto_approved_remote_perimeter_resource_id = AAZStrType( + serialized_name="autoApprovedRemotePerimeterResourceId", + ) + properties.description = AAZStrType() + properties.local_inbound_profiles = AAZListType( + serialized_name="localInboundProfiles", + ) + properties.local_outbound_profiles = AAZListType( + serialized_name="localOutboundProfiles", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.remote_inbound_profiles = AAZListType( + serialized_name="remoteInboundProfiles", + ) + properties.remote_outbound_profiles = AAZListType( + serialized_name="remoteOutboundProfiles", + flags={"read_only": True}, + ) + properties.remote_perimeter_guid = AAZStrType( + serialized_name="remotePerimeterGuid", + flags={"read_only": True}, + ) + properties.remote_perimeter_location = AAZStrType( + serialized_name="remotePerimeterLocation", + flags={"read_only": True}, + ) + properties.status = AAZStrType( + flags={"read_only": True}, + ) + + local_inbound_profiles = cls._schema_on_200.properties.local_inbound_profiles + local_inbound_profiles.Element = AAZStrType() + + local_outbound_profiles = cls._schema_on_200.properties.local_outbound_profiles + local_outbound_profiles.Element = AAZStrType() + + remote_inbound_profiles = cls._schema_on_200.properties.remote_inbound_profiles + remote_inbound_profiles.Element = AAZStrType() + + remote_outbound_profiles = cls._schema_on_200.properties.remote_outbound_profiles + remote_outbound_profiles.Element = AAZStrType() + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + +__all__ = ["Wait"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/__cmd_group.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/__cmd_group.py new file mode 100644 index 00000000000..8b3bbbdbaac --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/__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 link-reference", +) +class __CMDGroup(AAZCommandGroup): + """Manage network security perimeter link reference + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/__init__.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/__init__.py new file mode 100644 index 00000000000..f68091245a7 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/__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 ._delete import * +from ._list import * +from ._show import * +from ._wait import * diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/_delete.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/_delete.py new file mode 100644 index 00000000000..20d15ff2082 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/_delete.py @@ -0,0 +1,173 @@ +# -------------------------------------------------------------------------------------------- +# 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 link-reference delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete an NSP LinkReference resource. + + :example: Delete a link reference + az network perimeter link-reference delete --perimeter-name nsp2 --resource-group rg1 --name linkref2 + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/linkreferences/{}", "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.link_reference_name = AAZStrArg( + options=["-n", "--name", "--link-reference-name"], + help="The name of the NSP linkReference.", + 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.pre_operations() + yield self.NspLinkReferencesDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + class NspLinkReferencesDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [202]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [200]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_200, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + if session.http_response.status_code in [204]: + return self.client.build_lro_polling( + self.ctx.args.no_wait, + session, + self.on_204, + self.on_error, + lro_options={"final-state-via": "location"}, + path_format_arguments=self.url_parameters, + ) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/linkReferences/{linkReferenceName}", + **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( + "linkReferenceName", self.ctx.args.link_reference_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 + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/_list.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/_list.py new file mode 100644 index 00000000000..33b2fb6ca84 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/_list.py @@ -0,0 +1,252 @@ +# -------------------------------------------------------------------------------------------- +# 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 link-reference list", +) +class List(AAZCommand): + """List the NSP LinkReference resources in the specified network security perimeter. + + :example: List NSP link reference + az network perimeter link-reference list --perimeter-name nsp2 --resource-group rg1 + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/linkreferences", "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.pre_operations() + self.NspLinkReferencesList(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + 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 NspLinkReferencesList(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}/linkReferences", + **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.etag = AAZStrType( + flags={"read_only": True}, + ) + _element.id = AAZStrType( + flags={"read_only": True}, + ) + _element.name = AAZStrType( + flags={"read_only": True}, + ) + _element.properties = AAZObjectType() + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.value.Element.properties + properties.description = AAZStrType( + flags={"read_only": True}, + ) + properties.local_inbound_profiles = AAZListType( + serialized_name="localInboundProfiles", + ) + properties.local_outbound_profiles = AAZListType( + serialized_name="localOutboundProfiles", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.remote_inbound_profiles = AAZListType( + serialized_name="remoteInboundProfiles", + flags={"read_only": True}, + ) + properties.remote_outbound_profiles = AAZListType( + serialized_name="remoteOutboundProfiles", + flags={"read_only": True}, + ) + properties.remote_perimeter_guid = AAZStrType( + serialized_name="remotePerimeterGuid", + flags={"read_only": True}, + ) + properties.remote_perimeter_location = AAZStrType( + serialized_name="remotePerimeterLocation", + flags={"read_only": True}, + ) + properties.remote_perimeter_resource_id = AAZStrType( + serialized_name="remotePerimeterResourceId", + flags={"read_only": True}, + ) + properties.status = AAZStrType() + + local_inbound_profiles = cls._schema_on_200.value.Element.properties.local_inbound_profiles + local_inbound_profiles.Element = AAZStrType() + + local_outbound_profiles = cls._schema_on_200.value.Element.properties.local_outbound_profiles + local_outbound_profiles.Element = AAZStrType() + + remote_inbound_profiles = cls._schema_on_200.value.Element.properties.remote_inbound_profiles + remote_inbound_profiles.Element = AAZStrType() + + remote_outbound_profiles = cls._schema_on_200.value.Element.properties.remote_outbound_profiles + remote_outbound_profiles.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ListHelper: + """Helper class for List""" + + +__all__ = ["List"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/_show.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/_show.py new file mode 100644 index 00000000000..be40fae51d1 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/_show.py @@ -0,0 +1,236 @@ +# -------------------------------------------------------------------------------------------- +# 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 link-reference show", +) +class Show(AAZCommand): + """Get the specified NSP linkReference resource. + + :example: Get a link reference + az network perimeter link-reference show --perimeter-name nsp2 --resource-group rg1 --name linkref2 + """ + + _aaz_info = { + "version": "2021-02-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecurityperimeters/{}/linkreferences/{}", "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.link_reference_name = AAZStrArg( + options=["-n", "--name", "--link-reference-name"], + help="The name of the NSP linkReference.", + 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.pre_operations() + self.NspLinkReferencesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class NspLinkReferencesGet(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}/linkReferences/{linkReferenceName}", + **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( + "linkReferenceName", self.ctx.args.link_reference_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.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.description = AAZStrType( + flags={"read_only": True}, + ) + properties.local_inbound_profiles = AAZListType( + serialized_name="localInboundProfiles", + ) + properties.local_outbound_profiles = AAZListType( + serialized_name="localOutboundProfiles", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.remote_inbound_profiles = AAZListType( + serialized_name="remoteInboundProfiles", + flags={"read_only": True}, + ) + properties.remote_outbound_profiles = AAZListType( + serialized_name="remoteOutboundProfiles", + flags={"read_only": True}, + ) + properties.remote_perimeter_guid = AAZStrType( + serialized_name="remotePerimeterGuid", + flags={"read_only": True}, + ) + properties.remote_perimeter_location = AAZStrType( + serialized_name="remotePerimeterLocation", + flags={"read_only": True}, + ) + properties.remote_perimeter_resource_id = AAZStrType( + serialized_name="remotePerimeterResourceId", + flags={"read_only": True}, + ) + properties.status = AAZStrType() + + local_inbound_profiles = cls._schema_on_200.properties.local_inbound_profiles + local_inbound_profiles.Element = AAZStrType() + + local_outbound_profiles = cls._schema_on_200.properties.local_outbound_profiles + local_outbound_profiles.Element = AAZStrType() + + remote_inbound_profiles = cls._schema_on_200.properties.remote_inbound_profiles + remote_inbound_profiles.Element = AAZStrType() + + remote_outbound_profiles = cls._schema_on_200.properties.remote_outbound_profiles + remote_outbound_profiles.Element = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/_wait.py b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/_wait.py new file mode 100644 index 00000000000..9bb283694b9 --- /dev/null +++ b/src/nsp/azext_nsp/aaz/latest/network/perimeter/link_reference/_wait.py @@ -0,0 +1,232 @@ +# -------------------------------------------------------------------------------------------- +# 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 link-reference 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/{}/linkreferences/{}", "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.link_reference_name = AAZStrArg( + options=["-n", "--name", "--link-reference-name"], + help="The name of the NSP linkReference.", + 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.pre_operations() + self.NspLinkReferencesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) + return result + + class NspLinkReferencesGet(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}/linkReferences/{linkReferenceName}", + **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( + "linkReferenceName", self.ctx.args.link_reference_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.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.id = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.description = AAZStrType( + flags={"read_only": True}, + ) + properties.local_inbound_profiles = AAZListType( + serialized_name="localInboundProfiles", + ) + properties.local_outbound_profiles = AAZListType( + serialized_name="localOutboundProfiles", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.remote_inbound_profiles = AAZListType( + serialized_name="remoteInboundProfiles", + flags={"read_only": True}, + ) + properties.remote_outbound_profiles = AAZListType( + serialized_name="remoteOutboundProfiles", + flags={"read_only": True}, + ) + properties.remote_perimeter_guid = AAZStrType( + serialized_name="remotePerimeterGuid", + flags={"read_only": True}, + ) + properties.remote_perimeter_location = AAZStrType( + serialized_name="remotePerimeterLocation", + flags={"read_only": True}, + ) + properties.remote_perimeter_resource_id = AAZStrType( + serialized_name="remotePerimeterResourceId", + flags={"read_only": True}, + ) + properties.status = AAZStrType() + + local_inbound_profiles = cls._schema_on_200.properties.local_inbound_profiles + local_inbound_profiles.Element = AAZStrType() + + local_outbound_profiles = cls._schema_on_200.properties.local_outbound_profiles + local_outbound_profiles.Element = AAZStrType() + + remote_inbound_profiles = cls._schema_on_200.properties.remote_inbound_profiles + remote_inbound_profiles.Element = AAZStrType() + + remote_outbound_profiles = cls._schema_on_200.properties.remote_outbound_profiles + remote_outbound_profiles.Element = AAZStrType() + + return cls._schema_on_200 + + +class _WaitHelper: + """Helper class for Wait""" + + +__all__ = ["Wait"] 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 02ef841144d..facedaa431b 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 @@ -49,7 +49,17 @@ def _build_arguments_schema(cls, *args, **kwargs): return cls._args_schema def _execute_operations(self): + self.pre_operations() self.PerimeterAssociableResourceTypesList(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) @@ -168,9 +178,7 @@ def _build_schema_on_200(cls): ) public_dns_zones = cls._schema_on_200.value.Element.properties.public_dns_zones - public_dns_zones.Element = AAZStrType( - flags={"read_only": True}, - ) + public_dns_zones.Element = AAZStrType() tags = cls._schema_on_200.value.Element.tags tags.Element = AAZStrType() @@ -178,4 +186,8 @@ def _build_schema_on_200(cls): return cls._schema_on_200 +class _ListHelper: + """Helper class for List""" + + __all__ = ["List"] 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 5cbae89ea8e..f2ed182ae13 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 @@ -48,13 +48,11 @@ def _build_arguments_schema(cls, *args, **kwargs): 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, @@ -81,7 +79,17 @@ def _build_arguments_schema(cls, *args, **kwargs): return cls._args_schema def _execute_operations(self): + self.pre_operations() self.NspProfilesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) @@ -208,6 +216,10 @@ def _build_schema_on_200_201(cls): serialized_name="accessRulesVersion", flags={"read_only": True}, ) + properties.diagnostic_settings_version = AAZStrType( + serialized_name="diagnosticSettingsVersion", + flags={"read_only": True}, + ) tags = cls._schema_on_200_201.tags tags.Element = AAZStrType() @@ -215,4 +227,8 @@ def _build_schema_on_200_201(cls): return cls._schema_on_200_201 +class _CreateHelper: + """Helper class for Create""" + + __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 index 42252031fd5..c117cffb748 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 @@ -63,7 +63,17 @@ def _build_arguments_schema(cls, *args, **kwargs): return cls._args_schema def _execute_operations(self): + self.pre_operations() self.NspProfilesDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass class NspProfilesDelete(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" @@ -132,4 +142,8 @@ def on_204(self, session): pass +class _DeleteHelper: + """Helper class for Delete""" + + __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 index 6eac209f903..9c528a990e7 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 @@ -66,7 +66,17 @@ def _build_arguments_schema(cls, *args, **kwargs): return cls._args_schema def _execute_operations(self): + self.pre_operations() self.NspProfilesList(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) @@ -185,6 +195,10 @@ def _build_schema_on_200(cls): serialized_name="accessRulesVersion", flags={"read_only": True}, ) + properties.diagnostic_settings_version = AAZStrType( + serialized_name="diagnosticSettingsVersion", + flags={"read_only": True}, + ) tags = cls._schema_on_200.value.Element.tags tags.Element = AAZStrType() @@ -192,4 +206,8 @@ def _build_schema_on_200(cls): return cls._schema_on_200 +class _ListHelper: + """Helper class for List""" + + __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 index ef1280d963b..8f8d7723a36 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 @@ -62,7 +62,17 @@ def _build_arguments_schema(cls, *args, **kwargs): return cls._args_schema def _execute_operations(self): + self.pre_operations() self.NspProfilesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) @@ -169,6 +179,10 @@ def _build_schema_on_200(cls): serialized_name="accessRulesVersion", flags={"read_only": True}, ) + properties.diagnostic_settings_version = AAZStrType( + serialized_name="diagnosticSettingsVersion", + flags={"read_only": True}, + ) tags = cls._schema_on_200.tags tags.Element = AAZStrType() @@ -176,4 +190,8 @@ def _build_schema_on_200(cls): return cls._schema_on_200 +class _ShowHelper: + """Helper class for Show""" + + __all__ = ["Show"] 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 2564ac28834..31a57fe134e 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 @@ -57,19 +57,16 @@ def _build_arguments_schema(cls, *args, **kwargs): 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, @@ -108,6 +105,11 @@ def _build_arguments_schema(cls, *args, **kwargs): help="Direction that specifies whether the access rules is inbound/outbound.", enum={"Inbound": "Inbound", "Outbound": "Outbound"}, ) + _args_schema.email_addresses = AAZListArg( + options=["--email-addresses"], + arg_group="Properties", + help="Outbound rules email address format.", + ) _args_schema.fqdn = AAZListArg( options=["--fqdn"], arg_group="Properties", @@ -118,6 +120,11 @@ def _build_arguments_schema(cls, *args, **kwargs): arg_group="Properties", help="Inbound rule specified by the perimeter id.", ) + _args_schema.phone_numbers = AAZListArg( + options=["--phone-numbers"], + arg_group="Properties", + help="Outbound rules phone number format.", + ) _args_schema.subscriptions = AAZListArg( options=["--subscriptions"], arg_group="Properties", @@ -127,6 +134,9 @@ def _build_arguments_schema(cls, *args, **kwargs): address_prefixes = cls._args_schema.address_prefixes address_prefixes.Element = AAZStrArg() + email_addresses = cls._args_schema.email_addresses + email_addresses.Element = AAZStrArg() + fqdn = cls._args_schema.fqdn fqdn.Element = AAZStrArg() @@ -139,6 +149,9 @@ def _build_arguments_schema(cls, *args, **kwargs): help="NSP id in the ARM id format.", ) + phone_numbers = cls._args_schema.phone_numbers + phone_numbers.Element = AAZStrArg() + subscriptions = cls._args_schema.subscriptions subscriptions.Element = AAZObjectArg() @@ -150,7 +163,17 @@ def _build_arguments_schema(cls, *args, **kwargs): return cls._args_schema def _execute_operations(self): + self.pre_operations() self.NspAccessRulesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) @@ -246,14 +269,20 @@ def content(self): if properties is not None: properties.set_prop("addressPrefixes", AAZListType, ".address_prefixes") properties.set_prop("direction", AAZStrType, ".direction") + properties.set_prop("emailAddresses", AAZListType, ".email_addresses") properties.set_prop("fullyQualifiedDomainNames", AAZListType, ".fqdn") properties.set_prop("networkSecurityPerimeters", AAZListType, ".nsp") + properties.set_prop("phoneNumbers", AAZListType, ".phone_numbers") properties.set_prop("subscriptions", AAZListType, ".subscriptions") address_prefixes = _builder.get(".properties.addressPrefixes") if address_prefixes is not None: address_prefixes.set_elements(AAZStrType, ".") + email_addresses = _builder.get(".properties.emailAddresses") + if email_addresses is not None: + email_addresses.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, ".") @@ -266,6 +295,10 @@ def content(self): if _elements is not None: _elements.set_prop("id", AAZStrType, ".id") + phone_numbers = _builder.get(".properties.phoneNumbers") + if phone_numbers is not None: + phone_numbers.set_elements(AAZStrType, ".") + subscriptions = _builder.get(".properties.subscriptions") if subscriptions is not None: subscriptions.set_elements(AAZObjectType, ".") @@ -314,12 +347,18 @@ def _build_schema_on_200_201(cls): serialized_name="addressPrefixes", ) properties.direction = AAZStrType() + properties.email_addresses = AAZListType( + serialized_name="emailAddresses", + ) properties.fully_qualified_domain_names = AAZListType( serialized_name="fullyQualifiedDomainNames", ) properties.network_security_perimeters = AAZListType( serialized_name="networkSecurityPerimeters", ) + properties.phone_numbers = AAZListType( + serialized_name="phoneNumbers", + ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -329,6 +368,9 @@ def _build_schema_on_200_201(cls): address_prefixes = cls._schema_on_200_201.properties.address_prefixes address_prefixes.Element = AAZStrType() + email_addresses = cls._schema_on_200_201.properties.email_addresses + email_addresses.Element = AAZStrType() + fully_qualified_domain_names = cls._schema_on_200_201.properties.fully_qualified_domain_names fully_qualified_domain_names.Element = AAZStrType() @@ -345,6 +387,9 @@ def _build_schema_on_200_201(cls): flags={"read_only": True}, ) + phone_numbers = cls._schema_on_200_201.properties.phone_numbers + phone_numbers.Element = AAZStrType() + subscriptions = cls._schema_on_200_201.properties.subscriptions subscriptions.Element = AAZObjectType() @@ -357,4 +402,8 @@ def _build_schema_on_200_201(cls): return cls._schema_on_200_201 +class _CreateHelper: + """Helper class for Create""" + + __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 index aef785134ed..6e7ab6e3f38 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 @@ -69,7 +69,17 @@ def _build_arguments_schema(cls, *args, **kwargs): return cls._args_schema def _execute_operations(self): + self.pre_operations() self.NspAccessRulesDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass class NspAccessRulesDelete(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" @@ -142,4 +152,8 @@ def on_204(self, session): pass +class _DeleteHelper: + """Helper class for Delete""" + + __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 index 3265f7d8c26..25c1d9dac9a 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 @@ -71,7 +71,17 @@ def _build_arguments_schema(cls, *args, **kwargs): return cls._args_schema def _execute_operations(self): + self.pre_operations() self.NspAccessRulesList(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) @@ -194,12 +204,18 @@ def _build_schema_on_200(cls): serialized_name="addressPrefixes", ) properties.direction = AAZStrType() + properties.email_addresses = AAZListType( + serialized_name="emailAddresses", + ) properties.fully_qualified_domain_names = AAZListType( serialized_name="fullyQualifiedDomainNames", ) properties.network_security_perimeters = AAZListType( serialized_name="networkSecurityPerimeters", ) + properties.phone_numbers = AAZListType( + serialized_name="phoneNumbers", + ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -209,6 +225,9 @@ def _build_schema_on_200(cls): address_prefixes = cls._schema_on_200.value.Element.properties.address_prefixes address_prefixes.Element = AAZStrType() + email_addresses = cls._schema_on_200.value.Element.properties.email_addresses + email_addresses.Element = AAZStrType() + fully_qualified_domain_names = cls._schema_on_200.value.Element.properties.fully_qualified_domain_names fully_qualified_domain_names.Element = AAZStrType() @@ -225,6 +244,9 @@ def _build_schema_on_200(cls): flags={"read_only": True}, ) + phone_numbers = cls._schema_on_200.value.Element.properties.phone_numbers + phone_numbers.Element = AAZStrType() + subscriptions = cls._schema_on_200.value.Element.properties.subscriptions subscriptions.Element = AAZObjectType() @@ -237,4 +259,8 @@ def _build_schema_on_200(cls): return cls._schema_on_200 +class _ListHelper: + """Helper class for List""" + + __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 index b0951c8878c..5ba637ac52b 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 @@ -68,7 +68,17 @@ def _build_arguments_schema(cls, *args, **kwargs): return cls._args_schema def _execute_operations(self): + self.pre_operations() self.NspAccessRulesGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) @@ -179,12 +189,18 @@ def _build_schema_on_200(cls): serialized_name="addressPrefixes", ) properties.direction = AAZStrType() + properties.email_addresses = AAZListType( + serialized_name="emailAddresses", + ) properties.fully_qualified_domain_names = AAZListType( serialized_name="fullyQualifiedDomainNames", ) properties.network_security_perimeters = AAZListType( serialized_name="networkSecurityPerimeters", ) + properties.phone_numbers = AAZListType( + serialized_name="phoneNumbers", + ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -194,6 +210,9 @@ def _build_schema_on_200(cls): address_prefixes = cls._schema_on_200.properties.address_prefixes address_prefixes.Element = AAZStrType() + email_addresses = cls._schema_on_200.properties.email_addresses + email_addresses.Element = AAZStrType() + fully_qualified_domain_names = cls._schema_on_200.properties.fully_qualified_domain_names fully_qualified_domain_names.Element = AAZStrType() @@ -210,6 +229,9 @@ def _build_schema_on_200(cls): flags={"read_only": True}, ) + phone_numbers = cls._schema_on_200.properties.phone_numbers + phone_numbers.Element = AAZStrType() + subscriptions = cls._schema_on_200.properties.subscriptions subscriptions.Element = AAZObjectType() @@ -222,4 +244,8 @@ def _build_schema_on_200(cls): return cls._schema_on_200 +class _ShowHelper: + """Helper class for Show""" + + __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 index 63bba704a8b..307f3e45b17 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 @@ -107,6 +107,12 @@ def _build_arguments_schema(cls, *args, **kwargs): nullable=True, enum={"Inbound": "Inbound", "Outbound": "Outbound"}, ) + _args_schema.email_addresses = AAZListArg( + options=["--email-addresses"], + arg_group="Properties", + help="Outbound rules email address format.", + nullable=True, + ) _args_schema.fqdn = AAZListArg( options=["--fqdn"], arg_group="Properties", @@ -119,6 +125,12 @@ def _build_arguments_schema(cls, *args, **kwargs): help="Inbound rule specified by the perimeter id.", nullable=True, ) + _args_schema.phone_numbers = AAZListArg( + options=["--phone-numbers"], + arg_group="Properties", + help="Outbound rules phone number format.", + nullable=True, + ) _args_schema.subscriptions = AAZListArg( options=["--subscriptions"], arg_group="Properties", @@ -131,6 +143,11 @@ def _build_arguments_schema(cls, *args, **kwargs): nullable=True, ) + email_addresses = cls._args_schema.email_addresses + email_addresses.Element = AAZStrArg( + nullable=True, + ) + fqdn = cls._args_schema.fqdn fqdn.Element = AAZStrArg( nullable=True, @@ -148,6 +165,11 @@ def _build_arguments_schema(cls, *args, **kwargs): nullable=True, ) + phone_numbers = cls._args_schema.phone_numbers + phone_numbers.Element = AAZStrArg( + nullable=True, + ) + subscriptions = cls._args_schema.subscriptions subscriptions.Element = AAZObjectArg( nullable=True, @@ -162,10 +184,30 @@ def _build_arguments_schema(cls, *args, **kwargs): return cls._args_schema def _execute_operations(self): + self.pre_operations() self.NspAccessRulesGet(ctx=self.ctx)() + self.pre_instance_update(self.ctx.vars.instance) self.InstanceUpdateByJson(ctx=self.ctx)() self.InstanceUpdateByGeneric(ctx=self.ctx)() + self.post_instance_update(self.ctx.vars.instance) self.NspAccessRulesCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + @register_callback + def pre_instance_update(self, instance): + pass + + @register_callback + def post_instance_update(self, instance): + pass def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) @@ -258,7 +300,7 @@ def _build_schema_on_200(cls): return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() - _build_schema_nsp_access_rule_read(cls._schema_on_200) + _UpdateHelper._build_schema_nsp_access_rule_read(cls._schema_on_200) return cls._schema_on_200 @@ -361,7 +403,7 @@ def _build_schema_on_200_201(cls): return cls._schema_on_200_201 cls._schema_on_200_201 = AAZObjectType() - _build_schema_nsp_access_rule_read(cls._schema_on_200_201) + _UpdateHelper._build_schema_nsp_access_rule_read(cls._schema_on_200_201) return cls._schema_on_200_201 @@ -385,14 +427,20 @@ def _update_instance(self, instance): if properties is not None: properties.set_prop("addressPrefixes", AAZListType, ".address_prefixes") properties.set_prop("direction", AAZStrType, ".direction") + properties.set_prop("emailAddresses", AAZListType, ".email_addresses") properties.set_prop("fullyQualifiedDomainNames", AAZListType, ".fqdn") properties.set_prop("networkSecurityPerimeters", AAZListType, ".nsp") + properties.set_prop("phoneNumbers", AAZListType, ".phone_numbers") properties.set_prop("subscriptions", AAZListType, ".subscriptions") address_prefixes = _builder.get(".properties.addressPrefixes") if address_prefixes is not None: address_prefixes.set_elements(AAZStrType, ".") + email_addresses = _builder.get(".properties.emailAddresses") + if email_addresses is not None: + email_addresses.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, ".") @@ -405,6 +453,10 @@ def _update_instance(self, instance): if _elements is not None: _elements.set_prop("id", AAZStrType, ".id") + phone_numbers = _builder.get(".properties.phoneNumbers") + if phone_numbers is not None: + phone_numbers.set_elements(AAZStrType, ".") + subscriptions = _builder.get(".properties.subscriptions") if subscriptions is not None: subscriptions.set_elements(AAZObjectType, ".") @@ -428,85 +480,99 @@ def __call__(self, *args, **kwargs): ) -_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 +class _UpdateHelper: + """Helper class for Update""" + + _schema_nsp_access_rule_read = None + + @classmethod + def _build_schema_nsp_access_rule_read(cls, _schema): + if cls._schema_nsp_access_rule_read is not None: + _schema.id = cls._schema_nsp_access_rule_read.id + _schema.location = cls._schema_nsp_access_rule_read.location + _schema.name = cls._schema_nsp_access_rule_read.name + _schema.properties = cls._schema_nsp_access_rule_read.properties + _schema.tags = cls._schema_nsp_access_rule_read.tags + _schema.type = cls._schema_nsp_access_rule_read.type + return + + cls._schema_nsp_access_rule_read = _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.email_addresses = AAZListType( + serialized_name="emailAddresses", + ) + properties.fully_qualified_domain_names = AAZListType( + serialized_name="fullyQualifiedDomainNames", + ) + properties.network_security_perimeters = AAZListType( + serialized_name="networkSecurityPerimeters", + ) + properties.phone_numbers = AAZListType( + serialized_name="phoneNumbers", + ) + 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() + + email_addresses = _schema_nsp_access_rule_read.properties.email_addresses + email_addresses.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}, + ) + + phone_numbers = _schema_nsp_access_rule_read.properties.phone_numbers + phone_numbers.Element = AAZStrType() + + 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 = cls._schema_nsp_access_rule_read.id + _schema.location = cls._schema_nsp_access_rule_read.location + _schema.name = cls._schema_nsp_access_rule_read.name + _schema.properties = cls._schema_nsp_access_rule_read.properties + _schema.tags = cls._schema_nsp_access_rule_read.tags + _schema.type = cls._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 index ade6d0c3e08..daed0119d22 100644 --- a/src/nsp/azext_nsp/azext_metadata.json +++ b/src/nsp/azext_nsp/azext_metadata.json @@ -1,4 +1,4 @@ { "azext.isExperimental": true, - "azext.minCliCoreVersion": "2.38.0" + "azext.minCliCoreVersion": "2.45.0" } \ No newline at end of file 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 a37ed87f8e7..e6d5752265f 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.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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":"dff3bcf8-f8ff-4ef2-981a-2cb3fbc866e3","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":"1420f0fc-4ed0-46eb-8162-38c5257595be","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:34 GMT + - Tue, 11 Apr 2023 07:35:53 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 @@ -65,21 +65,21 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.9.7 (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 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_crud000001?api-version=2022-09-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-17T03:27:17Z"},"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":"2023-04-11T07:35:33Z","Created":"2023-04-11T07:35:42.2294016Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '343' + - '384' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:35 GMT + - Tue, 11 Apr 2023 07:35:53 GMT expires: - '-1' pragma: @@ -111,7 +111,7 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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: - - Thu, 17 Nov 2022 03:27:37 GMT + - Tue, 11 Apr 2023 07:35:54 GMT expires: - '-1' pragma: @@ -141,7 +141,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1195' status: code: 200 message: OK @@ -159,21 +159,21 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group --fqdn --direction User-Agent: - - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.9.7 (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 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_crud000001?api-version=2022-09-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-17T03:27:17Z"},"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":"2023-04-11T07:35:33Z","Created":"2023-04-11T07:35:42.2294016Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '343' + - '384' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:37 GMT + - Tue, 11 Apr 2023 07:35:54 GMT expires: - '-1' pragma: @@ -206,21 +206,21 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group --fqdn --direction User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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":[]}}' + 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":[],"emailAddresses":[],"phoneNumbers":[]}}' headers: cache-control: - no-cache content-length: - - '546' + - '584' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:40 GMT + - Tue, 11 Apr 2023 07:35:56 GMT expires: - '-1' pragma: @@ -254,21 +254,21 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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":[]}}' + 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":[],"emailAddresses":[],"phoneNumbers":[]}}' headers: cache-control: - no-cache content-length: - - '546' + - '584' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:44 GMT + - Tue, 11 Apr 2023 07:35:57 GMT expires: - '-1' pragma: @@ -300,21 +300,21 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group --fqdn --direction User-Agent: - - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.9.7 (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 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_crud000001?api-version=2022-09-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-17T03:27:17Z"},"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":"2023-04-11T07:35:33Z","Created":"2023-04-11T07:35:42.2294016Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '343' + - '384' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:44 GMT + - Tue, 11 Apr 2023 07:35:58 GMT expires: - '-1' pragma: @@ -342,21 +342,21 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group --fqdn --direction User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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":[]}}' + 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":[],"emailAddresses":[],"phoneNumbers":[]}}' headers: cache-control: - no-cache content-length: - - '546' + - '584' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:45 GMT + - Tue, 11 Apr 2023 07:35:59 GMT expires: - '-1' pragma: @@ -376,8 +376,9 @@ interactions: message: OK - request: body: '{"location": "eastus2euap", "name": "TestNspAccessRule", "properties": - {"addressPrefixes": [], "direction": "Outbound", "fullyQualifiedDomainNames": - ["www.abc.com"], "networkSecurityPerimeters": [], "subscriptions": []}}' + {"addressPrefixes": [], "direction": "Outbound", "emailAddresses": [], "fullyQualifiedDomainNames": + ["www.abc.com"], "networkSecurityPerimeters": [], "phoneNumbers": [], "subscriptions": + []}}' headers: Accept: - application/json @@ -388,27 +389,27 @@ interactions: Connection: - keep-alive Content-Length: - - '220' + - '262' Content-Type: - application/json ParameterSetName: - --name --profile-name --perimeter-name --resource-group --fqdn --direction User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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":[]}}' + 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":[],"emailAddresses":[],"phoneNumbers":[]}}' headers: cache-control: - no-cache content-length: - - '529' + - '567' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:46 GMT + - Tue, 11 Apr 2023 07:36:00 GMT expires: - '-1' pragma: @@ -424,7 +425,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1197' status: code: 200 message: OK @@ -442,21 +443,21 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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":[]}}' + 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":[],"emailAddresses":[],"phoneNumbers":[]}}' headers: cache-control: - no-cache content-length: - - '529' + - '567' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:48 GMT + - Tue, 11 Apr 2023 07:36:01 GMT expires: - '-1' pragma: @@ -488,21 +489,21 @@ interactions: ParameterSetName: - --perimeter-name --profile-name --resource-group User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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":[]}}]}' + 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":[],"emailAddresses":[],"phoneNumbers":[]}}]}' headers: cache-control: - no-cache content-length: - - '555' + - '593' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:50 GMT + - Tue, 11 Apr 2023 07:36:02 GMT expires: - '-1' pragma: @@ -536,7 +537,7 @@ interactions: ParameterSetName: - --name --perimeter-name --profile-name --resource-group --yes User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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 +549,7 @@ interactions: content-length: - '0' date: - - Thu, 17 Nov 2022 03:27:55 GMT + - Tue, 11 Apr 2023 07:36:03 GMT expires: - '-1' pragma: @@ -560,7 +561,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14999' + - '14998' status: code: 200 message: OK 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 f7ab78b6892..10e0faf73aa 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.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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":"b0699211-c569-4331-8e23-d8b1c7827e7e","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":"a32f5324-7a73-4811-a67c-8ae16a05b9df","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:36 GMT + - Tue, 11 Apr 2023 07:35:54 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 @@ -65,21 +65,21 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.9.7 (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 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2022-09-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-17T03:27:17Z"},"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":"2023-04-11T07:35:33Z","Created":"2023-04-11T07:35:42.1780826Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '349' + - '390' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:36 GMT + - Tue, 11 Apr 2023 07:35:54 GMT expires: - '-1' pragma: @@ -111,7 +111,7 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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: - - Thu, 17 Nov 2022 03:27:40 GMT + - Tue, 11 Apr 2023 07:35:56 GMT expires: - '-1' pragma: @@ -141,7 +141,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1196' status: code: 200 message: OK @@ -159,21 +159,21 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group --address-prefixes User-Agent: - - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.9.7 (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 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2022-09-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-17T03:27:17Z"},"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":"2023-04-11T07:35:33Z","Created":"2023-04-11T07:35:42.1780826Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '349' + - '390' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:41 GMT + - Tue, 11 Apr 2023 07:35:56 GMT expires: - '-1' pragma: @@ -206,21 +206,21 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group --address-prefixes User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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":[]}}' + 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":[],"emailAddresses":[],"phoneNumbers":[]}}' headers: cache-control: - no-cache content-length: - - '538' + - '576' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:45 GMT + - Tue, 11 Apr 2023 07:35:57 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 @@ -254,21 +254,21 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group --subscriptions User-Agent: - - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.9.7 (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 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2022-09-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-17T03:27:17Z"},"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":"2023-04-11T07:35:33Z","Created":"2023-04-11T07:35:42.1780826Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '349' + - '390' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:45 GMT + - Tue, 11 Apr 2023 07:35:57 GMT expires: - '-1' pragma: @@ -301,21 +301,21 @@ interactions: ParameterSetName: - --name --profile-name --perimeter-name --resource-group --subscriptions User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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":[]}}' + 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":[],"emailAddresses":[],"phoneNumbers":[]}}' headers: cache-control: - no-cache content-length: - - '604' + - '642' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:48 GMT + - Tue, 11 Apr 2023 07:35:59 GMT expires: - '-1' pragma: @@ -331,43 +331,88 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 200 message: OK - request: - body: '{"location": "eastus2euap", "name": "nsp_for_rule"}' + body: null headers: Accept: - application/json Accept-Encoding: - gzip, deflate CommandName: - - network perimeter create + - network perimeter profile access-rule create + Connection: + - keep-alive + ParameterSetName: + - --name --profile-name --perimeter-name --resource-group --email-addresses + --direction + User-Agent: + - AZURECLI/2.47.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.9.7 (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=2022-09-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":"2023-04-11T07:35:33Z","Created":"2023-04-11T07:35:42.1780826Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '390' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 11 Apr 2023 07:36:00 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_email", "properties": + {"direction": "Outbound", "emailAddresses": ["abc@microsoft.com", "bcd@microsoft.com"]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter profile access-rule create Connection: - keep-alive Content-Length: - - '51' + - '165' Content-Type: - application/json ParameterSetName: - - --name -l --resource-group + - --name --profile-name --perimeter-name --resource-group --email-addresses + --direction User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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 + 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_email?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":"34fe1e07-6a99-4d34-afee-653690b0de95","provisioningState":"Succeeded"}}' + string: '{"name":"TestNspAccessRule_email","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_email","type":"Microsoft.Network/networkSecurityPerimeters/profiles/accessRules","properties":{"provisioningState":"Succeeded","direction":"Outbound","addressPrefixes":[],"fullyQualifiedDomainNames":[],"subscriptions":[],"networkSecurityPerimeters":[],"emailAddresses":["abc@microsoft.com","bcd@microsoft.com"],"phoneNumbers":[]}}' headers: cache-control: - no-cache content-length: - - '398' + - '608' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:28:00 GMT + - Tue, 11 Apr 2023 07:36:05 GMT expires: - '-1' pragma: @@ -383,7 +428,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1196' status: code: 200 message: OK @@ -399,23 +444,23 @@ interactions: Connection: - keep-alive ParameterSetName: - - --name --profile-name --perimeter-name --resource-group --nsp + - --name --profile-name --perimeter-name --resource-group --phone-numbers --direction User-Agent: - - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.9.7 (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 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_accessrule_inbound000001?api-version=2022-09-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-17T03:27:17Z"},"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":"2023-04-11T07:35:33Z","Created":"2023-04-11T07:35:42.1780826Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '349' + - '390' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:28:00 GMT + - Tue, 11 Apr 2023 07:36:05 GMT expires: - '-1' pragma: @@ -430,8 +475,8 @@ interactions: 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"}]}}' + body: '{"location": "eastus2euap", "name": "TestNspAccessRule_sms", "properties": + {"direction": "Outbound", "phoneNumbers": ["+919898989898", "+929898989898"]}}' headers: Accept: - application/json @@ -442,27 +487,28 @@ interactions: Connection: - keep-alive Content-Length: - - '286' + - '153' Content-Type: - application/json ParameterSetName: - - --name --profile-name --perimeter-name --resource-group --nsp + - --name --profile-name --perimeter-name --resource-group --phone-numbers --direction User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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 + 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_sms?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":"34fe1e07-6a99-4d34-afee-653690b0de95","location":"eastus2euap"}]}}' + string: '{"name":"TestNspAccessRule_sms","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_accessrule_inbound000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile/accessRules/TestNspAccessRule_sms","type":"Microsoft.Network/networkSecurityPerimeters/profiles/accessRules","properties":{"provisioningState":"Succeeded","direction":"Outbound","addressPrefixes":[],"fullyQualifiedDomainNames":[],"subscriptions":[],"networkSecurityPerimeters":[],"emailAddresses":[],"phoneNumbers":["+91 + 9898989898","+92 9898989898"]}}' headers: cache-control: - no-cache content-length: - - '782' + - '598' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:28:03 GMT + - Tue, 11 Apr 2023 07:36:07 GMT expires: - '-1' pragma: @@ -478,7 +524,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' 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 6bf7001d67a..b5d905f5ff5 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.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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":"27e1cf3e-c620-4a77-8e15-c3c712cedf60","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":"f34e9061-7304-431d-bbd9-3586393bbaae","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:35 GMT + - Tue, 11 Apr 2023 07:35:53 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 @@ -65,21 +65,21 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.9.7 (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 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2022-09-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-17T03:27:17Z"},"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":"2023-04-11T07:35:33Z","Created":"2023-04-11T07:35:42.2379099Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '345' + - '386' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:35 GMT + - Tue, 11 Apr 2023 07:35:54 GMT expires: - '-1' pragma: @@ -111,7 +111,7 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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: - - Thu, 17 Nov 2022 03:27:38 GMT + - Tue, 11 Apr 2023 07:35:55 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 @@ -159,23 +159,23 @@ interactions: ParameterSetName: - --name -l --resource-group User-Agent: - - AZURECLI/2.42.0 azsdk-python-azure-mgmt-keyvault/10.1.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 azsdk-python-azure-mgmt-keyvault/10.2.0 Python/3.9.7 (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=2022-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvclinsp7?api-version=2023-02-01 response: body: - string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.KeyVault/vaults/kvnspclitest5'' + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.KeyVault/vaults/kvclinsp7'' 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' + - '238' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:39 GMT + - Tue, 11 Apr 2023 07:35:57 GMT expires: - '-1' pragma: @@ -203,27 +203,27 @@ interactions: ParameterSetName: - --name -l --resource-group User-Agent: - - python/3.10.5 (Windows-10-10.0.22621-SP0) AZURECLI/2.42.0 + - python/3.9.7 (Windows-10-10.0.22621-SP0) AZURECLI/2.47.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"}' + string: '{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users/$entity","businessPhones":[],"displayName":"Kaushal + Kumar","givenName":"Kaushal","jobTitle":"SOFTWARE ENGINEER II","mail":"kumarkaushal@microsoft.com","mobilePhone":null,"officeLocation":"BENGALURU + LUXOR-MIRPL/Mobile","preferredLanguage":null,"surname":"Kumar","userPrincipalName":"kumarkaushal@microsoft.com","id":"57bfe214-9fdd-4732-bc3d-410323de367f"}' headers: cache-control: - no-cache content-length: - - '419' + - '422' content-type: - application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:40 GMT + - Tue, 11 Apr 2023 07:35:57 GMT odata-version: - '4.0' request-id: - - 4bc621ad-27cf-4c03-8d6c-f8d489e89253 + - caa1ac32-9d2b-435c-9ce1-289ee9bc1d81 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":"MA1PEPF000012F3"}}' + - '{"ServerInfo":{"DataCenter":"South India","Slice":"E","Ring":"2","ScaleUnit":"000","RoleInstance":"MA1PEPF00004253"}}' x-ms-resource-unit: - '1' status: @@ -240,7 +240,7 @@ interactions: - 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", + "72f988bf-86f1-41af-91ab-2d7cd011db47", "objectId": "57bfe214-9fdd-4732-bc3d-410323de367f", "permissions": {"keys": ["all"], "secrets": ["all"], "certificates": ["all"], "storage": ["all"]}}], "enableSoftDelete": true, "softDeleteRetentionInDays": 90, "networkAcls": {"bypass": "AzureServices", "defaultAction": "Allow"}}}' @@ -260,21 +260,21 @@ interactions: ParameterSetName: - --name -l --resource-group User-Agent: - - AZURECLI/2.42.0 azsdk-python-azure-mgmt-keyvault/10.1.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 azsdk-python-azure-mgmt-keyvault/10.2.0 Python/3.9.7 (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=2022-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvclinsp7?api-version=2023-02-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-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"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvclinsp7","name":"kvclinsp7","type":"Microsoft.KeyVault/vaults","location":"eastus2euap","tags":{},"systemData":{"createdBy":"kumarkaushal@microsoft.com","createdByType":"User","createdAt":"2023-04-11T07:36:01.498Z","lastModifiedBy":"kumarkaushal@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-04-11T07:36:01.498Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"57bfe214-9fdd-4732-bc3d-410323de367f","permissions":{"keys":["all"],"secrets":["all"],"certificates":["all"],"storage":["all"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"softDeleteRetentionInDays":90,"vaultUri":"https://kvclinsp7.vault.azure.net","provisioningState":"RegisteringDns","publicNetworkAccess":"Enabled"}}' headers: cache-control: - no-cache content-length: - - '1005' + - '993' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:49 GMT + - Tue, 11 Apr 2023 07:36:05 GMT expires: - '-1' pragma: @@ -292,9 +292,9 @@ interactions: x-content-type-options: - nosniff x-ms-keyvault-service-version: - - 1.5.564.0 + - 1.5.692.1 x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1196' status: code: 200 message: OK @@ -312,21 +312,21 @@ interactions: ParameterSetName: - --name -l --resource-group User-Agent: - - AZURECLI/2.42.0 azsdk-python-azure-mgmt-keyvault/10.1.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 azsdk-python-azure-mgmt-keyvault/10.2.0 Python/3.9.7 (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=2022-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvclinsp7?api-version=2023-02-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-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"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvclinsp7","name":"kvclinsp7","type":"Microsoft.KeyVault/vaults","location":"eastus2euap","tags":{},"systemData":{"createdBy":"kumarkaushal@microsoft.com","createdByType":"User","createdAt":"2023-04-11T07:36:01.498Z","lastModifiedBy":"kumarkaushal@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-04-11T07:36:01.498Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"57bfe214-9fdd-4732-bc3d-410323de367f","permissions":{"keys":["all"],"secrets":["all"],"certificates":["all"],"storage":["all"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"softDeleteRetentionInDays":90,"vaultUri":"https://kvclinsp7.vault.azure.net/","provisioningState":"Succeeded","publicNetworkAccess":"Enabled"}}' headers: cache-control: - no-cache content-length: - - '1001' + - '989' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:28:19 GMT + - Tue, 11 Apr 2023 07:36:35 GMT expires: - '-1' pragma: @@ -344,7 +344,7 @@ interactions: x-content-type-options: - nosniff x-ms-keyvault-service-version: - - 1.5.564.0 + - 1.5.692.1 status: code: 200 message: OK @@ -363,21 +363,21 @@ interactions: - --name --perimeter-name --resource-group --access-mode --private-link-resource --profile User-Agent: - - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.9.7 (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 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2022-09-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-17T03:27:17Z"},"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":"2023-04-11T07:35:33Z","Created":"2023-04-11T07:35:42.2379099Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '345' + - '386' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:28:20 GMT + - Tue, 11 Apr 2023 07:36:35 GMT expires: - '-1' pragma: @@ -393,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.KeyVault/vaults/kvnspclitest5"}, + {"accessMode": "Learning", "privateLinkResource": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvclinsp7"}, "profile": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"}}}' headers: Accept: @@ -405,47 +405,45 @@ interactions: Connection: - keep-alive Content-Length: - - '510' + - '506' Content-Type: - application/json ParameterSetName: - --name --perimeter-name --resource-group --access-mode --private-link-resource --profile User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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"}}' + 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/kvclinsp7"},"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' + - '833' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:28:28 GMT + - Tue, 11 Apr 2023 07:36:39 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' + - '1195' status: - code: 200 - message: OK + code: 201 + message: Created - request: body: null headers: @@ -460,21 +458,21 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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"}}' + 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/kvclinsp7"},"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' + - '833' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:28:29 GMT + - Tue, 11 Apr 2023 07:36:42 GMT expires: - '-1' pragma: @@ -507,21 +505,21 @@ interactions: - --name --perimeter-name --resource-group --access-mode --private-link-resource --profile User-Agent: - - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.9.7 (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 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_association_crud000001?api-version=2022-09-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-17T03:27:17Z"},"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":"2023-04-11T07:35:33Z","Created":"2023-04-11T07:35:42.2379099Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '345' + - '386' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:28:30 GMT + - Tue, 11 Apr 2023 07:36:42 GMT expires: - '-1' pragma: @@ -550,21 +548,21 @@ interactions: - --name --perimeter-name --resource-group --access-mode --private-link-resource --profile User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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"}}' + 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/kvclinsp7"},"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' + - '833' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:28:30 GMT + - Tue, 11 Apr 2023 07:36:43 GMT expires: - '-1' pragma: @@ -584,7 +582,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.KeyVault/vaults/kvclinsp7"}, "profile": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter/profiles/TestNspProfile"}}}' headers: Accept: @@ -596,28 +594,28 @@ interactions: Connection: - keep-alive Content-Length: - - '510' + - '506' Content-Type: - application/json ParameterSetName: - --name --perimeter-name --resource-group --access-mode --private-link-resource --profile User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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"}}' + 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/kvclinsp7"},"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' + - '833' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:28:31 GMT + - Tue, 11 Apr 2023 07:36:45 GMT expires: - '-1' pragma: @@ -633,7 +631,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1195' status: code: 200 message: OK @@ -651,21 +649,21 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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"}}' + 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/kvclinsp7"},"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' + - '833' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:28:34 GMT + - Tue, 11 Apr 2023 07:36:46 GMT expires: - '-1' pragma: @@ -697,21 +695,21 @@ interactions: ParameterSetName: - --perimeter-name --resource-group User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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"}}]}' + 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/kvclinsp7"},"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' + - '859' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:28:37 GMT + - Tue, 11 Apr 2023 07:36:48 GMT expires: - '-1' pragma: @@ -745,7 +743,7 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group --yes User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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 +753,7 @@ interactions: cache-control: - no-cache date: - - Thu, 17 Nov 2022 03:28:40 GMT + - Tue, 11 Apr 2023 07:36:49 GMT expires: - '-1' pragma: @@ -767,7 +765,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14999' + - '14997' status: code: 204 message: No Content @@ -785,7 +783,7 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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 +798,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:28:41 GMT + - Tue, 11 Apr 2023 07:36:51 GMT expires: - '-1' pragma: @@ -830,9 +828,9 @@ interactions: ParameterSetName: - --name --resource-group --no-wait User-Agent: - - AZURECLI/2.42.0 azsdk-python-azure-mgmt-keyvault/10.1.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 azsdk-python-azure-mgmt-keyvault/10.2.0 Python/3.9.7 (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=2022-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvclinsp7?api-version=2023-02-01 response: body: string: '' @@ -842,7 +840,7 @@ interactions: content-length: - '0' date: - - Thu, 17 Nov 2022 03:28:52 GMT + - Tue, 11 Apr 2023 07:37:02 GMT expires: - '-1' pragma: @@ -856,9 +854,9 @@ interactions: x-content-type-options: - nosniff x-ms-keyvault-service-version: - - 1.5.564.0 + - 1.5.692.1 x-ms-ratelimit-remaining-subscription-deletes: - - '14999' + - '14998' status: code: 200 message: OK @@ -876,21 +874,21 @@ interactions: ParameterSetName: - --name -l --no-wait User-Agent: - - AZURECLI/2.42.0 azsdk-python-azure-mgmt-keyvault/10.1.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 azsdk-python-azure-mgmt-keyvault/10.2.0 Python/3.9.7 (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=2022-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/deletedVaults/kvclinsp7?api-version=2023-02-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-17T03:28:43Z","scheduledPurgeDate":"2023-02-15T03:28:43Z"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/deletedVaults/kvclinsp7","name":"kvclinsp7","type":"Microsoft.KeyVault/deletedVaults","properties":{"vaultId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_association_crud000001/providers/Microsoft.KeyVault/vaults/kvclinsp7","location":"eastus2euap","tags":{},"deletionDate":"2023-04-11T07:36:54Z","scheduledPurgeDate":"2023-07-10T07:36:54Z"}}' headers: cache-control: - no-cache content-length: - - '497' + - '485' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:28:54 GMT + - Tue, 11 Apr 2023 07:37:03 GMT expires: - '-1' pragma: @@ -908,7 +906,7 @@ interactions: x-content-type-options: - nosniff x-ms-keyvault-service-version: - - 1.5.564.0 + - 1.5.692.1 status: code: 200 message: OK @@ -928,9 +926,9 @@ interactions: ParameterSetName: - --name -l --no-wait User-Agent: - - AZURECLI/2.42.0 azsdk-python-azure-mgmt-keyvault/10.1.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 azsdk-python-azure-mgmt-keyvault/10.2.0 Python/3.9.7 (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=2022-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/deletedVaults/kvclinsp7/purge?api-version=2023-02-01 response: body: string: '' @@ -940,11 +938,11 @@ interactions: content-length: - '0' date: - - Thu, 17 Nov 2022 03:28:55 GMT + - Tue, 11 Apr 2023 07:37:04 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/operationResults/VVR8MDYzODA0MjUyNTM3MDAyNjQ0M3w5NkY1ODU0NTYxREI0NDE3OUNCMkM3ODM5OTA4MTBDMg?api-version=2022-07-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus2euap/operationResults/VVR8MDYzODE2Nzk1NDI1ODQwOTkzN3w5ODdCMkQ1NjE0MjM0QjVBQUIyNzg4QTczNkUzNUUwRg?api-version=2023-02-01 pragma: - no-cache server: @@ -956,7 +954,7 @@ interactions: x-content-type-options: - nosniff x-ms-keyvault-service-version: - - 1.5.564.0 + - 1.5.692.1 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 13b5a83640c..d97ffc98472 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.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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":"385bf697-e115-4e47-9cc9-f055297ae4a7","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":"2cf5cc75-a2a9-4a1d-b4fc-735aada2fa36","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:36 GMT + - Tue, 11 Apr 2023 07:35:53 GMT expires: - '-1' pragma: @@ -47,7 +47,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1195' status: code: 200 message: OK @@ -65,12 +65,12 @@ interactions: ParameterSetName: - --resource-group --name User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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":"385bf697-e115-4e47-9cc9-f055297ae4a7","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":"2cf5cc75-a2a9-4a1d-b4fc-735aada2fa36","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -79,7 +79,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:38 GMT + - Tue, 11 Apr 2023 07:35:55 GMT expires: - '-1' pragma: @@ -111,12 +111,12 @@ interactions: ParameterSetName: - --resource-group User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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":"385bf697-e115-4e47-9cc9-f055297ae4a7","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":"2cf5cc75-a2a9-4a1d-b4fc-735aada2fa36","provisioningState":"Succeeded"}}]}' headers: cache-control: - no-cache @@ -125,7 +125,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:40 GMT + - Tue, 11 Apr 2023 07:35:57 GMT expires: - '-1' pragma: @@ -159,7 +159,7 @@ interactions: ParameterSetName: - -g --name --yes User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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: - - Thu, 17 Nov 2022 03:27:50 GMT + - Tue, 11 Apr 2023 07:36:03 GMT expires: - '-1' pragma: @@ -201,7 +201,7 @@ interactions: ParameterSetName: - -l User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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: - - Thu, 17 Nov 2022 03:27:51 GMT + - Tue, 11 Apr 2023 07:36:05 GMT expires: - '-1' pragma: @@ -247,21 +247,21 @@ interactions: ParameterSetName: - -l User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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"]}},{"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"]}}]}' + 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"]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.DigitalTwins.digitalTwinsInstances","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.DigitalTwins.digitalTwinsInstances","properties":{"providerNamespace":"Microsoft.DigitalTwins","resourceType":"digitalTwinsInstances","displayName":"Microsoft.DigitalTwins/digitalTwinsInstances","apiVersion":"2023-06-30-preview","publicDnsZones":["digitaltwins.azure.net","digitaltwins.azure.cn","azuredigitaltwins-ppe.net"]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.Attestation.attestationProviders","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.Attestation.attestationProviders","properties":{"providerNamespace":"Microsoft.Attestation","resourceType":"attestationProviders","displayName":"Microsoft.Attestation/attestationProviders","apiVersion":"2023-03-01-preview","publicDnsZones":["attest.azure.net","attest.azure.us"]}},{"type":"Microsoft.Network/PerimeterAssociableResourceTypes","name":"Microsoft.BotService.botServices","id":"/subscriptions/{subscriptionId}/providers/Microsoft.Network/PerimeterAssociableResourceTypes/Microsoft.BotService.botServices","properties":{"providerNamespace":"Microsoft.BotService","resourceType":"botServices","displayName":"Microsoft.BotService/botServices","apiVersion":"2022-06-15-preview","publicDnsZones":["botframework.com"]}}]}' headers: cache-control: - no-cache content-length: - - '2503' + - '4002' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:27:52 GMT + - Tue, 11 Apr 2023 07:36:05 GMT expires: - '-1' pragma: diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_link_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_link_crud.yaml new file mode 100644 index 00000000000..4b36ee63a34 --- /dev/null +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_link_crud.yaml @@ -0,0 +1,296 @@ +interactions: +- request: + body: '{"location": "eastus2euap", "name": "TestNetworkSecurityPerimeter1"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter create + Connection: + - keep-alive + Content-Length: + - '68' + Content-Type: + - application/json + ParameterSetName: + - --name -l --resource-group + User-Agent: + - AZURECLI/2.46.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter1?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNetworkSecurityPerimeter1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter1","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"85f4b916-7a6b-407f-9082-450ca5e84fe1","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '423' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Apr 2023 11:27:48 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: + - '1197' + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2euap", "name": "TestNetworkSecurityPerimeter2"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter create + Connection: + - keep-alive + Content-Length: + - '68' + Content-Type: + - application/json + ParameterSetName: + - --name -l --resource-group + User-Agent: + - AZURECLI/2.46.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNetworkSecurityPerimeter2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"96d77576-72f2-4db0-b6ed-6f5f471f65db","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '423' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Apr 2023 11:27: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: + - '1197' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"autoApprovedRemotePerimeterResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2", + "localInboundProfiles": ["*"], "remoteInboundProfiles": ["*"]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter link create + Connection: + - keep-alive + Content-Length: + - '299' + Content-Type: + - application/json + ParameterSetName: + - --name --perimeter-name --resource-group --auto-approved-remote-perimeter-resource-id + --local-inbound-profiles --remote-inbound-profiles + User-Agent: + - AZURECLI/2.46.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter1/links/TestNspLink1?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspLink1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter1/links/TestNspLink1","type":"Microsoft.Network/networkSecurityPerimeters/links","properties":{"provisioningState":"Accepted","autoApprovedRemotePerimeterResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2","remotePerimeterGuid":"96d77576-72f2-4db0-b6ed-6f5f471f65db","remotePerimeterLocation":"eastus2euap","localInboundProfiles":["*"],"localOutboundProfiles":["*"],"remoteInboundProfiles":["*"],"remoteOutboundProfiles":["*"],"status":"Approved","description":"Auto + Approved."}}' + headers: + cache-control: + - no-cache + content-length: + - '820' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Apr 2023 11:28: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: + - '1196' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter link delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --name --perimeter-name --resource-group --yes + User-Agent: + - AZURECLI/2.46.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter1/links/TestNspLink1?api-version=2021-02-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 05 Apr 2023 11:28: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: + - '14997' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter link-reference list + Connection: + - keep-alive + ParameterSetName: + - --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.46.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2/linkReferences?api-version=2021-02-01-preview + response: + body: + string: '{"nextLink":"","value":[{"name":"Ref-from-TestNspLink1-85f4b916-7a6b-407f-9082-450ca5e84fe1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2/linkReferences/Ref-from-TestNspLink1-85f4b916-7a6b-407f-9082-450ca5e84fe1","type":"Microsoft.Network/networkSecurityPerimeters/linkReferences","properties":{"provisioningState":"Accepted","remotePerimeterResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter1","remotePerimeterGuid":"85f4b916-7a6b-407f-9082-450ca5e84fe1","remotePerimeterLocation":"eastus2euap","localInboundProfiles":["*"],"localOutboundProfiles":["*"],"remoteInboundProfiles":["*"],"remoteOutboundProfiles":["*"],"status":"Disconnected","description":"Auto + Approved."}}]}' + headers: + cache-control: + - no-cache + content-length: + - '948' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 05 Apr 2023 11:28: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 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter link-reference delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --perimeter-name --resource-group --name --yes + User-Agent: + - AZURECLI/2.46.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2/linkReferences/Ref-from-TestNspLink1-85f4b916-7a6b-407f-9082-450ca5e84fe1?api-version=2021-02-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 05 Apr 2023 11:28: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: + - '14998' + status: + code: 200 + message: OK +version: 1 diff --git a/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_link_linkreference_crud.yaml b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_link_linkreference_crud.yaml new file mode 100644 index 00000000000..6dc17338a90 --- /dev/null +++ b/src/nsp/azext_nsp/tests/latest/recordings/test_nsp_link_linkreference_crud.yaml @@ -0,0 +1,583 @@ +interactions: +- request: + body: '{"location": "eastus2euap", "name": "TestNetworkSecurityPerimeter1"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter create + Connection: + - keep-alive + Content-Length: + - '68' + Content-Type: + - application/json + ParameterSetName: + - --name -l --resource-group + User-Agent: + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter1?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNetworkSecurityPerimeter1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter1","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"cfd360c2-58dc-468e-bef6-30648fd0fa4c","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '423' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 11 Apr 2023 07:36:19 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: + - '1197' + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2euap", "name": "TestNetworkSecurityPerimeter2"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter create + Connection: + - keep-alive + Content-Length: + - '68' + Content-Type: + - application/json + ParameterSetName: + - --name -l --resource-group + User-Agent: + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNetworkSecurityPerimeter2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2","location":"eastus2euap","type":"Microsoft.Network/networkSecurityPerimeters","tags":{},"etag":"","properties":{"perimeterGuid":"e1ef7f00-2649-40c9-8df0-de51b3e04789","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '423' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 11 Apr 2023 07: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 + x-ms-ratelimit-remaining-subscription-writes: + - '1195' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"autoApprovedRemotePerimeterResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2", + "localInboundProfiles": ["*"], "remoteInboundProfiles": ["*"]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter link create + Connection: + - keep-alive + Content-Length: + - '299' + Content-Type: + - application/json + ParameterSetName: + - --name --perimeter-name --resource-group --auto-remote-nsp-id --local-inbound-profile + --remote-inbound-profile + User-Agent: + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter1/links/TestNspLink1?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspLink1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter1/links/TestNspLink1","type":"Microsoft.Network/networkSecurityPerimeters/links","properties":{"provisioningState":"Accepted","autoApprovedRemotePerimeterResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2","remotePerimeterGuid":"e1ef7f00-2649-40c9-8df0-de51b3e04789","remotePerimeterLocation":"eastus2euap","localInboundProfiles":["*"],"localOutboundProfiles":["*"],"remoteInboundProfiles":["*"],"remoteOutboundProfiles":["*"],"status":"Approved","description":"Auto + Approved."}}' + headers: + cache-control: + - no-cache + content-length: + - '820' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 11 Apr 2023 07:36: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 + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter link show + Connection: + - keep-alive + ParameterSetName: + - --name --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter1/links/TestNspLink1?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspLink1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter1/links/TestNspLink1","type":"Microsoft.Network/networkSecurityPerimeters/links","properties":{"provisioningState":"Succeeded","autoApprovedRemotePerimeterResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2","remotePerimeterGuid":"e1ef7f00-2649-40c9-8df0-de51b3e04789","remotePerimeterLocation":"eastus2euap","localInboundProfiles":["*"],"localOutboundProfiles":["*"],"remoteInboundProfiles":["*"],"remoteOutboundProfiles":["*"],"status":"Approved","description":"Auto + Approved."}}' + headers: + cache-control: + - no-cache + content-length: + - '821' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 11 Apr 2023 07:36: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: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter link list + Connection: + - keep-alive + ParameterSetName: + - --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter1/links?api-version=2021-02-01-preview + response: + body: + string: '{"nextLink":"","value":[{"name":"TestNspLink1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter1/links/TestNspLink1","type":"Microsoft.Network/networkSecurityPerimeters/links","properties":{"provisioningState":"Succeeded","autoApprovedRemotePerimeterResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2","remotePerimeterGuid":"e1ef7f00-2649-40c9-8df0-de51b3e04789","remotePerimeterLocation":"eastus2euap","localInboundProfiles":["*"],"localOutboundProfiles":["*"],"remoteInboundProfiles":["*"],"remoteOutboundProfiles":["*"],"status":"Approved","description":"Auto + Approved."}}]}' + headers: + cache-control: + - no-cache + content-length: + - '847' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 11 Apr 2023 07:36:33 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 link update + Connection: + - keep-alive + ParameterSetName: + - --name --perimeter-name --resource-group --local-inbound-profile + User-Agent: + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter1/links/TestNspLink1?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspLink1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter1/links/TestNspLink1","type":"Microsoft.Network/networkSecurityPerimeters/links","properties":{"provisioningState":"Succeeded","autoApprovedRemotePerimeterResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2","remotePerimeterGuid":"e1ef7f00-2649-40c9-8df0-de51b3e04789","remotePerimeterLocation":"eastus2euap","localInboundProfiles":["*"],"localOutboundProfiles":["*"],"remoteInboundProfiles":["*"],"remoteOutboundProfiles":["*"],"status":"Approved","description":"Auto + Approved."}}' + headers: + cache-control: + - no-cache + content-length: + - '821' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 11 Apr 2023 07:36: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 + status: + code: 200 + message: OK +- request: + body: '{"properties": {"autoApprovedRemotePerimeterResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2", + "description": "Auto Approved.", "localInboundProfiles": ["*"], "remoteInboundProfiles": + ["*"]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter link update + Connection: + - keep-alive + Content-Length: + - '332' + Content-Type: + - application/json + ParameterSetName: + - --name --perimeter-name --resource-group --local-inbound-profile + User-Agent: + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter1/links/TestNspLink1?api-version=2021-02-01-preview + response: + body: + string: '{"name":"TestNspLink1","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter1/links/TestNspLink1","type":"Microsoft.Network/networkSecurityPerimeters/links","properties":{"provisioningState":"Accepted","autoApprovedRemotePerimeterResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2","remotePerimeterGuid":"e1ef7f00-2649-40c9-8df0-de51b3e04789","remotePerimeterLocation":"eastus2euap","localInboundProfiles":["*"],"localOutboundProfiles":["*"],"remoteInboundProfiles":["*"],"remoteOutboundProfiles":["*"],"status":"Approved","description":"Auto + Approved."}}' + headers: + cache-control: + - no-cache + content-length: + - '820' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 11 Apr 2023 07:36: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: + - '1195' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter link delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --name --perimeter-name --resource-group --yes + User-Agent: + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter1/links/TestNspLink1?api-version=2021-02-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 11 Apr 2023 07:36:39 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: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter link-reference list + Connection: + - keep-alive + ParameterSetName: + - --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2/linkReferences?api-version=2021-02-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + connection: + - close + content-length: + - '0' + date: + - Tue, 11 Apr 2023 07:37:02 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - service + status: + code: 500 + message: Internal Server Error +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter link-reference list + Connection: + - keep-alive + ParameterSetName: + - --perimeter-name --resource-group + User-Agent: + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2/linkReferences?api-version=2021-02-01-preview + response: + body: + string: '{"nextLink":"","value":[{"name":"Ref-from-TestNspLink1-cfd360c2-58dc-468e-bef6-30648fd0fa4c","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2/linkReferences/Ref-from-TestNspLink1-cfd360c2-58dc-468e-bef6-30648fd0fa4c","type":"Microsoft.Network/networkSecurityPerimeters/linkReferences","properties":{"provisioningState":"Accepted","remotePerimeterResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter1","remotePerimeterGuid":"cfd360c2-58dc-468e-bef6-30648fd0fa4c","remotePerimeterLocation":"eastus2euap","localInboundProfiles":["*"],"localOutboundProfiles":["*"],"remoteInboundProfiles":["*"],"remoteOutboundProfiles":["*"],"status":"Disconnected","description":"Auto + Approved."}}]}' + headers: + cache-control: + - no-cache + content-length: + - '948' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 11 Apr 2023 07:37: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: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter link-reference show + Connection: + - keep-alive + ParameterSetName: + - --perimeter-name --resource-group --name + User-Agent: + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2/linkReferences/Ref-from-TestNspLink1-cfd360c2-58dc-468e-bef6-30648fd0fa4c?api-version=2021-02-01-preview + response: + body: + string: '{"name":"Ref-from-TestNspLink1-cfd360c2-58dc-468e-bef6-30648fd0fa4c","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2/linkReferences/Ref-from-TestNspLink1-cfd360c2-58dc-468e-bef6-30648fd0fa4c","type":"Microsoft.Network/networkSecurityPerimeters/linkReferences","properties":{"provisioningState":"Accepted","remotePerimeterResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter1","remotePerimeterGuid":"cfd360c2-58dc-468e-bef6-30648fd0fa4c","remotePerimeterLocation":"eastus2euap","localInboundProfiles":["*"],"localOutboundProfiles":["*"],"remoteInboundProfiles":["*"],"remoteOutboundProfiles":["*"],"status":"Disconnected","description":"Auto + Approved."}}' + headers: + cache-control: + - no-cache + content-length: + - '922' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 11 Apr 2023 07:37: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 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - network perimeter link-reference delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --perimeter-name --resource-group --name --yes + User-Agent: + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (Windows-10-10.0.22621-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_nsp_link_crud000001/providers/Microsoft.Network/networkSecurityPerimeters/TestNetworkSecurityPerimeter2/linkReferences/Ref-from-TestNspLink1-cfd360c2-58dc-468e-bef6-30648fd0fa4c?api-version=2021-02-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 11 Apr 2023 07:37: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: + - '14995' + 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 index 40dc44f4293..e34fa404b5f 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.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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":"b6d13203-58f7-41f9-90ab-28e675155a80","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":"3a17a3fb-b089-4abd-af09-2b0f56cd4b37","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -31,7 +31,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:28:11 GMT + - Tue, 11 Apr 2023 07:36:18 GMT expires: - '-1' pragma: @@ -47,7 +47,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1194' status: code: 200 message: OK @@ -65,21 +65,21 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.42.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.9.7 (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 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test_nsp_profile_crud000001?api-version=2022-09-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-17T03:28:02Z"},"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":"2023-04-11T07:36:05Z","Created":"2023-04-11T07:36:13.7624643Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '337' + - '378' content-type: - application/json; charset=utf-8 date: - - Thu, 17 Nov 2022 03:28:11 GMT + - Tue, 11 Apr 2023 07:36:19 GMT expires: - '-1' pragma: @@ -111,7 +111,7 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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: - - Thu, 17 Nov 2022 03:28:13 GMT + - Tue, 11 Apr 2023 07:36:20 GMT expires: - '-1' pragma: @@ -141,7 +141,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1198' status: code: 200 message: OK @@ -159,7 +159,7 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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: - - Thu, 17 Nov 2022 03:28:14 GMT + - Tue, 11 Apr 2023 07:36:22 GMT expires: - '-1' pragma: @@ -205,7 +205,7 @@ interactions: ParameterSetName: - --perimeter-name --resource-group User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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: - - Thu, 17 Nov 2022 03:28:16 GMT + - Tue, 11 Apr 2023 07:36:22 GMT expires: - '-1' pragma: @@ -253,7 +253,7 @@ interactions: ParameterSetName: - --name --perimeter-name --resource-group --yes User-Agent: - - AZURECLI/2.42.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.5 (Windows-10-10.0.22621-SP0) + - AZURECLI/2.47.0 (AAZ) azsdk-python-core/1.24.0 Python/3.9.7 (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: - - Thu, 17 Nov 2022 03:28:19 GMT + - Tue, 11 Apr 2023 07:36:25 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 dfcfedc3936..3fa519e8a9a 100644 --- a/src/nsp/azext_nsp/tests/latest/test_nsp.py +++ b/src/nsp/azext_nsp/tests/latest/test_nsp.py @@ -7,7 +7,6 @@ from azure.cli.testsdk import * - class NspScenario(ScenarioTest): @ResourceGroupPreparer(name_prefix='test_nsp_crud', location='eastus2euap') @@ -81,6 +80,8 @@ def test_nsp_accessrule_inbound(self, resource_group): 'ip_accessrule_name': 'TestNspAccessRule_ip', 'sub_accessrule_name': 'TestNspAccessRule_subscription', 'nsp_accessrule_name': 'TestNspAccessRule_nsp', + 'sms_accessrule_name': 'TestNspAccessRule_sms', + 'email_accessrule_name': 'TestNspAccessRule_email', 'sub': self.get_subscription_id() }) @@ -96,20 +97,30 @@ def test_nsp_accessrule_inbound(self, resource_group): 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") ]) + """ + + # Email based access rule + self.cmd('az network perimeter profile access-rule create --name {email_accessrule_name} --profile-name {profile_name} --perimeter-name {nsp_name} --resource-group {rg} --email-addresses "[\'abc@microsoft.com\', \'bcd@microsoft.com\']" --direction "Outbound"') + + # SMS based access rule + self.cmd('az network perimeter profile access-rule create --name {sms_accessrule_name} --profile-name {profile_name} --perimeter-name {nsp_name} --resource-group {rg} --phone-numbers "[\'+919898989898\', \'+929898989898\']" --direction "Outbound"') @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', + 'resource_name': 'kvclinsp7', 'sub': self.get_subscription_id() }) @@ -141,4 +152,43 @@ 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') \ No newline at end of file + self.cmd('keyvault purge --name {resource_name} -l eastus2euap --no-wait') + + @ResourceGroupPreparer(name_prefix='test_nsp_link_crud', location='eastus2euap') + def test_nsp_link_linkreference_crud(self, resource_group): + + self.kwargs.update({ + 'sub': self.get_subscription_id(), + 'nsp1_name': 'TestNetworkSecurityPerimeter1', + 'nsp2_name': 'TestNetworkSecurityPerimeter2', + 'link1_name': 'TestNspLink1' + }) + + self.cmd('network perimeter create --name {nsp1_name} -l eastus2euap --resource-group {rg}') + self.cmd('network perimeter create --name {nsp2_name} -l eastus2euap --resource-group {rg}') + + # create link + self.cmd('az network perimeter link create --name {link1_name} --perimeter-name {nsp1_name} --resource-group {rg} --auto-remote-nsp-id "/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Network/networkSecurityPerimeters/{nsp2_name}" --local-inbound-profile "[\'*\']" --remote-inbound-profile "[\'*\']" ') + + # show link + link1_obj = self.cmd('az network perimeter link show --name {link1_name} --perimeter-name {nsp1_name} --resource-group {rg}').get_output_in_json() + + # get list of links + link1_obj = self.cmd('az network perimeter link list --perimeter-name {nsp1_name} --resource-group {rg}').get_output_in_json() + + # update link + self.cmd('az network perimeter link update --name {link1_name} --perimeter-name {nsp1_name} --resource-group {rg} --local-inbound-profile "[\'*\']"') + + # delete link + self.cmd('az network perimeter link delete --name {link1_name} --perimeter-name {nsp1_name} --resource-group {rg} --yes') + + # list link reference + link_ref2_list = self.cmd('az network perimeter link-reference list --perimeter-name {nsp2_name} --resource-group {rg}').get_output_in_json() + + self.kwargs.update({'ref2_name': link_ref2_list[0]['name']}) + + # show link reference + self.cmd('az network perimeter link-reference show --perimeter-name {nsp2_name} --resource-group {rg} --name {ref2_name}') + + # delete link reference + self.cmd('az network perimeter link-reference delete --perimeter-name {nsp2_name} --resource-group {rg} --name {ref2_name} --yes') diff --git a/src/nsp/setup.py b/src/nsp/setup.py index ce54b526922..de698ed47ef 100644 --- a/src/nsp/setup.py +++ b/src/nsp/setup.py @@ -10,7 +10,7 @@ # HISTORY.rst entry. -VERSION = '0.1.0' +VERSION = '0.2.0' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers